Skip to content

Commit

Permalink
Sort members
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Nov 3, 2023
1 parent 69aa2f7 commit 8e2b796
Show file tree
Hide file tree
Showing 181 changed files with 10,079 additions and 10,079 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,73 +100,6 @@ public AbstractMethodRule( final String methodName, final String paramTypeName )
this.paramTypeName = paramTypeName;
}

/**
* <p>
* Is exact matching being used.
* </p>
* <p>
* This rule uses {@code org.apache.commons.beanutils.MethodUtils} to introspect the relevent objects so that
* the right method can be called. Originally, {@code MethodUtils.invokeExactMethod} was used. This matches
* methods very strictly and so may not find a matching method when one exists. This is still the behavior when
* exact matching is enabled.
* </p>
* <p>
* When exact matching is disabled, {@code MethodUtils.invokeMethod} is used. This method finds more methods
* but is less precise when there are several methods with correct signatures. So, if you want to choose an exact
* signature you might need to enable this property.
* </p>
* <p>
* The default setting is to disable exact matches.
* </p>
*
* @return true if exact matching is enabled
* @since 1.1.1
*/
public boolean isExactMatch()
{
return useExactMatch;
}

/**
* Sets this rule be invoked when {@link #begin(String, String, Attributes)} (true)
* or {@link #end(String, String)} (false) methods are invoked, false by default.
*
* @param fireOnBegin flag to mark this rule be invoked when {@link #begin(String, String, Attributes)} (true)
* or {@link #end(String, String)} (false) methods are invoked, false by default.
*/
public void setFireOnBegin( final boolean fireOnBegin )
{
this.fireOnBegin = fireOnBegin;
}

/**
* Returns the flag this rule be invoked when {@link #begin(String, String, Attributes)} (true)
* or {@link #end(String, String)} (false) methods are invoked, false by default.
*
* @return the flag this rule be invoked when {@link #begin(String, String, Attributes)} (true)
* or {@link #end(String, String)} (false) methods are invoked, false by default.
*/
public boolean isFireOnBegin()
{
return fireOnBegin;
}

/**
* <p>
* Sets whether exact matching is enabled.
* </p>
* <p>
* See {@link #isExactMatch()}.
* </p>
*
* @param useExactMatch should this rule use exact method matching
* @since 1.1.1
*/
public void setExactMatch( final boolean useExactMatch )
{
this.useExactMatch = useExactMatch;
}

/**
* {@inheritDoc}
*/
Expand All @@ -193,6 +126,20 @@ public void end( final String namespace, final String name )
}
}

/**
* Returns the argument object of method has to be invoked.
*
* @return the argument object of method has to be invoked.
*/
protected abstract Object getChild();

/**
* Returns the target object of method has to be invoked.
*
* @return the target object of method has to be invoked.
*/
protected abstract Object getParent();

/**
* Just performs the method execution.
*
Expand Down Expand Up @@ -247,18 +194,71 @@ private void invoke()
}

/**
* Returns the argument object of method has to be invoked.
* <p>
* Is exact matching being used.
* </p>
* <p>
* This rule uses {@code org.apache.commons.beanutils.MethodUtils} to introspect the relevent objects so that
* the right method can be called. Originally, {@code MethodUtils.invokeExactMethod} was used. This matches
* methods very strictly and so may not find a matching method when one exists. This is still the behavior when
* exact matching is enabled.
* </p>
* <p>
* When exact matching is disabled, {@code MethodUtils.invokeMethod} is used. This method finds more methods
* but is less precise when there are several methods with correct signatures. So, if you want to choose an exact
* signature you might need to enable this property.
* </p>
* <p>
* The default setting is to disable exact matches.
* </p>
*
* @return the argument object of method has to be invoked.
* @return true if exact matching is enabled
* @since 1.1.1
*/
protected abstract Object getChild();
public boolean isExactMatch()
{
return useExactMatch;
}

/**
* Returns the target object of method has to be invoked.
* Returns the flag this rule be invoked when {@link #begin(String, String, Attributes)} (true)
* or {@link #end(String, String)} (false) methods are invoked, false by default.
*
* @return the target object of method has to be invoked.
* @return the flag this rule be invoked when {@link #begin(String, String, Attributes)} (true)
* or {@link #end(String, String)} (false) methods are invoked, false by default.
*/
protected abstract Object getParent();
public boolean isFireOnBegin()
{
return fireOnBegin;
}

/**
* <p>
* Sets whether exact matching is enabled.
* </p>
* <p>
* See {@link #isExactMatch()}.
* </p>
*
* @param useExactMatch should this rule use exact method matching
* @since 1.1.1
*/
public void setExactMatch( final boolean useExactMatch )
{
this.useExactMatch = useExactMatch;
}

/**
* Sets this rule be invoked when {@link #begin(String, String, Attributes)} (true)
* or {@link #end(String, String)} (false) methods are invoked, false by default.
*
* @param fireOnBegin flag to mark this rule be invoked when {@link #begin(String, String, Attributes)} (true)
* or {@link #end(String, String)} (false) methods are invoked, false by default.
*/
public void setFireOnBegin( final boolean fireOnBegin )
{
this.fireOnBegin = fireOnBegin;
}

/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,29 @@ public abstract class AbstractRulesImpl
* {@inheritDoc}
*/
@Override
public Digester getDigester()
public final void add( final String pattern, final Rule rule )
{
return digester;
// set up rule
if ( this.digester != null )
{
rule.setDigester( this.digester );
}

if ( this.namespaceURI != null )
{
rule.setNamespaceURI( this.namespaceURI );
}

registerRule( pattern, rule );
}

/**
* {@inheritDoc}
*/
@Override
public void setDigester( final Digester digester )
public Digester getDigester()
{
this.digester = digester;
return digester;
}

/**
Expand All @@ -76,43 +87,32 @@ public String getNamespaceURI()
}

/**
* {@inheritDoc}
* Register rule at given pattern. The the Digester and namespaceURI properties of the given {@code Rule} can
* be assumed to have been set properly before this method is called.
*
* @param pattern Nesting pattern to be matched for this Rule
* @param rule Rule instance to be registered
*/
@Override
public void setNamespaceURI( final String namespaceURI )
{
this.namespaceURI = namespaceURI;
}
protected abstract void registerRule( String pattern, Rule rule );

// --------------------------------------------------------- Public Methods

/**
* {@inheritDoc}
*/
@Override
public final void add( final String pattern, final Rule rule )
public void setDigester( final Digester digester )
{
// set up rule
if ( this.digester != null )
{
rule.setDigester( this.digester );
}

if ( this.namespaceURI != null )
{
rule.setNamespaceURI( this.namespaceURI );
}

registerRule( pattern, rule );
this.digester = digester;
}

/**
* Register rule at given pattern. The the Digester and namespaceURI properties of the given {@code Rule} can
* be assumed to have been set properly before this method is called.
*
* @param pattern Nesting pattern to be matched for this Rule
* @param rule Rule instance to be registered
* {@inheritDoc}
*/
protected abstract void registerRule( String pattern, Rule rule );
@Override
public void setNamespaceURI( final String namespaceURI )
{
this.namespaceURI = namespaceURI;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,6 @@ public class BeanPropertySetterRule

// ----------------------------------------------------------- Constructors

/**
* <p>
* Construct rule that sets the given property from the body text.
* </p>
*
* @param propertyName name of property to set
*/
public BeanPropertySetterRule( final String propertyName )
{
this.propertyName = propertyName;
}

/**
* <p>
* Construct rule that automatically sets a property from the body text.
* <p>
* This construct creates a rule that sets the property on the top object named the same as the current element.
*/
public BeanPropertySetterRule()
{
this( null );
}

// ----------------------------------------------------- Instance Variables

/**
* Sets this property on the top object.
*/
Expand All @@ -86,43 +61,37 @@ public BeanPropertySetterRule()
*/
private String propertyNameFromAttribute;

// ----------------------------------------------------- Instance Variables

/**
* The body text used to set the property.
*/
private String bodyText;

// --------------------------------------------------------- Public Methods

/**
* Returns the property name associated to this setter rule.
*
* @return The property name associated to this setter rule
* <p>
* Construct rule that automatically sets a property from the body text.
* <p>
* This construct creates a rule that sets the property on the top object named the same as the current element.
*/
public String getPropertyName()
public BeanPropertySetterRule()
{
return propertyName;
this( null );
}

/**
* Sets the attribute name from which the property name has to be extracted.
* <p>
* Construct rule that sets the given property from the body text.
* </p>
*
* @param propertyNameFromAttribute the attribute name from which the property name has to be extracted.
* @since 3.0
* @param propertyName name of property to set
*/
public void setPropertyNameFromAttribute( final String propertyNameFromAttribute )
public BeanPropertySetterRule( final String propertyName )
{
this.propertyNameFromAttribute = propertyNameFromAttribute;
this.propertyName = propertyName;
}

/**
* Returns the body text used to set the property.
*
* @return The body text used to set the property
*/
protected String getBodyText()
{
return bodyText;
}
// --------------------------------------------------------- Public Methods

/**
* {@inheritDoc}
Expand Down Expand Up @@ -221,6 +190,37 @@ public void finish()
bodyText = null;
}

/**
* Returns the body text used to set the property.
*
* @return The body text used to set the property
*/
protected String getBodyText()
{
return bodyText;
}

/**
* Returns the property name associated to this setter rule.
*
* @return The property name associated to this setter rule
*/
public String getPropertyName()
{
return propertyName;
}

/**
* Sets the attribute name from which the property name has to be extracted.
*
* @param propertyNameFromAttribute the attribute name from which the property name has to be extracted.
* @since 3.0
*/
public void setPropertyNameFromAttribute( final String propertyNameFromAttribute )
{
this.propertyNameFromAttribute = propertyNameFromAttribute;
}

/**
* {@inheritDoc}
*/
Expand Down
Loading

0 comments on commit 8e2b796

Please sign in to comment.