You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/05/12 20:03:33 UTC
svn commit: r1102402 [8/20] - in /commons/sandbox/digester3/trunk/src:
main/java/org/apache/commons/digester3/
main/java/org/apache/commons/digester3/annotations/
main/java/org/apache/commons/digester3/annotations/handlers/
main/java/org/apache/commons...
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/GetDeclaredMethodsPrivilegedAction.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/GetDeclaredMethodsPrivilegedAction.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/GetDeclaredMethodsPrivilegedAction.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/GetDeclaredMethodsPrivilegedAction.java Thu May 12 18:03:26 2011
@@ -21,20 +21,24 @@ import java.lang.reflect.Method;
/**
* Privileged action to extract declared methods of a class.
- *
+ *
* @since 2.2
*/
-public final class GetDeclaredMethodsPrivilegedAction extends AbstractAnnotatedElementPrivilegedAction<Method> {
+public final class GetDeclaredMethodsPrivilegedAction
+ extends AbstractAnnotatedElementPrivilegedAction<Method>
+{
- public GetDeclaredMethodsPrivilegedAction(Class<?> type) {
- super(type);
+ public GetDeclaredMethodsPrivilegedAction( Class<?> type )
+ {
+ super( type );
}
/**
* {@inheritDoc}
*/
@Override
- public Method[] run() {
+ public Method[] run()
+ {
return this.getType().getDeclaredMethods();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/RuleSetCache.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/RuleSetCache.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/RuleSetCache.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/RuleSetCache.java Thu May 12 18:03:26 2011
@@ -25,10 +25,12 @@ import org.apache.commons.digester3.anno
/**
* Simple in-memory LRU cache implementation.
- *
+ *
* @since 2.1
*/
-public final class RuleSetCache implements Serializable {
+public final class RuleSetCache
+ implements Serializable
+{
/**
* This class serialVersionUID.
@@ -48,77 +50,78 @@ public final class RuleSetCache implemen
/**
* The fixed cache capacity.
*/
- private final int capacity = (int) Math.ceil(this.cacheSize / this.loadFactor) + 1;
+ private final int capacity = (int) Math.ceil( this.cacheSize / this.loadFactor ) + 1;
/**
* The map that implements the LRU cache.
*/
private final Map<Class<?>, FromAnnotationsRuleSet> data =
- new LinkedHashMap<Class<?>, FromAnnotationsRuleSet>(capacity, loadFactor) {
+ new LinkedHashMap<Class<?>, FromAnnotationsRuleSet>( capacity, loadFactor )
+ {
- /**
- * This class serialVersionUID.
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean removeEldestEntry(Map.Entry<Class<?>, FromAnnotationsRuleSet> eldest) {
- return size() > cacheSize;
- }
- };
+ /**
+ * This class serialVersionUID.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean removeEldestEntry( Map.Entry<Class<?>, FromAnnotationsRuleSet> eldest )
+ {
+ return size() > cacheSize;
+ }
+ };
/**
* Returns true if this cache contains a mapping for the specified key.
- *
+ *
* @param key key whose presence in this map is to be tested.
- * @return true if this map contains a mapping for the specified key, false
- * otherwise.
+ * @return true if this map contains a mapping for the specified key, false otherwise.
*/
- public boolean containsKey(Class<?> key) {
- checkKey(key);
- return this.data.containsKey(key);
+ public boolean containsKey( Class<?> key )
+ {
+ checkKey( key );
+ return this.data.containsKey( key );
}
/**
- * Returns the value to which the specified key is cached, or null if this
- * cache contains no mapping for the key.
- *
+ * Returns the value to which the specified key is cached, or null if this cache contains no mapping for the key.
* Key parameter must not be null.
- *
+ *
* @param key the key has to be checked it is present, it must not be null.
- * @return the value to which the specified key is cached, null if this
- * cache contains no mapping for the key.
+ * @return the value to which the specified key is cached, null if this cache contains no mapping for the key.
*/
- public FromAnnotationsRuleSet get(Class<?> key) {
- checkKey(key);
- return this.data.get(key);
+ public FromAnnotationsRuleSet get( Class<?> key )
+ {
+ checkKey( key );
+ return this.data.get( key );
}
/**
- * Associates the specified value with the specified key in this cache.
- *
- * Key parameter must not be null.
- *
+ * Associates the specified value with the specified key in this cache. Key parameter must not be null.
+ *
* @param key key with which the specified value is to be associated.
* @param value value to be associated with the specified key.
*/
- public void put(Class<?> key, FromAnnotationsRuleSet value) {
- checkKey(key);
- this.data.put(key, value);
+ public void put( Class<?> key, FromAnnotationsRuleSet value )
+ {
+ checkKey( key );
+ this.data.put( key, value );
}
/**
* Verify that a key is not null.
- *
+ *
* @param <T> the generic key type.
* @param key the key object.
*/
- private static void checkKey(Class<?> key) {
- if (key == null) {
- throw new IllegalArgumentException("null keys not supported");
+ private static void checkKey( Class<?> key )
+ {
+ if ( key == null )
+ {
+ throw new IllegalArgumentException( "null keys not supported" );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/package-info.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/package-info.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/internal/package-info.java Thu May 12 18:03:26 2011
@@ -20,3 +20,4 @@
* This package contains internal use only classes, users can ignore it.
*/
package org.apache.commons.digester3.annotations.internal;
+
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/package-info.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/package-info.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/package-info.java Thu May 12 18:03:26 2011
@@ -21,3 +21,4 @@
* meta data-based definition of rules for <code>Digester</code>.
*/
package org.apache.commons.digester3.annotations;
+
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/AttributeCallParamRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/AttributeCallParamRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/AttributeCallParamRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/AttributeCallParamRuleProvider.java Thu May 12 18:03:26 2011
@@ -24,12 +24,13 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link CallParamRule}.
- *
+ *
* @see CallParamRule#CallParamRule(int,String)
* @since 2.1
*/
public final class AttributeCallParamRuleProvider
- implements AnnotationRuleProvider<AttributeCallParam, MethodArgument, CallParamRule> {
+ implements AnnotationRuleProvider<AttributeCallParam, MethodArgument, CallParamRule>
+{
private String attribute;
@@ -38,7 +39,8 @@ public final class AttributeCallParamRul
/**
* {@inheritDoc}
*/
- public void init(AttributeCallParam annotation, MethodArgument element) {
+ public void init( AttributeCallParam annotation, MethodArgument element )
+ {
this.attribute = annotation.attribute();
this.index = element.getIndex();
}
@@ -46,8 +48,9 @@ public final class AttributeCallParamRul
/**
* {@inheritDoc}
*/
- public CallParamRule get() {
- return new CallParamRule(this.index, this.attribute);
+ public CallParamRule get()
+ {
+ return new CallParamRule( this.index, this.attribute );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/BeanPropertySetterRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/BeanPropertySetterRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/BeanPropertySetterRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/BeanPropertySetterRuleProvider.java Thu May 12 18:03:26 2011
@@ -25,26 +25,29 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@code BeanPropertySetterRule}.
- *
+ *
* @since 2.1
*/
public final class BeanPropertySetterRuleProvider
- implements AnnotationRuleProvider<BeanPropertySetter, Field, BeanPropertySetterRule> {
+ implements AnnotationRuleProvider<BeanPropertySetter, Field, BeanPropertySetterRule>
+{
private String name;
/**
* {@inheritDoc}
*/
- public void init(BeanPropertySetter annotation, Field element) {
+ public void init( BeanPropertySetter annotation, Field element )
+ {
this.name = element.getName();
}
/**
* {@inheritDoc}
*/
- public BeanPropertySetterRule get() {
- return new BeanPropertySetterRule(this.name);
+ public BeanPropertySetterRule get()
+ {
+ return new BeanPropertySetterRule( this.name );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/CallMethodRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/CallMethodRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/CallMethodRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/CallMethodRuleProvider.java Thu May 12 18:03:26 2011
@@ -25,10 +25,12 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@code CallMethodRule}
- *
+ *
* @since 2.1
*/
-public final class CallMethodRuleProvider implements AnnotationRuleProvider<CallMethod, Method, CallMethodRule> {
+public final class CallMethodRuleProvider
+ implements AnnotationRuleProvider<CallMethod, Method, CallMethodRule>
+{
private String methodName;
@@ -37,7 +39,8 @@ public final class CallMethodRuleProvide
/**
* {@inheritDoc}
*/
- public void init(CallMethod annotation, Method element) {
+ public void init( CallMethod annotation, Method element )
+ {
this.methodName = element.getName();
this.parameterTypes = element.getParameterTypes();
}
@@ -45,10 +48,9 @@ public final class CallMethodRuleProvide
/**
* {@inheritDoc}
*/
- public CallMethodRule get() {
- return new CallMethodRule(this.methodName,
- this.parameterTypes.length,
- this.parameterTypes);
+ public CallMethodRule get()
+ {
+ return new CallMethodRule( this.methodName, this.parameterTypes.length, this.parameterTypes );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/CallParamRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/CallParamRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/CallParamRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/CallParamRuleProvider.java Thu May 12 18:03:26 2011
@@ -24,26 +24,30 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link CallParamRule}.
- *
+ *
* @see CallParamRule#CallParamRule(int)
* @since 2.1
*/
-public final class CallParamRuleProvider implements AnnotationRuleProvider<CallParam, MethodArgument, CallParamRule> {
+public final class CallParamRuleProvider
+ implements AnnotationRuleProvider<CallParam, MethodArgument, CallParamRule>
+{
private int index;
/**
* {@inheritDoc}
*/
- public void init(CallParam annotation, MethodArgument element) {
+ public void init( CallParam annotation, MethodArgument element )
+ {
this.index = element.getIndex();
}
/**
* {@inheritDoc}
*/
- public CallParamRule get() {
- return new CallParamRule(this.index);
+ public CallParamRule get()
+ {
+ return new CallParamRule( this.index );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/FactoryCreateRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/FactoryCreateRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/FactoryCreateRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/FactoryCreateRuleProvider.java Thu May 12 18:03:26 2011
@@ -23,11 +23,12 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link FactoryCreateRule}.
- *
+ *
* @since 2.1
*/
public final class FactoryCreateRuleProvider
- implements AnnotationRuleProvider<FactoryCreate, Class<?>, FactoryCreateRule> {
+ implements AnnotationRuleProvider<FactoryCreate, Class<?>, FactoryCreateRule>
+{
private Class<?> factoryClass;
@@ -36,7 +37,8 @@ public final class FactoryCreateRuleProv
/**
* {@inheritDoc}
*/
- public void init(FactoryCreate annotation, Class<?> element) {
+ public void init( FactoryCreate annotation, Class<?> element )
+ {
this.factoryClass = annotation.factoryClass();
this.ignoreCreateExceptions = annotation.ignoreCreateExceptions();
}
@@ -44,9 +46,9 @@ public final class FactoryCreateRuleProv
/**
* {@inheritDoc}
*/
- public FactoryCreateRule get() {
- return new FactoryCreateRule(this.factoryClass,
- this.ignoreCreateExceptions);
+ public FactoryCreateRule get()
+ {
+ return new FactoryCreateRule( this.factoryClass, this.ignoreCreateExceptions );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/ObjectCreateRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/ObjectCreateRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/ObjectCreateRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/ObjectCreateRuleProvider.java Thu May 12 18:03:26 2011
@@ -23,26 +23,29 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link ObjectCreateRule}.
- *
+ *
* @since 2.1
*/
public final class ObjectCreateRuleProvider
- implements AnnotationRuleProvider<ObjectCreate, Class<?>, ObjectCreateRule> {
+ implements AnnotationRuleProvider<ObjectCreate, Class<?>, ObjectCreateRule>
+{
private Class<?> clazz;
/**
* {@inheritDoc}
*/
- public void init(ObjectCreate annotation, Class<?> element) {
+ public void init( ObjectCreate annotation, Class<?> element )
+ {
this.clazz = element;
}
/**
* {@inheritDoc}
*/
- public ObjectCreateRule get() {
- return new ObjectCreateRule(this.clazz);
+ public ObjectCreateRule get()
+ {
+ return new ObjectCreateRule( this.clazz );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/PathCallParamRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/PathCallParamRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/PathCallParamRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/PathCallParamRuleProvider.java Thu May 12 18:03:26 2011
@@ -24,26 +24,29 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link PathCallParamRule}.
- *
+ *
* @since 2.1
*/
public final class PathCallParamRuleProvider
- implements AnnotationRuleProvider<PathCallParam, MethodArgument, PathCallParamRule> {
+ implements AnnotationRuleProvider<PathCallParam, MethodArgument, PathCallParamRule>
+{
private int index;
/**
* {@inheritDoc}
*/
- public void init(PathCallParam annotation, MethodArgument element) {
+ public void init( PathCallParam annotation, MethodArgument element )
+ {
this.index = element.getIndex();
}
/**
* {@inheritDoc}
*/
- public PathCallParamRule get() {
- return new PathCallParamRule(this.index);
+ public PathCallParamRule get()
+ {
+ return new PathCallParamRule( this.index );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetNextRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetNextRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetNextRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetNextRuleProvider.java Thu May 12 18:03:26 2011
@@ -25,10 +25,12 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link SetNextRule}.
- *
+ *
* @since 2.1
*/
-public final class SetNextRuleProvider implements AnnotationRuleProvider<SetNext, Method, SetNextRule> {
+public final class SetNextRuleProvider
+ implements AnnotationRuleProvider<SetNext, Method, SetNextRule>
+{
private String methodName;
@@ -37,7 +39,8 @@ public final class SetNextRuleProvider i
/**
* {@inheritDoc}
*/
- public void init(SetNext annotation, Method element) {
+ public void init( SetNext annotation, Method element )
+ {
this.methodName = element.getName();
this.paramType = element.getParameterTypes()[0].getName();
}
@@ -45,8 +48,9 @@ public final class SetNextRuleProvider i
/**
* {@inheritDoc}
*/
- public SetNextRule get() {
- return new SetNextRule(this.methodName, this.paramType);
+ public SetNextRule get()
+ {
+ return new SetNextRule( this.methodName, this.paramType );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetPropertiesRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetPropertiesRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetPropertiesRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetPropertiesRuleProvider.java Thu May 12 18:03:26 2011
@@ -28,10 +28,12 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@code SetPropertiesRule}.
- *
+ *
* @since 2.1
*/
-public final class SetPropertiesRuleProvider implements AnnotationRuleProvider<SetProperty, Field, SetPropertiesRule> {
+public final class SetPropertiesRuleProvider
+ implements AnnotationRuleProvider<SetProperty, Field, SetPropertiesRule>
+{
/**
* The data structure that stores the aliases.
@@ -41,42 +43,49 @@ public final class SetPropertiesRuleProv
/**
* {@inheritDoc}
*/
- public void init(SetProperty annotation, Field element) {
- this.addAlias(annotation, element);
+ public void init( SetProperty annotation, Field element )
+ {
+ this.addAlias( annotation, element );
}
/**
- * Adds a new alias attribute/property name; if the attribute name is not
- * specified, the alias will be considered as property name identity.
- *
+ * Adds a new alias attribute/property name; if the attribute name is not specified, the alias will be considered as
+ * property name identity.
+ *
* @param annotation the {@link SetProperty} reference.
* @param element the annotated element reference.
*/
- public void addAlias(SetProperty annotation, Field element) {
+ public void addAlias( SetProperty annotation, Field element )
+ {
String attributeName = annotation.attributeName();
String propertyName = element.getName();
- if (attributeName.length() > 0) {
- this.aliases.put(attributeName, propertyName);
- } else {
- this.aliases.put(propertyName, propertyName);
+ if ( attributeName.length() > 0 )
+ {
+ this.aliases.put( attributeName, propertyName );
+ }
+ else
+ {
+ this.aliases.put( propertyName, propertyName );
}
}
/**
* {@inheritDoc}
*/
- public SetPropertiesRule get() {
+ public SetPropertiesRule get()
+ {
String[] attributeNames = new String[this.aliases.size()];
String[] propertyNames = new String[this.aliases.size()];
int i = 0;
- for (Entry<String, String> alias : this.aliases.entrySet()) {
+ for ( Entry<String, String> alias : this.aliases.entrySet() )
+ {
attributeNames[i] = alias.getKey();
propertyNames[i++] = alias.getValue();
}
- return new SetPropertiesRule(attributeNames, propertyNames);
+ return new SetPropertiesRule( attributeNames, propertyNames );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetRootRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetRootRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetRootRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetRootRuleProvider.java Thu May 12 18:03:26 2011
@@ -25,10 +25,12 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link SetRootRule}.
- *
+ *
* @since 2.1
*/
-public final class SetRootRuleProvider implements AnnotationRuleProvider<SetRoot, Method, SetRootRule>{
+public final class SetRootRuleProvider
+ implements AnnotationRuleProvider<SetRoot, Method, SetRootRule>
+{
private String methodName;
@@ -37,7 +39,8 @@ public final class SetRootRuleProvider i
/**
* {@inheritDoc}
*/
- public void init(SetRoot annotation, Method element) {
+ public void init( SetRoot annotation, Method element )
+ {
this.methodName = element.getName();
this.paramType = element.getParameterTypes()[0].getName();
}
@@ -45,8 +48,9 @@ public final class SetRootRuleProvider i
/**
* {@inheritDoc}
*/
- public SetRootRule get() {
- return new SetRootRule(this.methodName, this.paramType);
+ public SetRootRule get()
+ {
+ return new SetRootRule( this.methodName, this.paramType );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetTopRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetTopRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetTopRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/SetTopRuleProvider.java Thu May 12 18:03:26 2011
@@ -25,10 +25,12 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link SetTopRule}.
- *
+ *
* @since 2.1
*/
-public final class SetTopRuleProvider implements AnnotationRuleProvider<SetTop, Method, SetTopRule>{
+public final class SetTopRuleProvider
+ implements AnnotationRuleProvider<SetTop, Method, SetTopRule>
+{
private String methodName;
@@ -37,7 +39,8 @@ public final class SetTopRuleProvider im
/**
* {@inheritDoc}
*/
- public void init(SetTop annotation, Method element) {
+ public void init( SetTop annotation, Method element )
+ {
this.methodName = element.getName();
this.paramType = element.getParameterTypes()[0].getName();
}
@@ -45,8 +48,9 @@ public final class SetTopRuleProvider im
/**
* {@inheritDoc}
*/
- public SetTopRule get() {
- return new SetTopRule(this.methodName, this.paramType);
+ public SetTopRule get()
+ {
+ return new SetTopRule( this.methodName, this.paramType );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/StackCallParamRuleProvider.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/StackCallParamRuleProvider.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/StackCallParamRuleProvider.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/StackCallParamRuleProvider.java Thu May 12 18:03:26 2011
@@ -24,12 +24,13 @@ import org.apache.commons.digester3.anno
/**
* Provides instances of {@link CallParamRule}.
- *
+ *
* @see CallParamRule#CallParamRule(int,int)
* @since 2.1
*/
public final class StackCallParamRuleProvider
- implements AnnotationRuleProvider<StackCallParam, MethodArgument, CallParamRule> {
+ implements AnnotationRuleProvider<StackCallParam, MethodArgument, CallParamRule>
+{
private int paramIndex;
@@ -38,7 +39,8 @@ public final class StackCallParamRulePro
/**
* {@inheritDoc}
*/
- public void init(StackCallParam annotation, MethodArgument element) {
+ public void init( StackCallParam annotation, MethodArgument element )
+ {
this.paramIndex = element.getIndex();
this.stackIndex = annotation.stackIndex();
}
@@ -46,8 +48,9 @@ public final class StackCallParamRulePro
/**
* {@inheritDoc}
*/
- public CallParamRule get() {
- return new CallParamRule(this.paramIndex, this.stackIndex);
+ public CallParamRule get()
+ {
+ return new CallParamRule( this.paramIndex, this.stackIndex );
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/package-info.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/package-info.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/providers/package-info.java Thu May 12 18:03:26 2011
@@ -22,3 +22,4 @@
* implementations.
*/
package org.apache.commons.digester3.annotations.providers;
+
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/MethodArgument.java Thu May 12 18:03:26 2011
@@ -21,12 +21,13 @@ import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
/**
- * Class to supply the missing Java {@code AnnotatedElement} for method
- * arguments.
- *
+ * Class to supply the missing Java {@code AnnotatedElement} for method arguments.
+ *
* @since 2.1
*/
-public final class MethodArgument implements AnnotatedElement {
+public final class MethodArgument
+ implements AnnotatedElement
+{
/**
* The method argument index.
@@ -45,12 +46,13 @@ public final class MethodArgument implem
/**
* Creates a new method argument as {@code AnnotatedElement}.
- *
+ *
* @param index the method argument index.
* @param parameterType the method argument type.
* @param annotations the method argument annotations.
*/
- public MethodArgument(int index, Class<?> parameterType, Annotation[] annotations) {
+ public MethodArgument( int index, Class<?> parameterType, Annotation[] annotations )
+ {
this.index = index;
this.parameterType = parameterType;
this.annotations = annotations;
@@ -58,29 +60,34 @@ public final class MethodArgument implem
/**
* Returns the method argument index.
- *
+ *
* @return the method argument index.
*/
- public int getIndex() {
+ public int getIndex()
+ {
return this.index;
}
/**
* Returns the method argument type.
- *
+ *
* @return the method argument type.
*/
- public Class<?> getParameterType() {
+ public Class<?> getParameterType()
+ {
return this.parameterType;
}
/**
* {@inheritDoc}
*/
- public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
- for (Annotation annotation : this.annotations) {
- if (annotationType == annotation.annotationType()) {
- return annotationType.cast(annotation);
+ public <T extends Annotation> T getAnnotation( Class<T> annotationType )
+ {
+ for ( Annotation annotation : this.annotations )
+ {
+ if ( annotationType == annotation.annotationType() )
+ {
+ return annotationType.cast( annotation );
}
}
return null;
@@ -89,36 +96,40 @@ public final class MethodArgument implem
/**
* {@inheritDoc}
*/
- public Annotation[] getAnnotations() {
+ public Annotation[] getAnnotations()
+ {
return this.getAnnotationsArrayCopy();
}
/**
* {@inheritDoc}
*/
- public Annotation[] getDeclaredAnnotations() {
+ public Annotation[] getDeclaredAnnotations()
+ {
return this.getAnnotationsArrayCopy();
}
/**
- * Returns an annotations array, copy of the declared annotations in this
- * method argument.
- *
- * @return an annotations array, copy of the declared annotations in this
- * method argument.
+ * Returns an annotations array, copy of the declared annotations in this method argument.
+ *
+ * @return an annotations array, copy of the declared annotations in this method argument.
*/
- private Annotation[] getAnnotationsArrayCopy() {
+ private Annotation[] getAnnotationsArrayCopy()
+ {
Annotation[] annotations = new Annotation[this.annotations.length];
- System.arraycopy(this.annotations, 0, annotations, 0, annotations.length);
+ System.arraycopy( this.annotations, 0, annotations, 0, annotations.length );
return annotations;
}
/**
* {@inheritDoc}
*/
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
- for (Annotation annotation : this.annotations) {
- if (annotationType == annotation.annotationType()) {
+ public boolean isAnnotationPresent( Class<? extends Annotation> annotationType )
+ {
+ for ( Annotation annotation : this.annotations )
+ {
+ if ( annotationType == annotation.annotationType() )
+ {
return true;
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/package-info.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/package-info.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/reflect/package-info.java Thu May 12 18:03:26 2011
@@ -21,3 +21,4 @@
* manipulate entities as {@link java.lang.reflect.AnnotatedElement}.
*/
package org.apache.commons.digester3.annotations.reflect;
+
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/AttributeCallParam.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/AttributeCallParam.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/AttributeCallParam.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/AttributeCallParam.java Thu May 12 18:03:26 2011
@@ -29,45 +29,43 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.AttributeCallParamRuleProvider;
/**
- * Methods arguments annotated with {@code AttributeCallParam} will be bound
- * with {@code CallParamRule} digester rule.
- *
+ * Methods arguments annotated with {@code AttributeCallParam} will be bound with {@code CallParamRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addCallParam(String,int,String)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PARAMETER)
-@DigesterRule(
- reflectsRule = CallParamRule.class,
- providedBy = AttributeCallParamRuleProvider.class
-)
-public @interface AttributeCallParam {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.PARAMETER )
+@DigesterRule( reflectsRule = CallParamRule.class, providedBy = AttributeCallParamRuleProvider.class )
+public @interface AttributeCallParam
+{
/**
* Attribute whose value is used as the parameter value.
- *
+ *
* @return the attribute whose value is used as the parameter value.
*/
String attribute();
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
* Defines several {@code @AttributeCallParam} annotations on the same element.
- *
+ *
* @see AttributeCallParam
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
AttributeCallParam[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/BeanPropertySetter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/BeanPropertySetter.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/BeanPropertySetter.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/BeanPropertySetter.java Thu May 12 18:03:26 2011
@@ -29,38 +29,36 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.BeanPropertySetterRuleProvider;
/**
- * Fields annotated with {@code BeanPropertySetter} will be bound with
- * {@code BeanPropertySetterRule} digester rule.
- *
+ * Fields annotated with {@code BeanPropertySetter} will be bound with {@code BeanPropertySetterRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addBeanPropertySetter(String,String)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-@DigesterRule(
- reflectsRule = BeanPropertySetterRule.class,
- providedBy = BeanPropertySetterRuleProvider.class
-)
-public @interface BeanPropertySetter {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.FIELD )
+@DigesterRule( reflectsRule = BeanPropertySetterRule.class, providedBy = BeanPropertySetterRuleProvider.class )
+public @interface BeanPropertySetter
+{
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
* Defines several {@code @BeanPropertySetter} annotations on the same element.
- *
+ *
* @see BeanPropertySetter
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
BeanPropertySetter[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/CallMethod.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/CallMethod.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/CallMethod.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/CallMethod.java Thu May 12 18:03:26 2011
@@ -29,38 +29,36 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.CallMethodRuleProvider;
/**
- * Methods annotated with {@code CallMethod} will be bound with
- * {@code CallMethodRule} digester rule.
- *
+ * Methods annotated with {@code CallMethod} will be bound with {@code CallMethodRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addCallMethod(String,String,int,Class[])
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-@DigesterRule(
- reflectsRule = CallMethodRule.class,
- providedBy = CallMethodRuleProvider.class
-)
-public @interface CallMethod {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.METHOD )
+@DigesterRule( reflectsRule = CallMethodRule.class, providedBy = CallMethodRuleProvider.class )
+public @interface CallMethod
+{
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
* Defines several {@code @CallMethod} annotations on the same element.
- *
+ *
* @see CallMethod
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
CallMethod[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/CallParam.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/CallParam.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/CallParam.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/CallParam.java Thu May 12 18:03:26 2011
@@ -29,38 +29,36 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.CallParamRuleProvider;
/**
- * Methods arguments annotated with {@code CallParam} will be bound with
- * {@code CallParamRule} digester rule.
- *
+ * Methods arguments annotated with {@code CallParam} will be bound with {@code CallParamRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addCallParam(String,int)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PARAMETER)
-@DigesterRule(
- reflectsRule = CallParamRule.class,
- providedBy = CallParamRuleProvider.class
-)
-public @interface CallParam {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.PARAMETER )
+@DigesterRule( reflectsRule = CallParamRule.class, providedBy = CallParamRuleProvider.class )
+public @interface CallParam
+{
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
* Defines several {@code @CallParam} annotations on the same element.
- *
+ *
* @see CallParam
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
CallParam[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/FactoryCreate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/FactoryCreate.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/FactoryCreate.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/FactoryCreate.java Thu May 12 18:03:26 2011
@@ -31,54 +31,51 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.FactoryCreateRuleProvider;
/**
- * Classes annotated with {@code FactoryCreate} will be bound with
- * {@code FactoryCreateRule} digester rule.
- *
+ * Classes annotated with {@code FactoryCreate} will be bound with {@code FactoryCreateRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addFactoryCreate(String,org.apache.commons.digester3.ObjectCreationFactory,boolean)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.TYPE )
@CreationRule
-@DigesterRule(
- reflectsRule = FactoryCreateRule.class,
- providedBy = FactoryCreateRuleProvider.class
-)
-public @interface FactoryCreate {
+@DigesterRule( reflectsRule = FactoryCreateRule.class, providedBy = FactoryCreateRuleProvider.class )
+public @interface FactoryCreate
+{
/**
* The Java class of the object creation factory class
- *
+ *
* @return the Java class of the object creation factory class.
*/
Class<? extends AbstractObjectCreationFactory> factoryClass();
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
* When true any exceptions thrown during object creation will be ignored.
- *
- * @return when true any exceptions thrown during object creation will be
- * ignored.
+ *
+ * @return when true any exceptions thrown during object creation will be ignored.
*/
boolean ignoreCreateExceptions() default false;
/**
* Defines several {@code @FactoryCreate} annotations on the same element.
- *
+ *
* @see FactoryCreate
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
FactoryCreate[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/ObjectCreate.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/ObjectCreate.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/ObjectCreate.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/ObjectCreate.java Thu May 12 18:03:26 2011
@@ -30,39 +30,37 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.ObjectCreateRuleProvider;
/**
- * Classes annotated with {@code ObjectCreate} will be bound with
- * {@code ObjectCreateRule} digester rule.
- *
+ * Classes annotated with {@code ObjectCreate} will be bound with {@code ObjectCreateRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addObjectCreate(String,Class)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.TYPE )
@CreationRule
-@DigesterRule(
- reflectsRule = ObjectCreateRule.class,
- providedBy = ObjectCreateRuleProvider.class
-)
-public @interface ObjectCreate {
+@DigesterRule( reflectsRule = ObjectCreateRule.class, providedBy = ObjectCreateRuleProvider.class )
+public @interface ObjectCreate
+{
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
* Defines several {@code @ObjectCreate} annotations on the same element.
- *
+ *
* @see ObjectCreate
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
ObjectCreate[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/PathCallParam.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/PathCallParam.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/PathCallParam.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/PathCallParam.java Thu May 12 18:03:26 2011
@@ -29,38 +29,36 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.PathCallParamRuleProvider;
/**
- * Methods arguments annotated with {@code PathCallParam} will be bound
- * with {@code PathCallParamRule} digester rule.
- *
+ * Methods arguments annotated with {@code PathCallParam} will be bound with {@code PathCallParamRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addCallParamPath(String,int)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PARAMETER)
-@DigesterRule(
- reflectsRule = PathCallParamRule.class,
- providedBy = PathCallParamRuleProvider.class
-)
-public @interface PathCallParam {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.PARAMETER )
+@DigesterRule( reflectsRule = PathCallParamRule.class, providedBy = PathCallParamRuleProvider.class )
+public @interface PathCallParam
+{
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
* Defines several {@code @PathCallParam} annotations on the same element.
- *
+ *
* @see PathCallParam
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
PathCallParam[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetNext.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetNext.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetNext.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetNext.java Thu May 12 18:03:26 2011
@@ -29,28 +29,22 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.SetNextRuleProvider;
/**
- * Methods annotated with {@code SetNext} will be bound
- * with {@code SetNextRule} digester rule.
- *
+ * Methods annotated with {@code SetNext} will be bound with {@code SetNextRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addSetNext(String,String,String)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-@DigesterRule(
- reflectsRule = SetNextRule.class,
- providedBy = SetNextRuleProvider.class,
- handledBy = MethodHandler.class
-)
-public @interface SetNext {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.METHOD )
+@DigesterRule( reflectsRule = SetNextRule.class, providedBy = SetNextRuleProvider.class, handledBy = MethodHandler.class )
+public @interface SetNext
+{
/**
- * Defines the concrete implementation(s) of @SetNext annotated method
- * argument.
- *
- * @return the concrete implementation(s) of @SetNext annotated method
- * argument.
+ * Defines the concrete implementation(s) of @SetNext annotated method argument.
+ *
+ * @return the concrete implementation(s) of @SetNext annotated method argument.
*/
Class<?>[] value() default {};
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetProperty.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetProperty.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetProperty.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetProperty.java Thu May 12 18:03:26 2011
@@ -30,46 +30,43 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.SetPropertiesRuleProvider;
/**
- * Fields annotated with {@code SetProperty} will be bound
- * with {@code SetPropertiesRule} digester rule.
- *
+ * Fields annotated with {@code SetProperty} will be bound with {@code SetPropertiesRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addSetProperties(String,String[],String[])
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-@DigesterRule(
- reflectsRule = SetPropertiesRule.class,
- providedBy = SetPropertiesRuleProvider.class,
- handledBy = SetPropertiesLoaderHandler.class
-)
-public @interface SetProperty {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.FIELD )
+@DigesterRule( reflectsRule = SetPropertiesRule.class, providedBy = SetPropertiesRuleProvider.class, handledBy = SetPropertiesLoaderHandler.class )
+public @interface SetProperty
+{
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
* The overridden parameter.
- *
+ *
* @return the overridden parameter.
*/
String attributeName() default "";
/**
* Defines several {@code @SetProperty} annotations on the same element.
- *
+ *
* @see SetProperty
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
SetProperty[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetRoot.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetRoot.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetRoot.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetRoot.java Thu May 12 18:03:26 2011
@@ -29,28 +29,22 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.SetRootRuleProvider;
/**
- * Methods annotated with {@code SetRoot} will be bound
- * with {@code SetRootRule} digester rule.
- *
+ * Methods annotated with {@code SetRoot} will be bound with {@code SetRootRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addSetRoot(String,String,String)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-@DigesterRule(
- reflectsRule = SetRootRule.class,
- providedBy = SetRootRuleProvider.class,
- handledBy = MethodHandler.class
-)
-public @interface SetRoot {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.METHOD )
+@DigesterRule( reflectsRule = SetRootRule.class, providedBy = SetRootRuleProvider.class, handledBy = MethodHandler.class )
+public @interface SetRoot
+{
/**
- * Defines the concrete implementation(s) of @SetRoot annotated method
- * argument.
- *
- * @return the concrete implementation(s) of @SetRoot annotated method
- * argument.
+ * Defines the concrete implementation(s) of @SetRoot annotated method argument.
+ *
+ * @return the concrete implementation(s) of @SetRoot annotated method argument.
*/
Class<?>[] value() default {};
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetTop.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetTop.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetTop.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/SetTop.java Thu May 12 18:03:26 2011
@@ -29,38 +29,36 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.SetTopRuleProvider;
/**
- * Methods annotated with {@code SetTop} will be bound
- * with {@code SetTopRule} digester rule.
- *
+ * Methods annotated with {@code SetTop} will be bound with {@code SetTopRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addSetTop(String,String,String)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-@DigesterRule(
- reflectsRule = SetTopRule.class,
- providedBy = SetTopRuleProvider.class
-)
-public @interface SetTop {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.METHOD )
+@DigesterRule( reflectsRule = SetTopRule.class, providedBy = SetTopRuleProvider.class )
+public @interface SetTop
+{
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
- * Defines several {@code @SetTop} annotations on the same element
- *
+ * Defines several {@code @SetTop} annotations on the same element
+ *
* @see SetTop
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
SetTop[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/StackCallParam.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/StackCallParam.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/StackCallParam.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/StackCallParam.java Thu May 12 18:03:26 2011
@@ -29,46 +29,44 @@ import org.apache.commons.digester3.anno
import org.apache.commons.digester3.annotations.providers.StackCallParamRuleProvider;
/**
- * Methods arguments annotated with {@code StackCallParam} will be bound
- * with {@code CallParamRule} digester rule.
- *
+ * Methods arguments annotated with {@code StackCallParam} will be bound with {@code CallParamRule} digester rule.
+ *
* @see org.apache.commons.digester3.Digester#addCallParam(String,int,int)
* @since 2.1
*/
@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PARAMETER)
-@DigesterRule(
- reflectsRule = CallParamRule.class,
- providedBy = StackCallParamRuleProvider.class
-)
-public @interface StackCallParam {
+@Retention( RetentionPolicy.RUNTIME )
+@Target( ElementType.PARAMETER )
+@DigesterRule( reflectsRule = CallParamRule.class, providedBy = StackCallParamRuleProvider.class )
+public @interface StackCallParam
+{
/**
* The element matching pattern.
- *
+ *
* @return the element matching pattern.
*/
String pattern();
/**
- * The call parameter to the stackIndex'th object down the stack, where 0 is
- * the top of the stack, 1 the next element down and so on.
- *
+ * The call parameter to the stackIndex'th object down the stack, where 0 is the top of the stack, 1 the next
+ * element down and so on.
+ *
* @return the stackIndex'th object down the stack.
*/
int stackIndex() default 0;
/**
* Defines several {@code StackCallParam} annotations on the same element.
- *
+ *
* @see StackCallParam
*/
@Documented
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
+ @Retention( RetentionPolicy.RUNTIME )
+ @Target( ElementType.TYPE )
@DigesterRuleList
- @interface List {
+ @interface List
+ {
StackCallParam[] value();
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/package-info.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/package-info.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/rules/package-info.java Thu May 12 18:03:26 2011
@@ -20,3 +20,4 @@
* Classes contained in this package are annotations that reflect Digester rules.
*/
package org.apache.commons.digester3.annotations.rules;
+
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/AnnotationRuleProviderFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/AnnotationRuleProviderFactory.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/AnnotationRuleProviderFactory.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/AnnotationRuleProviderFactory.java Thu May 12 18:03:26 2011
@@ -26,21 +26,21 @@ import org.apache.commons.digester3.anno
/**
* An object capable of providing instances of {@link AnnotationRuleProvider}.
- *
+ *
* @since 2.1
*/
-public interface AnnotationRuleProviderFactory {
+public interface AnnotationRuleProviderFactory
+{
/**
* Return an {@link AnnotationRuleProvider} instance of the specified type.
- *
+ *
* @param <T> the {@link AnnotationRuleProvider} type.
* @param type the class of the object to be returned.
* @return an instance of the specified class.
- * @throws DigesterLoadingException if any error occurs while creating the
- * {@code type} instance.
+ * @throws DigesterLoadingException if any error occurs while creating the {@code type} instance.
*/
- <T extends AnnotationRuleProvider<? extends Annotation, ? extends AnnotatedElement, ? extends Rule>>
- T newInstance(Class<T> type) throws DigesterLoadingException;
+ <T extends AnnotationRuleProvider<? extends Annotation, ? extends AnnotatedElement, ? extends Rule>> T newInstance( Class<T> type )
+ throws DigesterLoadingException;
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/DigesterLoaderHandlerFactory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/DigesterLoaderHandlerFactory.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/DigesterLoaderHandlerFactory.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/DigesterLoaderHandlerFactory.java Thu May 12 18:03:26 2011
@@ -25,21 +25,21 @@ import org.apache.commons.digester3.anno
/**
* An object capable of providing instances of {@link DigesterLoaderHandler}.
- *
+ *
* @since 2.1
*/
-public interface DigesterLoaderHandlerFactory {
+public interface DigesterLoaderHandlerFactory
+{
/**
* Return an instance of the specified type.
- *
+ *
* @param <L>
* @param type the class of the object to be returned.
* @return an instance of the specified class.
- * @throws DigesterLoadingException if any error occurs while creating the
- * {@code type} instance.
+ * @throws DigesterLoadingException if any error occurs while creating the {@code type} instance.
*/
- <L extends DigesterLoaderHandler<? extends Annotation, ? extends AnnotatedElement>> L newInstance(
- Class<L> type) throws DigesterLoadingException;
+ <L extends DigesterLoaderHandler<? extends Annotation, ? extends AnnotatedElement>> L newInstance( Class<L> type )
+ throws DigesterLoadingException;
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/package-info.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/package-info.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/spi/package-info.java Thu May 12 18:03:26 2011
@@ -20,3 +20,4 @@
* Contains annotations package SPI definition.
*/
package org.apache.commons.digester3.annotations.spi;
+
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/AnnotationUtils.java Thu May 12 18:03:26 2011
@@ -23,10 +23,11 @@ import org.apache.commons.beanutils.Meth
/**
* Simple utility class to introspect annotations.
- *
+ *
* @since 2.1
*/
-public class AnnotationUtils {
+public class AnnotationUtils
+{
/**
* The {@code value} string constant.
@@ -41,46 +42,50 @@ public class AnnotationUtils {
/**
* This class can't be instantiated.
*/
- private AnnotationUtils() {
+ private AnnotationUtils()
+ {
// this class can' be instantiated
}
/**
* Extract the {@code value()} from annotation.
- *
+ *
* @param annotation the annotation has to be introspected.
* @return the annotation {@code value()}.
*/
- public static Object getAnnotationValue(Annotation annotation) {
- return invokeAnnotationMethod(annotation, VALUE);
+ public static Object getAnnotationValue( Annotation annotation )
+ {
+ return invokeAnnotationMethod( annotation, VALUE );
}
/**
* Extract the {@code pattern()} from annotation.
- *
+ *
* @param annotation the annotation has to be introspected.
* @return the annotation {@code pattern()}.
*/
- public static String getAnnotationPattern(Annotation annotation) {
- Object ret = invokeAnnotationMethod(annotation, PATTERN);
- if (ret != null) {
+ public static String getAnnotationPattern( Annotation annotation )
+ {
+ Object ret = invokeAnnotationMethod( annotation, PATTERN );
+ if ( ret != null )
+ {
return (String) ret;
}
return null;
}
/**
- * Extract the Annotations array {@code value()} from annotation if present,
- * nul otherwise.
- *
+ * Extract the Annotations array {@code value()} from annotation if present, nul otherwise.
+ *
* @param annotation the annotation has to be introspected.
* @return the annotation {@code value()} as Annotations array.
*/
- public static Annotation[] getAnnotationsArrayValue(Annotation annotation) {
- Object value = getAnnotationValue(annotation);
- if (value != null
- && value.getClass().isArray()
- && Annotation.class.isAssignableFrom(value.getClass().getComponentType())) {
+ public static Annotation[] getAnnotationsArrayValue( Annotation annotation )
+ {
+ Object value = getAnnotationValue( annotation );
+ if ( value != null && value.getClass().isArray()
+ && Annotation.class.isAssignableFrom( value.getClass().getComponentType() ) )
+ {
return (Annotation[]) value;
}
return null;
@@ -88,15 +93,19 @@ public class AnnotationUtils {
/**
* Invokes an annotation method.
- *
+ *
* @param annotationn the annotation has to be introspected.
* @param method the method name to execute.
* @return the annotation method value, null if any error occurs.
*/
- private static Object invokeAnnotationMethod(Annotation annotation, String method) {
- try {
- return MethodUtils.invokeExactMethod(annotation, method, null);
- } catch (Throwable t) {
+ private static Object invokeAnnotationMethod( Annotation annotation, String method )
+ {
+ try
+ {
+ return MethodUtils.invokeExactMethod( annotation, method, null );
+ }
+ catch ( Throwable t )
+ {
return null;
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/package-info.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/package-info.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/utils/package-info.java Thu May 12 18:03:26 2011
@@ -20,3 +20,4 @@
* Contains commons utilities classes for Java5 Annotations manipulation.
*/
package org.apache.commons.digester3.annotations.utils;
+
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/package-info.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/package-info.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/package-info.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/package-info.java Thu May 12 18:03:26 2011
@@ -23,3 +23,4 @@
* at run-time.
*/
package org.apache.commons.digester3;
+
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/Declaration.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/Declaration.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/Declaration.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/Declaration.java Thu May 12 18:03:26 2011
@@ -23,194 +23,204 @@ import org.apache.commons.logging.Log;
import org.apache.commons.digester3.Digester;
/**
- * Represents a Class that can be instantiated by a PluginCreateRule, plus
- * info on how to load custom digester rules for mapping xml into that
- * plugged-in class.
- *
+ * Represents a Class that can be instantiated by a PluginCreateRule, plus info on how to load custom digester rules for
+ * mapping xml into that plugged-in class.
+ *
* @since 1.6
*/
-public class Declaration {
-
+public class Declaration
+{
+
/** The class of the object to be instantiated. */
private Class<?> pluginClass;
/** The name of the class of the object to be instantiated. */
private String pluginClassName;
-
- /** See {@link #setId}. */
+
+ /** See {@link #setId}. */
private String id;
-
+
/** See {@link #setProperties}. */
private Properties properties = new Properties();
-
+
/** See {@link #init}. */
private boolean initialized = false;
/**
- * Class which is responsible for dynamically loading this
- * plugin's rules on demand.
+ * Class which is responsible for dynamically loading this plugin's rules on demand.
*/
private RuleLoader ruleLoader = null;
-
- //---------------------- constructors ----------------------------------
+
+ // ---------------------- constructors ----------------------------------
/**
* Constructor.
*/
- public Declaration(String pluginClassName) {
+ public Declaration( String pluginClassName )
+ {
// We can't load the pluginClass at this time, because we don't
// have a digester instance yet to load it through. So just
// save the name away, and we'll load the Class object in the
// init method.
this.pluginClassName = pluginClassName;
}
-
+
/**
* Constructor.
*/
- public Declaration(Class<?> pluginClass) {
+ public Declaration( Class<?> pluginClass )
+ {
this.pluginClass = pluginClass;
this.pluginClassName = pluginClass.getName();
}
-
+
/**
- * Create an instance where a fully-initialised ruleLoader instance
- * is provided by the caller instead of having the PluginManager
- * "discover" an appropriate one.
+ * Create an instance where a fully-initialised ruleLoader instance is provided by the caller instead of having the
+ * PluginManager "discover" an appropriate one.
*/
- public Declaration(Class<?> pluginClass, RuleLoader ruleLoader) {
+ public Declaration( Class<?> pluginClass, RuleLoader ruleLoader )
+ {
this.pluginClass = pluginClass;
this.pluginClassName = pluginClass.getName();
this.ruleLoader = ruleLoader;
}
-
- //---------------------- properties -----------------------------------
- /**
- * The id that the user associated with a particular plugin declaration
- * in the input xml. This id is later used in the input xml to refer
- * back to the original declaration.
+ // ---------------------- properties -----------------------------------
+
+ /**
+ * The id that the user associated with a particular plugin declaration in the input xml. This id is later used in
+ * the input xml to refer back to the original declaration.
* <p>
* For plugins declared "in-line", the id is null.
*/
- public void setId(String id) {
+ public void setId( String id )
+ {
this.id = id;
}
-
+
/**
- * Return the id associated with this declaration. For plugins
- * declared "inline", null will be returned.
+ * Return the id associated with this declaration. For plugins declared "inline", null will be returned.
*
* @return The id value. May be null.
*/
- public String getId() {
+ public String getId()
+ {
return id;
}
- /**
- * Copy all (key,value) pairs in the param into the properties member of
- * this object.
+ /**
+ * Copy all (key,value) pairs in the param into the properties member of this object.
* <p>
- * The declaration properties cannot be explicit member variables,
- * because the set of useful properties a user can provide on a declaration
- * depends on what RuleFinder classes are available - and extra RuleFinders
- * can be added by the user. So here we keep a map of the settings, and
- * let the RuleFinder objects look for whatever properties they consider
- * significant.
+ * The declaration properties cannot be explicit member variables, because the set of useful properties a user can
+ * provide on a declaration depends on what RuleFinder classes are available - and extra RuleFinders can be added by
+ * the user. So here we keep a map of the settings, and let the RuleFinder objects look for whatever properties they
+ * consider significant.
* <p>
* The "id" and "class" properties are treated differently.
*/
- public void setProperties(Properties p) {
- properties.putAll(p);
+ public void setProperties( Properties p )
+ {
+ properties.putAll( p );
}
-
+
/**
* Return plugin class associated with this declaration.
*
* @return The pluginClass.
*/
- public Class<?> getPluginClass() {
+ public Class<?> getPluginClass()
+ {
return pluginClass;
}
- //---------------------- methods -----------------------------------
-
+ // ---------------------- methods -----------------------------------
+
/**
- * Must be called exactly once, and must be called before any call
- * to the configure method.
+ * Must be called exactly once, and must be called before any call to the configure method.
*/
- public void init(Digester digester, PluginManager pm) throws PluginException {
+ public void init( Digester digester, PluginManager pm )
+ throws PluginException
+ {
Log log = digester.getLogger();
boolean debug = log.isDebugEnabled();
- if (debug) {
- log.debug("init being called!");
+ if ( debug )
+ {
+ log.debug( "init being called!" );
}
-
- if (initialized) {
- throw new PluginAssertionFailure("Init called multiple times.");
+
+ if ( initialized )
+ {
+ throw new PluginAssertionFailure( "Init called multiple times." );
}
- if ((pluginClass == null) && (pluginClassName != null)) {
- try {
+ if ( ( pluginClass == null ) && ( pluginClassName != null ) )
+ {
+ try
+ {
// load the plugin class object
- pluginClass =
- digester.getClassLoader().loadClass(pluginClassName);
- } catch(ClassNotFoundException cnfe) {
- throw new PluginException(
- "Unable to load class " + pluginClassName, cnfe);
+ pluginClass = digester.getClassLoader().loadClass( pluginClassName );
+ }
+ catch ( ClassNotFoundException cnfe )
+ {
+ throw new PluginException( "Unable to load class " + pluginClassName, cnfe );
}
}
- if (ruleLoader == null) {
+ if ( ruleLoader == null )
+ {
// the caller didn't provide a ruleLoader to the constructor,
// so get the plugin manager to "discover" one.
- log.debug("Searching for ruleloader...");
- ruleLoader = pm.findLoader(digester, id, pluginClass, properties);
- } else {
- log.debug("This declaration has an explicit ruleLoader.");
- }
-
- if (debug) {
- if (ruleLoader == null) {
- log.debug(
- "No ruleLoader found for plugin declaration"
- + " id [" + id + "]"
- + ", class [" + pluginClass.getClass().getName() + "].");
- } else {
- log.debug(
- "RuleLoader of type [" + ruleLoader.getClass().getName()
- + "] associated with plugin declaration"
- + " id [" + id + "]"
- + ", class [" + pluginClass.getClass().getName() + "].");
+ log.debug( "Searching for ruleloader..." );
+ ruleLoader = pm.findLoader( digester, id, pluginClass, properties );
+ }
+ else
+ {
+ log.debug( "This declaration has an explicit ruleLoader." );
+ }
+
+ if ( debug )
+ {
+ if ( ruleLoader == null )
+ {
+ log.debug( "No ruleLoader found for plugin declaration" + " id [" + id + "]" + ", class ["
+ + pluginClass.getClass().getName() + "]." );
+ }
+ else
+ {
+ log.debug( "RuleLoader of type [" + ruleLoader.getClass().getName()
+ + "] associated with plugin declaration" + " id [" + id + "]" + ", class ["
+ + pluginClass.getClass().getName() + "]." );
}
}
-
- initialized = true;
+
+ initialized = true;
}
-
+
/**
- * Attempt to load custom rules for the target class at the specified
- * pattern.
+ * Attempt to load custom rules for the target class at the specified pattern.
* <p>
- * On return, any custom rules associated with the plugin class have
- * been loaded into the Rules object currently associated with the
- * specified digester object.
- */
-
- public void configure(Digester digester, String pattern)
- throws PluginException {
+ * On return, any custom rules associated with the plugin class have been loaded into the Rules object currently
+ * associated with the specified digester object.
+ */
+
+ public void configure( Digester digester, String pattern )
+ throws PluginException
+ {
Log log = digester.getLogger();
boolean debug = log.isDebugEnabled();
- if (debug) {
- log.debug("configure being called!");
+ if ( debug )
+ {
+ log.debug( "configure being called!" );
}
-
- if (!initialized) {
- throw new PluginAssertionFailure("Not initialized.");
+
+ if ( !initialized )
+ {
+ throw new PluginAssertionFailure( "Not initialized." );
}
- if (ruleLoader != null) {
- ruleLoader.addRules(digester, pattern);
+ if ( ruleLoader != null )
+ {
+ ruleLoader.addRules( digester, pattern );
}
}
}
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/InitializableRule.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/InitializableRule.java?rev=1102402&r1=1102401&r2=1102402&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/InitializableRule.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/plugins/InitializableRule.java Thu May 12 18:03:26 2011
@@ -18,26 +18,23 @@
package org.apache.commons.digester3.plugins;
/**
- * Defines an interface that a Rule class can implement if it wishes to get an
- * initialisation callback after the rule has been added to the set of Rules
- * within a PluginRules instance.
- *
+ * Defines an interface that a Rule class can implement if it wishes to get an initialisation callback after the rule
+ * has been added to the set of Rules within a PluginRules instance.
+ *
* @since 1.6
*/
-public interface InitializableRule {
+public interface InitializableRule
+{
/**
- * Called after this Rule object has been added to the list of all Rules.
- * Note that if a single InitializableRule instance is associated with
- * more than one pattern, then this method will be called more than once.
+ * Called after this Rule object has been added to the list of all Rules. Note that if a single InitializableRule
+ * instance is associated with more than one pattern, then this method will be called more than once.
*
- * @param pattern is the digester match pattern that will trigger this
- * rule.
- * @exception
- * PluginConfigurationException is thrown if the InitializableRule
- * determines that it cannot correctly initialise itself for any reason.
+ * @param pattern is the digester match pattern that will trigger this rule.
+ * @exception PluginConfigurationException is thrown if the InitializableRule determines that it cannot correctly
+ * initialise itself for any reason.
*/
- public void postRegisterInit(String pattern)
- throws PluginConfigurationException;
+ public void postRegisterInit( String pattern )
+ throws PluginConfigurationException;
}