You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/11/12 23:23:28 UTC
svn commit: r594319 [34/40] - in /tapestry/tapestry5/trunk: ./
tapestry-annotations/
tapestry-annotations/src/main/java/org/apache/tapestry/beaneditor/
tapestry-annotations/src/site/ tapestry-component-report/
tapestry-component-report/src/main/java/or...
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ServiceLogger.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ServiceLogger.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ServiceLogger.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ServiceLogger.java Mon Nov 12 14:22:31 2007
@@ -14,14 +14,13 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.lang.String.format;
-
-import java.util.Iterator;
-
import org.apache.tapestry.ioc.internal.util.Defense;
import org.apache.tapestry.ioc.services.ExceptionTracker;
import org.slf4j.Logger;
+import static java.lang.String.format;
+import java.util.Iterator;
+
/**
* Used by {@link org.apache.tapestry.ioc.internal.services.LoggingDecoratorImpl} to delegate out
* logging behavior to a seperate object (helps ensure no naming conflicts).
@@ -44,7 +43,9 @@
_exceptionTracker = exceptionTracker;
}
- /** Returns true if the debugging is enabled for the underlying Log. */
+ /**
+ * Returns true if the debugging is enabled for the underlying Log.
+ */
public boolean isDebugEnabled()
{
return _logger.isDebugEnabled();
@@ -52,9 +53,8 @@
/**
* Invoked when a method is first entered
- *
- * @param name
- * of the method
+ *
+ * @param name of the method
* @param arguments
*/
public void entry(String name, Object[] arguments)
@@ -136,11 +136,9 @@
/**
* Invoked when a method returns a value
- *
- * @param name
- * of the method
- * @param result
- * the return value for the method invocation
+ *
+ * @param name of the method
+ * @param result the return value for the method invocation
*/
public void exit(String name, Object result)
{
@@ -157,13 +155,17 @@
_logger.debug(buffer.toString());
}
- /** Invoked when void method finishes succesfully. */
+ /**
+ * Invoked when void method finishes succesfully.
+ */
public void voidExit(String name)
{
_logger.debug(format("[%s] %s", EXIT, name));
}
- /** Invoked when method invocation instead throws an exception. */
+ /**
+ * Invoked when method invocation instead throws an exception.
+ */
public void fail(String name, Throwable t)
{
if (_logger.isDebugEnabled())
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ServiceMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ServiceMessages.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ServiceMessages.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ServiceMessages.java Mon Nov 12 14:22:31 2007
@@ -15,7 +15,6 @@
package org.apache.tapestry.ioc.internal.services;
import javassist.CtClass;
-
import org.apache.tapestry.ioc.Messages;
import org.apache.tapestry.ioc.internal.util.MessagesImpl;
import org.apache.tapestry.ioc.services.ClassFabUtils;
@@ -102,7 +101,7 @@
}
static String propertyTypeMismatch(String propertyName, Class sourceClass, Class propertyType,
- Class expectedType)
+ Class expectedType)
{
return MESSAGES.format(
"property-type-mismatch",
@@ -113,7 +112,7 @@
}
static String extraFilterMethod(MethodSignature sig, Class filterInterface,
- Class serviceInterface)
+ Class serviceInterface)
{
return MESSAGES.format(
"extra-filter-method",
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/StrategyBuilderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/StrategyBuilderImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/StrategyBuilderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/StrategyBuilderImpl.java Mon Nov 12 14:22:31 2007
@@ -14,17 +14,12 @@
package org.apache.tapestry.ioc.internal.services;
-import java.lang.reflect.Modifier;
-
-import org.apache.tapestry.ioc.services.Builtin;
-import org.apache.tapestry.ioc.services.ClassFab;
-import org.apache.tapestry.ioc.services.ClassFactory;
-import org.apache.tapestry.ioc.services.MethodIterator;
-import org.apache.tapestry.ioc.services.MethodSignature;
-import org.apache.tapestry.ioc.services.StrategyBuilder;
+import org.apache.tapestry.ioc.services.*;
import org.apache.tapestry.ioc.util.BodyBuilder;
import org.apache.tapestry.ioc.util.StrategyRegistry;
+import java.lang.reflect.Modifier;
+
public class StrategyBuilderImpl implements StrategyBuilder
{
private final ClassFactory _classFactory;
@@ -63,7 +58,7 @@
cf.addField("_registry", Modifier.PRIVATE | Modifier.FINAL, StrategyRegistry.class);
cf.addConstructor(new Class[]
- { StrategyRegistry.class }, null, "_registry = $1;");
+ {StrategyRegistry.class}, null, "_registry = $1;");
BodyBuilder builder = new BodyBuilder();
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/StringLocation.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/StringLocation.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/StringLocation.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/StringLocation.java Mon Nov 12 14:22:31 2007
@@ -38,7 +38,9 @@
return _description;
}
- /** Returns 0. */
+ /**
+ * Returns 0.
+ */
public int getColumn()
{
return 0;
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/SymbolObjectProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/SymbolObjectProvider.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/SymbolObjectProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/SymbolObjectProvider.java Mon Nov 12 14:22:31 2007
@@ -34,15 +34,15 @@
public SymbolObjectProvider(@Builtin
SymbolSource symbolSource,
- @Builtin
- TypeCoercer typeCoercer)
+ @Builtin
+ TypeCoercer typeCoercer)
{
_symbolSource = symbolSource;
_typeCoercer = typeCoercer;
}
public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider,
- ObjectLocator locator)
+ ObjectLocator locator)
{
Symbol annotation = annotationProvider.getAnnotation(Symbol.class);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/SymbolSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/SymbolSourceImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/SymbolSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/SymbolSourceImpl.java Mon Nov 12 14:22:31 2007
@@ -16,19 +16,20 @@
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newConcurrentMap;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newLinkedList;
+import org.apache.tapestry.ioc.services.SymbolProvider;
+import org.apache.tapestry.ioc.services.SymbolSource;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import org.apache.tapestry.ioc.services.SymbolProvider;
-import org.apache.tapestry.ioc.services.SymbolSource;
-
public class SymbolSourceImpl implements SymbolSource
{
private final List<SymbolProvider> _providers;
- /** Cache of symbol name to fully expanded symbol value. */
+ /**
+ * Cache of symbol name to fully expanded symbol value.
+ */
private final Map<String, String> _cache = newConcurrentMap();
/**
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ThreadCleanupHubImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ThreadCleanupHubImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ThreadCleanupHubImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ThreadCleanupHubImpl.java Mon Nov 12 14:22:31 2007
@@ -15,12 +15,11 @@
package org.apache.tapestry.ioc.internal.services;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
-
-import java.util.List;
-
import org.apache.tapestry.ioc.services.ThreadCleanupHub;
import org.apache.tapestry.ioc.services.ThreadCleanupListener;
import org.slf4j.Logger;
+
+import java.util.List;
public class ThreadCleanupHubImpl implements ThreadCleanupHub
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ThreadLocaleImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ThreadLocaleImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ThreadLocaleImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ThreadLocaleImpl.java Mon Nov 12 14:22:31 2007
@@ -15,12 +15,11 @@
package org.apache.tapestry.ioc.internal.services;
import static org.apache.tapestry.ioc.IOCConstants.PERTHREAD_SCOPE;
+import org.apache.tapestry.ioc.annotations.Scope;
import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
+import org.apache.tapestry.ioc.services.ThreadLocale;
import java.util.Locale;
-
-import org.apache.tapestry.ioc.annotations.Scope;
-import org.apache.tapestry.ioc.services.ThreadLocale;
@Scope(PERTHREAD_SCOPE)
public class ThreadLocaleImpl implements ThreadLocale
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/TypeCoercerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/TypeCoercerImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/TypeCoercerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/TypeCoercerImpl.java Mon Nov 12 14:22:31 2007
@@ -14,19 +14,8 @@
package org.apache.tapestry.ioc.internal.services;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newConcurrentMap;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newLinkedList;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newSet;
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.*;
import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
import org.apache.tapestry.ioc.internal.util.InheritanceSearch;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
import org.apache.tapestry.ioc.services.ClassFabUtils;
@@ -34,6 +23,8 @@
import org.apache.tapestry.ioc.services.CoercionTuple;
import org.apache.tapestry.ioc.services.TypeCoercer;
+import java.util.*;
+
public class TypeCoercerImpl implements TypeCoercer
{
// Read only after constructor
@@ -189,12 +180,12 @@
/**
* Here's the real meat; we do a search of the space to find coercions, or a system of
* coercions, that accomplish the desired coercion.
- * <p>
+ * <p/>
* There's <strong>TREMENDOUS</strong> room to improve this algorithm. For example, inheritance
* lists could be cached. Further, there's probably more ways to early prune the search.
* However, even with dozens or perhaps hundreds of tuples, I suspect the search will still
* grind to a conclusion quickly.
- * <p>
+ * <p/>
* The order of operations should help ensure that the most efficient tuple chain is located. If
* you think about how tuples are added to the queue, there are two factors: size (the number of
* steps in the coercion) and "class distance" (that is, number of steps up the inheritance
@@ -203,10 +194,10 @@
* By the time we reach some of those, we'll have begun queing up the 3 step coercions, and so
* forth, until we run out of input tuples we can use to fabricate multi-step compound
* coercions, or reach a final response.
- * <p>
+ * <p/>
* This does create a good number of short lived temporary objects (the compound tuples), but
* that's what the GC is really good at.
- *
+ *
* @param sourceType
* @param targetType
* @return coercer from sourceType to targetType
@@ -278,9 +269,11 @@
return InternalUtils.joinSorted(descriptions);
}
- /** Seeds the pool with the initial set of coercions for the given type. */
+ /**
+ * Seeds the pool with the initial set of coercions for the given type.
+ */
private void seedQueue(Class sourceType, Set<CoercionTuple> consideredTuples,
- LinkedList<CoercionTuple> queue)
+ LinkedList<CoercionTuple> queue)
{
// Work from the source type up looking for tuples
@@ -301,21 +294,17 @@
/**
* Creates and adds to the pool a new set of coercions based on an intermediate tuple. Adds
* compound coercion tuples to the end of the queue.
- *
- * @param sourceType
- * the source type of the coercion
- * @param intermediateTuple
- * a tuple that converts from the source type to some intermediate type (that is not
- * assignable to the target type)
- * @param consideredTuples
- * set of tuples that have already been added to the pool (directly, or as a compound
- * coercion)
- * @param queue
- * the work queue of tuples
+ *
+ * @param sourceType the source type of the coercion
+ * @param intermediateTuple a tuple that converts from the source type to some intermediate type (that is not
+ * assignable to the target type)
+ * @param consideredTuples set of tuples that have already been added to the pool (directly, or as a compound
+ * coercion)
+ * @param queue the work queue of tuples
*/
@SuppressWarnings("unchecked")
private void queueIntermediates(Class sourceType, CoercionTuple intermediateTuple,
- Set<CoercionTuple> consideredTuples, LinkedList<CoercionTuple> queue)
+ Set<CoercionTuple> consideredTuples, LinkedList<CoercionTuple> queue)
{
Class intermediateType = intermediateTuple.getTargetType();
@@ -344,10 +333,10 @@
// intermediate type, hopefully closer to our eventual target type.
Coercion compoundCoercer = new CompoundCoercion(intermediateTuple.getCoercion(),
- tuple.getCoercion());
+ tuple.getCoercion());
CoercionTuple compoundTuple = new CoercionTuple(sourceType, newIntermediateType,
- compoundCoercer, false);
+ compoundCoercer, false);
// So, every tuple that is added to the queue can take as input the sourceType.
// The target type may be another intermdiate type, or may be something
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ValueObjectProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ValueObjectProvider.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ValueObjectProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ValueObjectProvider.java Mon Nov 12 14:22:31 2007
@@ -35,15 +35,15 @@
public ValueObjectProvider(@Builtin
SymbolSource symbolSource,
- @Builtin
- TypeCoercer typeCoercer)
+ @Builtin
+ TypeCoercer typeCoercer)
{
_symbolSource = symbolSource;
_typeCoercer = typeCoercer;
}
public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider,
- ObjectLocator locator)
+ ObjectLocator locator)
{
Value annotation = annotationProvider.getAnnotation(Value.class);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/AbstractResource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/AbstractResource.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/AbstractResource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/AbstractResource.java Mon Nov 12 14:22:31 2007
@@ -14,14 +14,13 @@
package org.apache.tapestry.ioc.internal.util;
+import org.apache.tapestry.ioc.Resource;
import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
import java.net.URL;
import java.util.Locale;
-import org.apache.tapestry.ioc.Resource;
-
/**
* Abstract implementation of {@link Resource}. Subclasses must implement the abstract methods
* {@link Resource#toURL()} and {@link #newResource(String)} as well as toString(), hashCode() and
@@ -132,6 +131,8 @@
return newResource(path);
}
- /** Factory method provided by subclasses. */
+ /**
+ * Factory method provided by subclasses.
+ */
protected abstract Resource newResource(String path);
}
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/ClasspathResource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/ClasspathResource.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/ClasspathResource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/ClasspathResource.java Mon Nov 12 14:22:31 2007
@@ -14,11 +14,10 @@
package org.apache.tapestry.ioc.internal.util;
+import org.apache.tapestry.ioc.Resource;
import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
import java.net.URL;
-
-import org.apache.tapestry.ioc.Resource;
/**
* Implementation of {@link Resource} for files on the classpath (as defined by a
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/CollectionFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/CollectionFactory.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/CollectionFactory.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/CollectionFactory.java Mon Nov 12 14:22:31 2007
@@ -14,34 +14,26 @@
package org.apache.tapestry.ioc.internal.util;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import org.apache.tapestry.ioc.util.CaseInsensitiveMap;
+import org.apache.tapestry.ioc.util.Stack;
+
+import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
-import org.apache.tapestry.ioc.util.CaseInsensitiveMap;
-import org.apache.tapestry.ioc.util.Stack;
-
/**
* Static factory methods to ease the creation of new collection types (when using generics). Most
* of these method leverage the compiler's ability to match generic types by return value. Typical
* usage (with a static import):
- *
+ * <p/>
* <pre>
* Map<Foo, Bar> map = newMap();
* </pre>
- *
- * <p>
+ * <p/>
+ * <p/>
* This is a replacement for:
- *
+ * <p/>
* <pre>
* Map<Foo, Bar> map = new HashMap<Foo, Bar>();
* </pre>
@@ -52,19 +44,25 @@
{
}
- /** Constructs and returns a generic {@link HashMap} instance. */
+ /**
+ * Constructs and returns a generic {@link HashMap} instance.
+ */
public static <K, V> Map<K, V> newMap()
{
return new HashMap<K, V>();
}
- /** Constructs and returns a generic {@link java.util.HashSet} instance. */
+ /**
+ * Constructs and returns a generic {@link java.util.HashSet} instance.
+ */
public static <T> Set<T> newSet()
{
return new HashSet<T>();
}
- /** Contructs a new {@link HashSet} and initializes it using the provided collection. */
+ /**
+ * Contructs a new {@link HashSet} and initializes it using the provided collection.
+ */
public static <T, V extends T> Set<T> newSet(Collection<V> values)
{
return new HashSet<T>(values);
@@ -92,7 +90,9 @@
return new ConcurrentHashMap<K, V>();
}
- /** Contructs and returns a new generic {@link java.util.ArrayList} instance. */
+ /**
+ * Contructs and returns a new generic {@link java.util.ArrayList} instance.
+ */
public static <T> List<T> newList()
{
return new ArrayList<T>();
@@ -107,19 +107,25 @@
return new ArrayList<T>(Arrays.asList(elements));
}
- /** Useful for queues. */
+ /**
+ * Useful for queues.
+ */
public static <T> LinkedList<T> newLinkedList()
{
return new LinkedList<T>();
}
- /** Constructs and returns a new {@link ArrayList} as a copy of the provided collection. */
+ /**
+ * Constructs and returns a new {@link ArrayList} as a copy of the provided collection.
+ */
public static <T, V extends T> List<T> newList(Collection<V> list)
{
return new ArrayList<T>(list);
}
- /** Constructs and returns a new {@link java.util.concurrent.CopyOnWriteArrayList}. */
+ /**
+ * Constructs and returns a new {@link java.util.concurrent.CopyOnWriteArrayList}.
+ */
public static <T> List<T> newThreadSafeList()
{
return new CopyOnWriteArrayList<T>();
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/ConcurrentBarrier.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/ConcurrentBarrier.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/ConcurrentBarrier.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/ConcurrentBarrier.java Mon Nov 12 14:22:31 2007
@@ -51,12 +51,12 @@
* Invokes the object after acquiring the read lock (if necessary). If invoked when the read
* lock has not yet been acquired, then the lock is acquired for the duration of the call. If
* the lock has already been acquired, then the status of the lock is not changed.
- * <p>
+ * <p/>
* TODO: Check to see if the write lock is acquired and <em>not</em> acquire the read lock in
* that situation. Currently this code is not re-entrant. If a write lock is already acquired
* and the thread attempts to get the read lock, then the thread will hang. For the moment, all
* the uses of ConcurrentBarrier are coded in such a way that reentrant locks are not a problem.
- *
+ *
* @param <T>
* @param invokable
* @return the result of invoking the invokable
@@ -117,7 +117,7 @@
* This usually manifests as race conditions where either a) some parallel unrelated bit of work
* has occured or b) duplicate work has occured. The latter is only problematic if the operation
* is very expensive.
- *
+ *
* @param <T>
* @param invokable
*/
@@ -189,13 +189,10 @@
* within the specfied timeout, then this method behaves as {@link #withWrite(Runnable)} and
* will return true. If the write lock is not obtained within the timeout then the runnable is
* never invoked and the method will return false.
- *
- * @param runnable
- * Runnable object to execute inside the write lock.
- * @param timeout
- * Time to wait for write lock.
- * @param timeoutUnit
- * Units of timeout.
+ *
+ * @param runnable Runnable object to execute inside the write lock.
+ * @param timeout Time to wait for write lock.
+ * @param timeoutUnit Units of timeout.
* @return true if lock was obtained & runnabled executed. False otherwise.
*/
public boolean tryWithWrite(final Runnable runnable, long timeout, TimeUnit timeoutUnit)
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Defense.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Defense.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Defense.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Defense.java Mon Nov 12 14:22:31 2007
@@ -28,16 +28,12 @@
* situations where some of the parameters to a method are allowed to be null and other's arent.
* In that situation, the method will be annotated with {@link SuppressNullCheck}, and the
* relevent null checks will occur inside the method implementation.
- *
- * @param <T>
- * the value type
- * @param value
- * the value (which is checked to ensure non-nullness)
- * @param parameterName
- * the name of the parameter, used for exception messages
+ *
+ * @param <T> the value type
+ * @param value the value (which is checked to ensure non-nullness)
+ * @param parameterName the name of the parameter, used for exception messages
* @return the value
- * @throws IllegalArgumentException
- * if the value is null
+ * @throws IllegalArgumentException if the value is null
*/
public static <T> T notNull(T value, String parameterName)
{
@@ -49,14 +45,11 @@
/**
* Checks that a parameter value is not null and not empty.
- *
- * @param value
- * value to check (which is returned)
- * @param parameterName
- * the name of the parameter, used for exception messages
+ *
+ * @param value value to check (which is returned)
+ * @param parameterName the name of the parameter, used for exception messages
* @return the value, trimmed, if non-blank
- * @throws IllegalArgumentException
- * if the value is null or empty
+ * @throws IllegalArgumentException if the value is null or empty
*/
public static String notBlank(String value, String parameterName)
{
@@ -73,14 +66,13 @@
/**
* Checks that the provided value is not null, and may be cast to the desired type.
- *
+ *
* @param <T>
* @param parameterValue
* @param type
* @param parameterName
- * @throws IllegalArgumentException
- * if the value is null, or is not assignable to the indicated type
* @return the casted value
+ * @throws IllegalArgumentException if the value is null, or is not assignable to the indicated type
*/
public static <T> T cast(Object parameterValue, Class<T> type, String parameterName)
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/DependencyNode.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/DependencyNode.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/DependencyNode.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/DependencyNode.java Mon Nov 12 14:22:31 2007
@@ -14,17 +14,16 @@
package org.apache.tapestry.ioc.internal.util;
+import org.apache.tapestry.ioc.Orderable;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
+import org.slf4j.Logger;
import java.util.List;
-import org.apache.tapestry.ioc.Orderable;
-import org.slf4j.Logger;
-
/**
* Used by {@link org.apache.tapestry.ioc.internal.util.Orderer} to establish backward dependencies
* for {@link org.apache.tapestry.ioc.Orderable} objects.
- *
+ *
* @param <T>
*/
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/IdAllocator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/IdAllocator.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/IdAllocator.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/IdAllocator.java Mon Nov 12 14:22:31 2007
@@ -1,31 +1,31 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2004, 2005, 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.ioc.internal.util;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
-
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.List;
-import java.util.Map;
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
+
+import java.util.HashMap;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
/**
* Used to "uniquify" names within a given context. A base name is passed in, and the return value
* is the base name, or the base name extended with a suffix to make it unique.
- * <p>
+ * <p/>
* This class is not threadsafe.
*/
@@ -33,12 +33,16 @@
{
private static final String SEPARATOR = "_";
- /** Map from allocated id to a generator for names associated with the allocated id. */
+ /**
+ * Map from allocated id to a generator for names associated with the allocated id.
+ */
private final Map<String, NameGenerator> _generatorMap;
private final String _namespace;
- /** Generates unique names with a particular prefix. */
+ /**
+ * Generates unique names with a particular prefix.
+ */
private static class NameGenerator implements Cloneable
{
private final String _baseId;
@@ -55,7 +59,9 @@
return _baseId + _index++;
}
- /** Clones this instance, returning an equivalent but seperate copy. */
+ /**
+ * Clones this instance, returning an equivalent but seperate copy.
+ */
@Override
public NameGenerator clone()
{
@@ -71,13 +77,17 @@
}
}
- /** Creates a new allocator with no namespace. */
+ /**
+ * Creates a new allocator with no namespace.
+ */
public IdAllocator()
{
this("");
}
- /** Creates a new allocator with the provided namespace. */
+ /**
+ * Creates a new allocator with the provided namespace.
+ */
public IdAllocator(String namespace)
{
this(namespace, new HashMap<String, NameGenerator>());
@@ -89,7 +99,9 @@
_generatorMap = generatorMap;
}
- /** Returns a list of all allocated ids, sorted alphabetically. */
+ /**
+ * Returns a list of all allocated ids, sorted alphabetically.
+ */
public List<String> getAllocatedIds()
{
return InternalUtils.sortedKeys(_generatorMap);
@@ -157,7 +169,9 @@
return result;
}
- /** Checks to see if a given name has been allocated. */
+ /**
+ * Checks to see if a given name has been allocated.
+ */
public boolean isAllocated(String name)
{
return _generatorMap.containsKey(name);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/InheritanceSearch.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/InheritanceSearch.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/InheritanceSearch.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/InheritanceSearch.java Mon Nov 12 14:22:31 2007
@@ -16,25 +16,24 @@
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newLinkedList;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newSet;
+import org.apache.tapestry.ioc.services.ClassFabUtils;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Set;
-import org.apache.tapestry.ioc.services.ClassFabUtils;
-
/**
* Used to search from a particular class up the inheritance hierarchy of extended classes and
* implemented interfaces.
- * <p>
+ * <p/>
* The search starts with the initial class (provided in the constructor). It progresses up the
* inheritance chain, but skips java.lang.Object.
- * <p>
+ * <p/>
* Once classes are exhausted, the inheritance hiearchy is searched. This is a breadth-first search,
* rooted in the interfaces implemented by the initial class at its super classes.
- * <p>
+ * <p/>
* Once all interfaces are exhausted, java.lang.Object is returned (it is always returned last).
- * <p>
+ * <p/>
* Two minor tweak to normal inheritance rules:
* <ul>
* <li> Normally, the parent class of an <em>object</em> array is java.lang.Object, which is odd
@@ -43,14 +42,14 @@
* <li> The "super class" of a primtive type is its <em>wrapper type</em>, with the exception of
* void, whose "super class" is left at its normal value (Object.class)
* </ul>
- * <p>
+ * <p/>
* This class implements the {@link Iterable} interface, so it can be used directly in a for loop:
* <code>
- * for (Class search : new InheritanceSearch(startClass)) {
- * ...
- * }
+ * for (Class search : new InheritanceSearch(startClass)) {
+ * ...
+ * }
* </code>
- * <p>
+ * <p/>
* This class is not threadsafe.
*/
public class InheritanceSearch implements Iterator<Class>, Iterable<Class>
@@ -159,8 +158,7 @@
}
/**
- * @throws UnsupportedOperationException
- * always
+ * @throws UnsupportedOperationException always
*/
public void remove()
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/InternalUtils.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/InternalUtils.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/InternalUtils.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/InternalUtils.java Mon Nov 12 14:22:31 2007
@@ -14,31 +14,22 @@
package org.apache.tapestry.ioc.internal.util;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
-import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-
import org.apache.tapestry.ioc.AnnotationProvider;
import org.apache.tapestry.ioc.Locatable;
import org.apache.tapestry.ioc.Location;
import org.apache.tapestry.ioc.ObjectLocator;
import org.apache.tapestry.ioc.annotations.Inject;
import org.apache.tapestry.ioc.annotations.InjectService;
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
+import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
import org.apache.tapestry.ioc.services.ClassFactory;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.*;
+
/**
* Utilities used within various internal implemenations of Tapestry IOC and the rest of the
* tapestry-core framework.
@@ -56,11 +47,9 @@
* Converts a method to a user presentable string using a {@link ClassFactory} to obtain a
* {@link MethodLocation} (where possible). {@link #asString(Method)} is used under the covers,
* to present a detailed, but not excessive, description of the class, method and parameters.
- *
- * @param method
- * method to convert to a string
- * @param classFactory
- * used to obtain the {@link MethodLocation}
+ *
+ * @param method method to convert to a string
+ * @param classFactory used to obtain the {@link MethodLocation}
* @return the method formatted for presentation to the user
*/
public static String asString(Method method, ClassFactory classFactory)
@@ -74,7 +63,7 @@
* Converts a method to a user presentable string consisting of the containing class name, the
* method name, and the short form of the parameter list (the class name of each parameter type,
* shorn of the package name portion).
- *
+ *
* @param method
* @return short string representation
*/
@@ -99,14 +88,18 @@
return buffer.append(")").toString();
}
- /** Returns the size of an object array, or null if the array is empty. */
+ /**
+ * Returns the size of an object array, or null if the array is empty.
+ */
public static int size(Object[] array)
{
return array == null ? 0 : array.length;
}
- /** Strips leading punctuation ("_" and "$") from the provided name. */
+ /**
+ * Strips leading punctuation ("_" and "$") from the provided name.
+ */
public static String stripMemberPrefix(String memberName)
{
StringBuilder builder = new StringBuilder(memberName);
@@ -159,16 +152,14 @@
/**
* Finds a specific annotation type within an array of annotations.
- *
+ *
* @param <T>
- * @param annotations
- * to search
- * @param annotationClass
- * to match
+ * @param annotations to search
+ * @param annotationClass to match
* @return the annotation instance, if found, or null otherwise
*/
public static <T extends Annotation> T findAnnotation(Annotation[] annotations,
- Class<T> annotationClass)
+ Class<T> annotationClass)
{
for (Annotation a : annotations)
{
@@ -180,8 +171,8 @@
@SuppressWarnings("unchecked")
private static Object calculateParameterValue(Class parameterType,
- final Annotation[] parameterAnnotations, ObjectLocator locator,
- Map<Class, Object> parameterDefaults)
+ final Annotation[] parameterAnnotations, ObjectLocator locator,
+ Map<Class, Object> parameterDefaults)
{
AnnotationProvider provider = new AnnotationProvider()
{
@@ -221,7 +212,7 @@
}
public static Object[] calculateParametersForMethod(Method method, ObjectLocator locator,
- Map<Class, Object> parameterDefaults)
+ Map<Class, Object> parameterDefaults)
{
Class[] parameterTypes = method.getParameterTypes();
Annotation[][] annotations = method.getParameterAnnotations();
@@ -230,7 +221,8 @@
}
public static Object[] calculateParametersForConstructor(Constructor constructor,
- ObjectLocator locator, Map<Class, Object> parameterDefaults)
+ ObjectLocator locator,
+ Map<Class, Object> parameterDefaults)
{
Class[] parameterTypes = constructor.getParameterTypes();
Annotation[][] annotations = constructor.getParameterAnnotations();
@@ -239,8 +231,8 @@
}
public static Object[] calculateParameters(ObjectLocator locator,
- Map<Class, Object> parameterDefaults, Class[] parameterTypes,
- Annotation[][] parameterAnnotations)
+ Map<Class, Object> parameterDefaults, Class[] parameterTypes,
+ Annotation[][] parameterAnnotations)
{
int parameterCount = parameterTypes.length;
@@ -258,7 +250,9 @@
return parameters;
}
- /** Joins together some number of elements to form a comma separated list. */
+ /**
+ * Joins together some number of elements to form a comma separated list.
+ */
public static String join(List elements)
{
StringBuilder buffer = new StringBuilder();
@@ -276,7 +270,9 @@
return buffer.toString();
}
- /** Creates a sorted copy of the provided elements, then turns that into a comma separated list. */
+ /**
+ * Creates a sorted copy of the provided elements, then turns that into a comma separated list.
+ */
public static String joinSorted(Collection elements)
{
List<String> list = newList();
@@ -304,7 +300,9 @@
return !isBlank(input);
}
- /** Capitalizes a string, converting the first character to uppercase. */
+ /**
+ * Capitalizes a string, converting the first character to uppercase.
+ */
public static String capitalize(String input)
{
if (input.length() == 0) return input;
@@ -331,9 +329,8 @@
/**
* Extracts the string keys from a map and returns them in sorted order. The keys are converted
* to strings.
- *
- * @param map
- * the map to extract keys from (may be null)
+ *
+ * @param map the map to extract keys from (may be null)
* @return the sorted keys, or the empty set if map is null
*/
@@ -353,11 +350,10 @@
/**
* Gets a value from a map (which may be null).
- *
+ *
* @param <K>
* @param <V>
- * @param map
- * the map to extract from (may be null)
+ * @param map the map to extract from (may be null)
* @param key
* @return the value from the map, or null if the map is null
*/
@@ -369,7 +365,9 @@
return map.get(key);
}
- /** Returns true if the method provided is a static method. */
+ /**
+ * Returns true if the method provided is a static method.
+ */
public static final boolean isStatic(Method method)
{
return Modifier.isStatic(method.getModifiers());
@@ -400,7 +398,9 @@
};
}
- /** Return true if the input string contains the marker for symbols that must be expanded. */
+ /**
+ * Return true if the input string contains the marker for symbols that must be expanded.
+ */
public static boolean containsSymbols(String input)
{
return input.contains("${");
@@ -428,9 +428,8 @@
* Returns null if there are no public constructors. If there is more than one constructor with
* the maximum number of parameters, it is not determined which will be returned (don't build a
* class like that!).
- *
- * @param clazz
- * to search for a constructor for
+ *
+ * @param clazz to search for a constructor for
* @return the constructor to be used to instantiate the class, or null if no appropriate
* constructor was found
*/
@@ -470,17 +469,12 @@
/**
* Adds a value to a specially organized map where the values are lists of objects. This
* somewhat simulates a map that allows mutiple values for the same key.
- *
- * @param map
- * to store value into
- * @param key
- * for which a value is added
- * @param value
- * to add
- * @param <K>
- * the type of key
- * @param <V>
- * the type of the list
+ *
+ * @param map to store value into
+ * @param key for which a value is added
+ * @param value to add
+ * @param <K> the type of key
+ * @param <V> the type of the list
*/
public static <K, V> void addToMapList(Map<K, List<V>> map, K key, V value)
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Invokable.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Invokable.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Invokable.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Invokable.java Mon Nov 12 14:22:31 2007
@@ -1,29 +1,31 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.ioc.internal.util;
-
+
/**
* Similiar to {@link Runnable} execpt that it returns a value. Used by {@link ConcurrentBarrier} to
* identify the block of code to execute with read/write lock protection.
- *
+ *
* @param <T>
- * the return value type
+ * the return value type
*/
public interface Invokable<T>
{
- /** Called to produce a value. */
+ /**
+ * Called to produce a value.
+ */
T invoke();
}
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/LocalizedNameGenerator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/LocalizedNameGenerator.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/LocalizedNameGenerator.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/LocalizedNameGenerator.java Mon Nov 12 14:22:31 2007
@@ -21,7 +21,7 @@
/**
* Used in a wide variety of resource searches. Generates a series of name variations from a path
* (which must include a suffix) and locale.
- * <P>
+ * <p/>
* This class is not threadsafe.
*/
public class LocalizedNameGenerator implements Iterator<String>, Iterable<String>
@@ -136,9 +136,8 @@
/**
* Returns the next localized variant.
- *
- * @throws NoSuchElementException
- * if all variants have been returned.
+ *
+ * @throws NoSuchElementException if all variants have been returned.
*/
public String next()
@@ -208,13 +207,17 @@
}
}
- /** @throws UnsupportedOperationException */
+ /**
+ * @throws UnsupportedOperationException
+ */
public void remove()
{
throw new UnsupportedOperationException();
}
- /** So that LNG may be used with the for loop. */
+ /**
+ * So that LNG may be used with the for loop.
+ */
public Iterator<String> iterator()
{
return this;
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/LocationImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/LocationImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/LocationImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/LocationImpl.java Mon Nov 12 14:22:31 2007
@@ -14,10 +14,10 @@
package org.apache.tapestry.ioc.internal.util;
-import java.util.Formatter;
-
import org.apache.tapestry.ioc.Location;
import org.apache.tapestry.ioc.Resource;
+
+import java.util.Formatter;
/**
* Implementation class for {@link org.apache.tapestry.ioc.Location}.
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/MessageFormatterImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/MessageFormatterImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/MessageFormatterImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/MessageFormatterImpl.java Mon Nov 12 14:22:31 2007
@@ -1,23 +1,23 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.ioc.internal.util;
-import org.apache.tapestry.ioc.MessageFormatter;
+import org.apache.tapestry.ioc.MessageFormatter;
/**
- *
+ *
*/
public class MessageFormatterImpl implements MessageFormatter
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/MessagesImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/MessagesImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/MessagesImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/MessagesImpl.java Mon Nov 12 14:22:31 2007
@@ -14,16 +14,15 @@
package org.apache.tapestry.ioc.internal.util;
+import org.apache.tapestry.ioc.Messages;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap;
+import org.apache.tapestry.ioc.util.AbstractMessages;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
-import org.apache.tapestry.ioc.Messages;
-import org.apache.tapestry.ioc.util.AbstractMessages;
-
/**
* Implementation of {@link org.apache.tapestry.ioc.Messages} based around a
* {@link java.util.ResourceBundle}.
@@ -36,7 +35,7 @@
* Finds the messages for a given Messages utility class. Strings the trailing "Messages" and
* replaces it with "Strings" to form the base path. Loads the bundle using the default locale,
* and the class' class loader.
- *
+ *
* @param forClass
* @return Messages for the class
*/
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/OneShotLock.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/OneShotLock.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/OneShotLock.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/OneShotLock.java Mon Nov 12 14:22:31 2007
@@ -24,9 +24,8 @@
/**
* Checks to see if the lock has been set (via {@link #lock()}).
- *
- * @throws IllegalStateException
- * if the lock is set
+ *
+ * @throws IllegalStateException if the lock is set
*/
public synchronized void check()
{
@@ -48,7 +47,9 @@
}
}
- /** Checks the lock, then sets it. */
+ /**
+ * Checks the lock, then sets it.
+ */
public synchronized void lock()
{
innerCheck();
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Orderer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Orderer.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Orderer.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/Orderer.java Mon Nov 12 14:22:31 2007
@@ -14,19 +14,18 @@
package org.apache.tapestry.ioc.internal.util;
+import org.apache.tapestry.ioc.IdMatcher;
+import org.apache.tapestry.ioc.Orderable;
+import org.apache.tapestry.ioc.internal.IdMatcherImpl;
+import org.apache.tapestry.ioc.internal.OrIdMatcher;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
+import org.slf4j.Logger;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import org.apache.tapestry.ioc.IdMatcher;
-import org.apache.tapestry.ioc.Orderable;
-import org.apache.tapestry.ioc.internal.IdMatcherImpl;
-import org.apache.tapestry.ioc.internal.OrIdMatcher;
-import org.slf4j.Logger;
-
/**
* Used to order objects into an "execution" order. Each object must have a unique id. It may
* specify a list of constraints which identify the ordering of the objects.
@@ -82,7 +81,7 @@
/**
* Adds an object to be ordered.
- *
+ *
* @param orderable
*/
public void add(Orderable<T> orderable)
@@ -104,13 +103,10 @@
/**
* Adds an object to be ordered.
- *
- * @param id
- * unique, qualified id for the target
- * @param target
- * the object to be ordered (or null as a placeholder)
- * @param constraints
- * optional, variable constraints
+ *
+ * @param id unique, qualified id for the target
+ * @param target the object to be ordered (or null as a placeholder)
+ * @param constraints optional, variable constraints
* @see #add(Orderable)
*/
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/TapestryException.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/TapestryException.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/TapestryException.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/TapestryException.java Mon Nov 12 14:22:31 2007
@@ -1,21 +1,21 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.ioc.internal.util;
-import org.apache.tapestry.ioc.Locatable;
-import org.apache.tapestry.ioc.Location;
+import org.apache.tapestry.ioc.Locatable;
+import org.apache.tapestry.ioc.Location;
/**
* Exception class used as a replacement for {@link java.lang.RuntimeException} when the exception
@@ -28,12 +28,9 @@
private transient final Location _location;
/**
- * @param message
- * a message (may be null)
- * @param locatable
- * implements {@link Location} or {@link Locatable}
- * @param cause
- * if not null, the root cause of the exception
+ * @param message a message (may be null)
+ * @param locatable implements {@link Location} or {@link Locatable}
+ * @param cause if not null, the root cause of the exception
*/
public TapestryException(String message, Object location, Throwable cause)
{
@@ -41,10 +38,8 @@
}
/**
- * @param message
- * a message (may be null)
- * @param cause
- * if not null, the root cause of the exception, also used to set the location
+ * @param message a message (may be null)
+ * @param cause if not null, the root cause of the exception, also used to set the location
*/
public TapestryException(String message, Throwable cause)
{
@@ -52,12 +47,9 @@
}
/**
- * @param message
- * a message (may be null)
- * @param locatable
- * location to associated with the exception, or null if not known
- * @param cause
- * if not null, the root cause of the exception
+ * @param message a message (may be null)
+ * @param locatable location to associated with the exception, or null if not known
+ * @param cause if not null, the root cause of the exception
*/
public TapestryException(String message, Location location, Throwable cause)
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/UtilMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/UtilMessages.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/UtilMessages.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/util/UtilMessages.java Mon Nov 12 14:22:31 2007
@@ -43,7 +43,7 @@
{
return MESSAGES.format("one-shot-lock", element);
}
-
+
static String parameterWasNull(String parameterName)
{
return MESSAGES.format("parameter-was-null", parameterName);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ApplicationDefaults.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ApplicationDefaults.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ApplicationDefaults.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ApplicationDefaults.java Mon Nov 12 14:22:31 2007
@@ -14,22 +14,21 @@
package org.apache.tapestry.ioc.services;
+import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
/**
* Used to disambiguate which version of {@link SymbolProvider} is being referenced. Contributions
* to the ApplicationDefaults symbol source are overridden by JVM System properties.
- *
+ *
* @see FactoryDefaults
*/
@Target(
-{ PARAMETER, FIELD })
+ {PARAMETER, FIELD})
@Retention(RUNTIME)
@Documented
public @interface ApplicationDefaults
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/Builtin.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/Builtin.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/Builtin.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/Builtin.java Mon Nov 12 14:22:31 2007
@@ -14,12 +14,11 @@
package org.apache.tapestry.ioc.services;
+import java.lang.annotation.Documented;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;
/**
@@ -29,7 +28,7 @@
* interface.
*/
@Target(
-{ PARAMETER, FIELD })
+ {PARAMETER, FIELD})
@Retention(RUNTIME)
@Documented
public @interface Builtin
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ChainBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ChainBuilder.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ChainBuilder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ChainBuilder.java Mon Nov 12 14:22:31 2007
@@ -1,39 +1,37 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.ioc.services;
-import java.util.List;
+import java.util.List;
/**
* A service which can assemble an implementation based on a command interface, and an ordered list
* of objects implementing that interface (the "commands"). This is an implementation of the Gang of
* Four Chain Of Command pattern.
- * <p>
+ * <p/>
* For each method in the interface, the chain implementation will call the corresponding method on
* each command object in turn (with the order defined by the list). If any of the command objects
* return true, then the chain of command stops and the initial method invocation returns true.
* Otherwise, the chain of command continues to the next command (and will return false if none of
* the commands returns true).
- * <p>
+ * <p/>
* For methods whose return type is not boolean, the chain stops with the first non-null (for object
* types), or non-zero (for numeric types). The chain returns the value that was returned by the
* command. If the method return type is void, all commands will be invoked.
- * <p>
+ * <p/>
* Method invocations will also be terminated if an exception is thrown.
- *
- *
*/
public interface ChainBuilder
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFab.java Mon Nov 12 14:22:31 2007
@@ -16,11 +16,11 @@
/**
* Used when fabricating a new class. Represents a wrapper around the Javassist library.
- * <p>
+ * <p/>
* The core concept of Javassist is how method bodies (as well as constructor bodies, etc.) are
* specified ... as a very Java-like scripting language. Details are available at the <a
* href="http://jboss.org/products/javassist">Javassist home page</a>.
- * <p>
+ * <p/>
* Method bodies look largely like Java. References to java classes must be fully qualified. Several
* special variables are used:
* <ul>
@@ -36,9 +36,9 @@
* is needed
* <li>
* </ul>
- * <p>
+ * <p/>
* ClassFab instances are not thread safe.
- * <p>
+ * <p/>
* ClassFab instances are created by a {@link org.apache.tapestry.ioc.services.ClassFactory}.
*/
public interface ClassFab
@@ -55,38 +55,35 @@
*/
void addField(String name, Class type);
- /** Adds a new field with the provided modifiers. */
+ /**
+ * Adds a new field with the provided modifiers.
+ */
void addField(String name, int modifiers, Class Type);
/**
* Adds a method. The method is a public instance method.
- *
+ *
+ * @param modifiers Modifiers for the method (see {@link java.lang.reflect.Modifier}).
+ * @param signature defines the name, return type, parameters and exceptions thrown
+ * @param body The body of the method.
* @return a method fabricator, used to add catch handlers.
- * @param modifiers
- * Modifiers for the method (see {@link java.lang.reflect.Modifier}).
- * @param signature
- * defines the name, return type, parameters and exceptions thrown
- * @param body
- * The body of the method.
- * @throws RuntimeException
- * if a method with that signature has already been added, or if there is a
- * Javassist compilation error
+ * @throws RuntimeException if a method with that signature has already been added, or if there is a
+ * Javassist compilation error
*/
void addMethod(int modifiers, MethodSignature signature, String body);
/**
* Adds a constructor to the class. The constructor will be public.
- *
- * @param parameterTypes
- * the type of each parameter, or null if the constructor takes no parameters.
- * @param exceptions
- * the type of each exception, or null if the constructor throws no exceptions.
- * @param body
- * The body of the constructor.
+ *
+ * @param parameterTypes the type of each parameter, or null if the constructor takes no parameters.
+ * @param exceptions the type of each exception, or null if the constructor throws no exceptions.
+ * @param body The body of the constructor.
*/
void addConstructor(Class[] parameterTypes, Class[] exceptions, String body);
- /** Adds an implementation of toString, as a method that returns a fixed string. */
+ /**
+ * Adds an implementation of toString, as a method that returns a fixed string.
+ */
void addToString(String toString);
/**
@@ -95,15 +92,12 @@
* of the delegate interface, then an implementation will be supplied that returns the provided
* string. This method is used when creating objects that proxy their behavior to some other
* object.
- *
- * @param serviceInterface
- * the interface to implement
- * @param delegateExpression
- * the expression used to find the delegate on which methods should be invoked.
- * Typically a field name, such as "_delegate", or a method to invoke, such as
- * "_service()".
- * @param toString
- * fixed value to be returned as the description of the resultant object
+ *
+ * @param serviceInterface the interface to implement
+ * @param delegateExpression the expression used to find the delegate on which methods should be invoked.
+ * Typically a field name, such as "_delegate", or a method to invoke, such as
+ * "_service()".
+ * @param toString fixed value to be returned as the description of the resultant object
*/
void proxyMethodsToDelegate(Class serviceInterface, String delegateExpression, String toString);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFabUtils.java Mon Nov 12 14:22:31 2007
@@ -14,15 +14,14 @@
package org.apache.tapestry.ioc.services;
-import static java.lang.String.format;
+import org.apache.tapestry.ioc.ObjectCreator;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
+import static java.lang.String.format;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Map;
-import org.apache.tapestry.ioc.ObjectCreator;
-
/**
* Handy method useful when creating new classes using
* {@link org.apache.tapestry.ioc.services.ClassFab}.
@@ -125,7 +124,7 @@
}
private static void add(String primitiveType, String typeCode, Class wrapperType,
- String unwrapMethod)
+ String unwrapMethod)
{
PRIMITIVE_INFO.put(primitiveType, new PrimitiveInfo(typeCode, wrapperType, unwrapMethod));
}
@@ -172,7 +171,9 @@
return PRIMITIVE_INFO.get(primitiveTypeName).getUnwrapMethod();
}
- /** Given the name of a primitive type, returns the name of the corresponding wrapper class. */
+ /**
+ * Given the name of a primitive type, returns the name of the corresponding wrapper class.
+ */
public static String getWrapperTypeName(String primitiveType)
{
@@ -207,25 +208,21 @@
* provide (on demand) an object (implementing the service interface) to delegate to. The
* ObjectCreator will be invoked on every method invocation ( if it is caching, that should be
* internal to its implementation).
- *
+ *
* @param <T>
- * @param classFab
- * used to create the new class
- * @param serviceInterface
- * the interface the proxy will implement
- * @param creator
- * the createor which will provide an instance of the interface
- * @param description
- * description to be returned from the proxy's toString() method
+ * @param classFab used to create the new class
+ * @param serviceInterface the interface the proxy will implement
+ * @param creator the createor which will provide an instance of the interface
+ * @param description description to be returned from the proxy's toString() method
* @return the instantiated proxy object
*/
public static <T> T createObjectCreatorProxy(ClassFab classFab, Class<T> serviceInterface,
- ObjectCreator creator, String description)
+ ObjectCreator creator, String description)
{
classFab.addField("_creator", Modifier.PRIVATE | Modifier.FINAL, ObjectCreator.class);
classFab.addConstructor(new Class[]
- { ObjectCreator.class }, null, "_creator = $1;");
+ {ObjectCreator.class}, null, "_creator = $1;");
String body = format("return (%s) _creator.createObject();", serviceInterface.getName());
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassFactory.java Mon Nov 12 14:22:31 2007
@@ -14,11 +14,11 @@
package org.apache.tapestry.ioc.services;
+import org.apache.tapestry.ioc.Location;
+
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-import org.apache.tapestry.ioc.Location;
-
/**
* Service used when dynamically creating new classes.
*/
@@ -29,7 +29,7 @@
* service interface name, extends from java.lang.Object, and automatically adds the
* serviceInterface to the returned ClassFab. This is the most common use when creating the
* kinds of proxies used throughout Tapestry IoC.
- *
+ *
* @param serviceInterface
*/
ClassFab newClass(Class serviceInterface);
@@ -37,12 +37,10 @@
/**
* Creates a {@link ClassFab} object for the given name; the new class is a subclass of the
* indicated class. The new class is always public and concrete.
- *
- * @param name
- * the full qualified name of the class to create (note that it is common to place
- * created classes in the default package)
- * @param superClass
- * the parent class, which is often java.lang.Object
+ *
+ * @param name the full qualified name of the class to create (note that it is common to place
+ * created classes in the default package)
+ * @param superClass the parent class, which is often java.lang.Object
*/
ClassFab newClass(String name, Class superClass);
@@ -53,7 +51,7 @@
* not, a search up the inhertance occurs until a proper class (that can be referenced in
* generated bytecode) is found. This is necessary to handle cases where a class is generated at
* runtime, outside of the class factory, and bytecode is not available for it.
- *
+ *
* @param clazz
* @return a referencable super-class
*/
@@ -74,9 +72,8 @@
/**
* Converts a method to a {@link MethodLocation}, which includes information about the source
* file name and line number.
- *
- * @param method
- * to look up
+ *
+ * @param method to look up
* @return the location, or null if the necessary information is not available
*/
Location getMethodLocation(Method method);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassPropertyAdapter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassPropertyAdapter.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassPropertyAdapter.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/services/ClassPropertyAdapter.java Mon Nov 12 14:22:31 2007
@@ -18,52 +18,47 @@
/**
* Organizes all {@link org.apache.tapestry.ioc.services.PropertyAdapter}s for a particular class.
- * <p>
+ * <p/>
* Only provides access to <em>simple</em> properties. Indexed properties are ignored.
- * <p>
+ * <p/>
* When accessing properties by name, the case of the name is ignored.
*/
public interface ClassPropertyAdapter
{
- /** Returns the names of all properties, sorted into alphabetic order. */
+ /**
+ * Returns the names of all properties, sorted into alphabetic order.
+ */
List<String> getPropertyNames();
- /** Returns the type of bean this adapter provides properties for. */
+ /**
+ * Returns the type of bean this adapter provides properties for.
+ */
Class getBeanType();
/**
* Returns the property adapter with the given name, or null if no such adapter exists.
- *
- * @param name
- * of the property (case is ignored)
+ *
+ * @param name of the property (case is ignored)
*/
PropertyAdapter getPropertyAdapter(String name);
/**
* Reads the value of a property.
- *
- * @param instance
- * the object to read a value from
- * @param propertyName
- * the name of the property to read (case is ignored)
- * @throws UnsupportedOperationException
- * if the property is write only
- * @throws IllegalArgumentException
- * if property does not exist
+ *
+ * @param instance the object to read a value from
+ * @param propertyName the name of the property to read (case is ignored)
+ * @throws UnsupportedOperationException if the property is write only
+ * @throws IllegalArgumentException if property does not exist
*/
Object get(Object instance, String propertyName);
/**
* Updates the value of a property.
- *
- * @param instance
- * the object to update
- * @param propertyName
- * the name of the property to update (case is ignored)
- * @throws UnsupportedOperationException
- * if the property is read only
- * @throws IllegalArgumentException
- * if property does not exist
+ *
+ * @param instance the object to update
+ * @param propertyName the name of the property to update (case is ignored)
+ * @throws UnsupportedOperationException if the property is read only
+ * @throws IllegalArgumentException if property does not exist
*/
void set(Object instance, String propertyName, Object value);
}