Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java?rev=395955&r1=395954&r2=395955&view=diff ============================================================================== --- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java (original) +++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java Fri Apr 21 10:31:14 2006 @@ -28,15 +28,18 @@ import org.apache.tapestry.Tapestry; /** - * Specification for a library. [EMAIL PROTECTED] org.apache.tapestry.spec.ApplicationSpecification}is a - * specialized kind of library. + * Specification for a library. + * [EMAIL PROTECTED] org.apache.tapestry.spec.ApplicationSpecification}is a specialized + * kind of library. * * @author Howard Lewis Ship * @since 2.2bv */ -public class LibrarySpecification extends LocatablePropertyHolder implements ILibrarySpecification +public class LibrarySpecification extends LocatablePropertyHolder implements + ILibrarySpecification { + /** * Map of page name to page specification path. */ @@ -69,7 +72,8 @@ private Map _instantiatedExtensions; /** - * The XML Public Id used when the library specification was read (if applicable). + * The XML Public Id used when the library specification was read (if + * applicable). * * @since 2.2 */ @@ -96,13 +100,11 @@ public void setLibrarySpecificationPath(String id, String path) { - if (_libraries == null) - _libraries = new HashMap(); + if (_libraries == null) _libraries = new HashMap(); if (_libraries.containsKey(id)) throw new IllegalArgumentException(Tapestry.format( - "LibrarySpecification.duplicate-child-namespace-id", - id)); + "LibrarySpecification.duplicate-child-namespace-id", id)); _libraries.put(id, path); } @@ -119,13 +121,11 @@ public void setPageSpecificationPath(String name, String path) { - if (_pages == null) - _pages = new HashMap(); + if (_pages == null) _pages = new HashMap(); if (_pages.containsKey(name)) throw new IllegalArgumentException(Tapestry.format( - "LibrarySpecification.duplicate-page-name", - name)); + "LibrarySpecification.duplicate-page-name", name)); _pages.put(name, path); } @@ -137,13 +137,11 @@ public void setComponentSpecificationPath(String alias, String path) { - if (_components == null) - _components = new HashMap(); + if (_components == null) _components = new HashMap(); if (_components.containsKey(alias)) throw new IllegalArgumentException(Tapestry.format( - "LibrarySpecification.duplicate-component-alias", - alias)); + "LibrarySpecification.duplicate-component-alias", alias)); _components.put(alias, path); } @@ -179,8 +177,7 @@ private List sortedKeys(Map map) { - if (map == null) - return Collections.EMPTY_LIST; + if (map == null) return Collections.EMPTY_LIST; List result = new ArrayList(map.keySet()); @@ -191,8 +188,7 @@ private Object get(Map map, Object key) { - if (map == null) - return null; + if (map == null) return null; return map.get(key); } @@ -217,14 +213,13 @@ /** * Returns a Map of extensions; key is extension name, value is - * [EMAIL PROTECTED] org.apache.tapestry.spec.IExtensionSpecification}. May return null. The returned Map - * is immutable. + * [EMAIL PROTECTED] org.apache.tapestry.spec.IExtensionSpecification}. May return + * null. The returned Map is immutable. */ public Map getExtensionSpecifications() { - if (_extensions == null) - return null; + if (_extensions == null) return null; return Collections.unmodifiableMap(_extensions); } @@ -236,23 +231,22 @@ * if an extension with the given name already exists. */ - public void addExtensionSpecification(String name, IExtensionSpecification extension) + public void addExtensionSpecification(String name, + IExtensionSpecification extension) { - if (_extensions == null) - _extensions = new HashMap(); + if (_extensions == null) _extensions = new HashMap(); if (_extensions.containsKey(name)) - throw new IllegalArgumentException(Tapestry.format( - "LibrarySpecification.duplicate-extension-name", - this, - name)); + throw new IllegalArgumentException(Tapestry + .format("LibrarySpecification.duplicate-extension-name", + this, name)); _extensions.put(name, extension); } /** - * Returns a sorted List of the names of all extensions. May return the empty list, but won't - * return null. + * Returns a sorted List of the names of all extensions. May return the + * empty list, but won't return null. */ public synchronized List getExtensionNames() @@ -266,26 +260,26 @@ public IExtensionSpecification getExtensionSpecification(String name) { - if (_extensions == null) - return null; + if (_extensions == null) return null; return (IExtensionSpecification) _extensions.get(name); } /** - * Returns true if this library specification has a specification for the named extension. + * Returns true if this library specification has a specification for the + * named extension. */ public boolean checkExtension(String name) { - if (_extensions == null) - return false; + if (_extensions == null) return false; return _extensions.containsKey(name); } /** - * Returns an instantiated extension. Extensions are created as needed and cached for later use. + * Returns an instantiated extension. Extensions are created as needed and + * cached for later use. * * @throws IllegalArgumentException * if no extension specification exists for the given name. @@ -308,8 +302,7 @@ if (spec == null) throw new IllegalArgumentException(Tapestry.format( - "LibrarySpecification.no-such-extension", - name)); + "LibrarySpecification.no-such-extension", name)); if (result == null) { @@ -320,7 +313,8 @@ } if (typeConstraint != null) - applyTypeConstraint(name, result, typeConstraint, spec.getLocation()); + applyTypeConstraint(name, result, typeConstraint, spec + .getLocation()); return result; } @@ -333,47 +327,43 @@ * @since 3.0 */ - protected void applyTypeConstraint(String name, Object extension, Class typeConstraint, - Location location) + protected void applyTypeConstraint(String name, Object extension, + Class typeConstraint, Location location) { Class extensionClass = extension.getClass(); // Can you assign an instance of the extension to a variable // of type typeContraint legally? - if (typeConstraint.isAssignableFrom(extensionClass)) - return; + if (typeConstraint.isAssignableFrom(extensionClass)) return; String key = typeConstraint.isInterface() ? "LibrarySpecification.extension-does-not-implement-interface" : "LibrarySpecification.extension-not-a-subclass"; - throw new ApplicationRuntimeException(Tapestry.format( - key, - name, - extensionClass.getName(), - typeConstraint.getName()), location, null); + throw new ApplicationRuntimeException(Tapestry.format(key, name, + extensionClass.getName(), typeConstraint.getName()), location, + null); } /** - * Invoked after the entire specification has been constructed to instantiate any extensions - * marked immediate. + * Invoked after the entire specification has been constructed to + * instantiate any extensions marked immediate. */ public synchronized void instantiateImmediateExtensions() { - if (_extensions == null) - return; + if (_extensions == null) return; Iterator i = _extensions.entrySet().iterator(); - while (i.hasNext()) + while(i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); - IExtensionSpecification spec = (IExtensionSpecification) entry.getValue(); + IExtensionSpecification spec = (IExtensionSpecification) entry + .getValue(); - if (!spec.isImmediate()) - continue; + if (!spec.isImmediate()) continue; String name = (String) entry.getKey(); @@ -474,7 +464,8 @@ * * @param services * A Map of the fully qualified names of classes which implement - * [EMAIL PROTECTED] org.apache.tapestry.engine.IEngineService}keyed on service id. + * [EMAIL PROTECTED] org.apache.tapestry.engine.IEngineService}keyed on + * service id. * <p> * The map is retained, not copied. * @deprecated To be removed in release 4.1. @@ -499,8 +490,8 @@ * Updates the components map. * * @param components - * A Map of [EMAIL PROTECTED] IContainedComponent}keyed on component id. The map is retained, - * not copied. + * A Map of [EMAIL PROTECTED] IContainedComponent}keyed on component id. + * The map is retained, not copied. */ protected void setComponents(Map components) @@ -509,10 +500,12 @@ } /** - * Returns the XML Public Id for the library file, or null if not applicable. + * Returns the XML Public Id for the library file, or null if not + * applicable. * <p> - * This method exists as a convienience for the Spindle plugin. A previous method used an - * arbitrary version string, the public id is more useful and less ambiguous. + * This method exists as a convienience for the Spindle plugin. A previous + * method used an arbitrary version string, the public id is more useful and + * less ambiguous. */ public String getPublicId() @@ -569,4 +562,4 @@ { } -} \ No newline at end of file +}
Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/LocatablePropertyHolder.java URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/LocatablePropertyHolder.java?rev=395955&r1=395954&r2=395955&view=diff ============================================================================== --- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/LocatablePropertyHolder.java (original) +++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/LocatablePropertyHolder.java Fri Apr 21 10:31:14 2006 @@ -19,20 +19,21 @@ import org.apache.tapestry.util.BasePropertyHolder; /** - * Base class for implementing both - * interfaces [EMAIL PROTECTED] org.apache.tapestry.util.IPropertyHolder} and - * [EMAIL PROTECTED] org.apache.tapestry.ILocationHolder}. This is - * used by all the specification classes. - * - * @author Howard Lewis Ship - * @since 3.0 - * - **/ + * Base class for implementing both interfaces + * [EMAIL PROTECTED] org.apache.tapestry.util.IPropertyHolder} and + * [EMAIL PROTECTED] org.apache.tapestry.ILocationHolder}. This is used by all the + * specification classes. + * + * @author Howard Lewis Ship + * @since 3.0 + */ -public class LocatablePropertyHolder extends BasePropertyHolder implements LocationHolder +public class LocatablePropertyHolder extends BasePropertyHolder implements + LocationHolder { - private Location _location; - + + private Location _location; + public Location getLocation() { return _location; Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/ParameterSpecification.java URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/ParameterSpecification.java?rev=395955&r1=395954&r2=395955&view=diff ============================================================================== --- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/ParameterSpecification.java (original) +++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/ParameterSpecification.java Fri Apr 21 10:31:14 2006 @@ -24,16 +24,19 @@ import org.apache.tapestry.TapestryUtils; /** - * Defines a formal parameter to a component. A <code>IParameterSpecification</code> is contained - * by a [EMAIL PROTECTED] IComponentSpecification}. + * Defines a formal parameter to a component. A + * <code>IParameterSpecification</code> is contained by a + * [EMAIL PROTECTED] IComponentSpecification}. * <p> * TBD: Identify arrays in some way. * * @author Howard Lewis Ship */ -public class ParameterSpecification extends BaseLocatable implements IParameterSpecification +public class ParameterSpecification extends BaseLocatable implements + IParameterSpecification { + private boolean _required = false; private String _type; @@ -60,8 +63,8 @@ private boolean _deprecated = false; /** - * Returns the class name of the expected type of the parameter. The default value is - * <code>java.lang.Object</code> which matches anything. + * Returns the class name of the expected type of the parameter. The default + * value is <code>java.lang.Object</code> which matches anything. */ public String getType() @@ -70,8 +73,8 @@ } /** - * Returns true if the parameter is required by the component. The default is false, meaning the - * parameter is optional. + * Returns true if the parameter is required by the component. The default + * is false, meaning the parameter is optional. */ public boolean isRequired() @@ -85,8 +88,8 @@ } /** - * Sets the type of value expected for the parameter. This can be left blank to indicate any - * type. + * Sets the type of value expected for the parameter. This can be left blank + * to indicate any type. */ public void setType(String value) @@ -117,7 +120,8 @@ } /** - * Sets the property name (of the component class) to connect the parameter to. + * Sets the property name (of the component class) to connect the parameter + * to. */ public void setPropertyName(String propertyName) @@ -205,4 +209,4 @@ _deprecated = deprecated; } -} \ No newline at end of file +} Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/PropertyInjectable.java URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/PropertyInjectable.java?rev=395955&r1=395954&r2=395955&view=diff ============================================================================== --- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/PropertyInjectable.java (original) +++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/PropertyInjectable.java Fri Apr 21 10:31:14 2006 @@ -15,20 +15,22 @@ package org.apache.tapestry.spec; /** - * Interface extended by several specification interfaces to indicate that the runtime object - * constructed from the specification can be injected into the component class. + * Interface extended by several specification interfaces to indicate that the + * runtime object constructed from the specification can be injected into the + * component class. * * @author Howard M. Lewis Ship * @since 4.0 */ public interface PropertyInjectable { + /** - * Returns the name of the property to be created for this component, or null if no property - * should be created. + * Returns the name of the property to be created for this component, or + * null if no property should be created. */ - public String getPropertyName(); + String getPropertyName(); - public void setPropertyName(String propertyName); + void setPropertyName(String propertyName); -} \ No newline at end of file +} Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/PropertySpecification.java URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/PropertySpecification.java?rev=395955&r1=395954&r2=395955&view=diff ============================================================================== --- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/PropertySpecification.java (original) +++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/PropertySpecification.java Fri Apr 21 10:31:14 2006 @@ -18,15 +18,18 @@ /** * Defines a transient or persistant property of a component or page. A - * [EMAIL PROTECTED] org.apache.tapestry.engine.IComponentClassEnhancer}uses this information to create a - * subclass with the necessary instance variables and methods. + * [EMAIL PROTECTED] org.apache.tapestry.engine.IComponentClassEnhancer}uses this + * information to create a subclass with the necessary instance variables and + * methods. * * @author Howard Lewis Ship * @since 3.0 */ -public class PropertySpecification extends BaseLocatable implements IPropertySpecification +public class PropertySpecification extends BaseLocatable implements + IPropertySpecification { + private String _name; private String _type; @@ -51,10 +54,11 @@ } /** - * The type of property to create, or null if no type was specified. The value is the name of a - * primitive type, a fully qualified class name, or an array name for either. Type is only - * specified for 3.0 DTDs, in 4.0 the only behavior is for the new property to match the type - * defined by an abstract accessor, or to be java.lang.Object. + * The type of property to create, or null if no type was specified. The + * value is the name of a primitive type, a fully qualified class name, or + * an array name for either. Type is only specified for 3.0 DTDs, in 4.0 the + * only behavior is for the new property to match the type defined by an + * abstract accessor, or to be java.lang.Object. */ public String getType() { @@ -67,8 +71,9 @@ } /** - * Sets the name of the property. This should not be changed once this IPropertySpecification is - * added to a [EMAIL PROTECTED] org.apache.tapestry.spec.ComponentSpecification}. + * Sets the name of the property. This should not be changed once this + * IPropertySpecification is added to a + * [EMAIL PROTECTED] org.apache.tapestry.spec.ComponentSpecification}. */ public void setName(String name) @@ -92,4 +97,4 @@ { _persistence = persistence; } -} \ No newline at end of file +} Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/SpecFactory.java URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/SpecFactory.java?rev=395955&r1=395954&r2=395955&view=diff ============================================================================== --- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/SpecFactory.java (original) +++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/SpecFactory.java Fri Apr 21 10:31:14 2006 @@ -20,10 +20,11 @@ import org.apache.tapestry.coerce.ValueConverter; /** - * A Factory used by [EMAIL PROTECTED] org.apache.tapestry.parse.SpecificationParser} to create Tapestry - * domain objects. + * A Factory used by [EMAIL PROTECTED] org.apache.tapestry.parse.SpecificationParser} + * to create Tapestry domain objects. * <p> - * The default implementation here creates the expected runtime instances of classes in packages: + * The default implementation here creates the expected runtime instances of + * classes in packages: * <ul> * <li>org.apache.tapestry.spec</li> * <li>org.apache.tapestry.bean</li> @@ -37,6 +38,7 @@ public class SpecFactory { + /** * Creates a concrete instance of [EMAIL PROTECTED] ApplicationSpecification}. */ @@ -112,25 +114,28 @@ } /** @since 4.0 */ - public BindingBeanInitializer createBindingBeanInitializer(BindingSource source) + public BindingBeanInitializer createBindingBeanInitializer( + BindingSource source) { return new BindingBeanInitializer(source); } /** - * Creates a concrete instance of [EMAIL PROTECTED] org.apache.tapestry.spec.IExtensionSpecification}. + * Creates a concrete instance of + * [EMAIL PROTECTED] org.apache.tapestry.spec.IExtensionSpecification}. * * @since 2.2 */ - public IExtensionSpecification createExtensionSpecification(ClassResolver resolver, - ValueConverter valueConverter) + public IExtensionSpecification createExtensionSpecification( + ClassResolver resolver, ValueConverter valueConverter) { return new ExtensionSpecification(resolver, valueConverter); } /** - * Creates a concrete instance of [EMAIL PROTECTED] org.apache.tapestry.spec.IPropertySpecification}. + * Creates a concrete instance of + * [EMAIL PROTECTED] org.apache.tapestry.spec.IPropertySpecification}. * * @since 3.0 */ @@ -145,4 +150,4 @@ { return new InjectSpecificationImpl(); } -} \ No newline at end of file +} Modified: tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/SpecMessages.java URL: http://svn.apache.org/viewcvs/tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/SpecMessages.java?rev=395955&r1=395954&r2=395955&view=diff ============================================================================== --- tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/SpecMessages.java (original) +++ tapestry/tapestry4/trunk/framework/src/java/org/apache/tapestry/spec/SpecMessages.java Fri Apr 21 10:31:14 2006 @@ -21,10 +21,13 @@ * @author Howard M. Lewis Ship * @since 4.0 */ -class SpecMessages +final class SpecMessages { private static final MessageFormatter _formatter = new MessageFormatter(SpecMessages.class); + /* defeat instantiation */ + private SpecMessages() { } + static String claimedProperty(String propertyName, Object existing) { return _formatter.format("claimed-property", propertyName, HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]