|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry.util.BasePropertyHolder
org.apache.tapestry.spec.LocatablePropertyHolder
org.apache.tapestry.spec.ComponentSpecification
public class ComponentSpecification
A specification for a component, as read from an XML specification file.
A specification consists of
From this information, an actual component may be instantiated and initialized. Instantiating a component is usually a recursive process, since to initialize a container component, it is necessary to instantiate and initialize its contained components as well.
IComponent,
IContainedComponent,
IPageLoader| Field Summary | |
|---|---|
protected Map |
_assets
Keyed on asset name, value is IAssetSpecification. |
protected Map |
_beans
Defines all helper beans. |
protected Map |
_components
Keyed on component id, value is IContainedComponent. |
protected Map |
_parameters
Defines all formal parameters. |
protected Set |
_reservedParameterNames
The names of all reserved informal parameter names (as lower-case). |
| Constructor Summary | |
|---|---|
ComponentSpecification()
|
|
| Method Summary | |
|---|---|
void |
addAsset(String name,
IAssetSpecification asset)
|
void |
addBeanSpecification(String name,
IBeanSpecification specification)
|
void |
addComponent(String id,
IContainedComponent component)
|
void |
addInjectSpecification(InjectSpecification spec)
Adds a InjectSpecification. |
void |
addParameter(IParameterSpecification spec)
Adds the parameter. |
void |
addPropertySpecification(IPropertySpecification spec)
Adds a new property specification. |
void |
addReservedParameterName(String value)
Adds the value as a reserved name. |
boolean |
getAllowBody()
Returns true if the component is allowed to wrap other elements (static HTML or other components). |
boolean |
getAllowInformalParameters()
Returns true if the component allows informal parameters (parameters not formally defined). |
IAssetSpecification |
getAsset(String name)
Returns the IAssetSpecificationwith the given name, or null if no such specification
exists. |
List |
getAssetNames()
Returns a List of the String names of all assets, in alphabetical order. |
Collection |
getBeanNames()
Returns an unmodifiable collection of the names of all beans. |
IBeanSpecification |
getBeanSpecification(String name)
Returns the IBeanSpecificationfor the given name, or null if not such specification
exists. |
IContainedComponent |
getComponent(String id)
Returns the specification of a contained component with the given id, or null if no such contained component exists. |
String |
getComponentClassName()
Returns the class name to be used when instantiating the component, or null if no class name was provided in the specification (in which case, a system of defaults will be used to determine the class name). |
List |
getComponentIds()
Returns an List of the String names of the IContainedComponents for
this component. |
String |
getDescription()
Returns the documentation for this component. |
List |
getInjectSpecifications()
Returns the list of InjectSpecification. |
IParameterSpecification |
getParameter(String name)
Returns the specification of a parameter with the given name, or null if no such parameter exists. |
List |
getParameterNames()
Returns a List of of String names of all parameters. |
IPropertySpecification |
getPropertySpecification(String name)
Returns the named IPropertySpecification, or null if no
such specification exist. |
List |
getPropertySpecificationNames()
Returns a sorted, immutable list of the names of all IPropertySpecifications. |
String |
getPublicId()
Returns the XML Public Id for the specification file, or null if not applicable. |
Collection |
getRequiredParameters()
Returns an unordered collection of IParameterSpecification, for
all parameters that are required. |
Set |
getReservedParameterNames()
Returns a Set of Strings; the reserved parameter names for the component. |
Resource |
getSpecificationLocation()
|
boolean |
isDeprecated()
Returns true if the component is deprecated. |
boolean |
isPageSpecification()
Returns true if the specification is known to be a page specification and not a component specification. |
boolean |
isReservedParameterName(String value)
Returns true if the value specified is in the reserved name list. |
void |
setAllowBody(boolean value)
|
void |
setAllowInformalParameters(boolean value)
|
void |
setComponentClassName(String value)
|
void |
setDeprecated(boolean deprecated)
|
void |
setDescription(String description)
Sets the documentation for this component. |
void |
setPageSpecification(boolean pageSpecification)
|
void |
setPublicId(String publicId)
|
void |
setSpecificationLocation(Resource specificationLocation)
|
String |
toString()
|
| Methods inherited from class org.apache.tapestry.spec.LocatablePropertyHolder |
|---|
getLocation, setLocation |
| Methods inherited from class org.apache.tapestry.util.BasePropertyHolder |
|---|
getProperty, getPropertyNames, removeProperty, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.tapestry.util.IPropertyHolder |
|---|
getProperty, getPropertyNames, removeProperty, setProperty |
| Methods inherited from interface org.apache.hivemind.LocationHolder |
|---|
setLocation |
| Methods inherited from interface org.apache.hivemind.Locatable |
|---|
getLocation |
| Field Detail |
|---|
protected Map _components
IContainedComponent.
protected Map _assets
IAssetSpecification.
protected Map _parameters
IParameterSpecification.
protected Map _beans
IBeanSpecification.
protected Set _reservedParameterNames
| Constructor Detail |
|---|
public ComponentSpecification()
| Method Detail |
|---|
public void addAsset(String name,
IAssetSpecification asset)
addAsset in interface IComponentSpecificationApplicationRuntimeException - if the name already exists.
public void addComponent(String id,
IContainedComponent component)
addComponent in interface IComponentSpecificationApplicationRuntimeException - if the id is already defined.public void addParameter(IParameterSpecification spec)
addParameter in interface IComponentSpecificationApplicationRuntimeException - if the name already exists.public boolean getAllowBody()
getAllowBody in interface IComponentSpecificationsetAllowBody(boolean)public boolean getAllowInformalParameters()
The default value is true.
getAllowInformalParameters in interface IComponentSpecificationsetAllowInformalParameters(boolean)public IAssetSpecification getAsset(String name)
IAssetSpecificationwith the given name, or null if no such specification
exists.
getAsset in interface IComponentSpecificationaddAsset(String,IAssetSpecification)public List getAssetNames()
List of the String names of all assets, in alphabetical order.
getAssetNames in interface IComponentSpecificationpublic IContainedComponent getComponent(String id)
getComponent in interface IComponentSpecificationaddComponent(String, IContainedComponent)public String getComponentClassName()
IComponentSpecification
getComponentClassName in interface IComponentSpecificationpublic List getComponentIds()
List of the String names of the IContainedComponents for
this component.
getComponentIds in interface IComponentSpecificationaddComponent(String, IContainedComponent)public IParameterSpecification getParameter(String name)
getParameter in interface IComponentSpecification#addParameter(String, IParameterSpecification)public Collection getRequiredParameters()
IComponentSpecificationIParameterSpecification, for
all parameters that are required. This includes only "real" parameters,
not aliases.
getRequiredParameters in interface IComponentSpecificationpublic List getParameterNames()
getParameterNames in interface IComponentSpecification#addParameter(String, IParameterSpecification)public void setAllowBody(boolean value)
setAllowBody in interface IComponentSpecificationpublic void setAllowInformalParameters(boolean value)
setAllowInformalParameters in interface IComponentSpecificationpublic void setComponentClassName(String value)
setComponentClassName in interface IComponentSpecification
public void addBeanSpecification(String name,
IBeanSpecification specification)
addBeanSpecification in interface IComponentSpecificationApplicationRuntimeException - if the bean already has a specification.public IBeanSpecification getBeanSpecification(String name)
IBeanSpecificationfor the given name, or null if not such specification
exists.
getBeanSpecification in interface IComponentSpecificationpublic Collection getBeanNames()
getBeanNames in interface IComponentSpecificationpublic void addReservedParameterName(String value)
addReservedParameterName in interface IComponentSpecificationpublic boolean isReservedParameterName(String value)
isReservedParameterName in interface IComponentSpecificationpublic String toString()
toString in class Objectpublic String getDescription()
getDescription in interface IComponentSpecificationpublic void setDescription(String description)
setDescription in interface IComponentSpecificationpublic String getPublicId()
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.
getPublicId in interface IComponentSpecificationpublic void setPublicId(String publicId)
setPublicId in interface IComponentSpecificationpublic boolean isPageSpecification()
isPageSpecification in interface IComponentSpecificationpublic void setPageSpecification(boolean pageSpecification)
setPageSpecification in interface IComponentSpecificationpublic Resource getSpecificationLocation()
getSpecificationLocation in interface IComponentSpecificationpublic void setSpecificationLocation(Resource specificationLocation)
setSpecificationLocation in interface IComponentSpecificationpublic void addPropertySpecification(IPropertySpecification spec)
addPropertySpecification in interface IComponentSpecificationpublic List getPropertySpecificationNames()
IPropertySpecifications.
getPropertySpecificationNames in interface IComponentSpecificationpublic IPropertySpecification getPropertySpecification(String name)
IPropertySpecification, or null if no
such specification exist.
getPropertySpecification in interface IComponentSpecificationaddPropertySpecification(IPropertySpecification)public void addInjectSpecification(InjectSpecification spec)
IComponentSpecificationInjectSpecification.
addInjectSpecification in interface IComponentSpecificationpublic List getInjectSpecifications()
IComponentSpecificationInjectSpecification. Will return an empty
list if no specifications have been added.
getInjectSpecifications in interface IComponentSpecificationpublic boolean isDeprecated()
IComponentSpecification
isDeprecated in interface IComponentSpecificationpublic void setDeprecated(boolean deprecated)
setDeprecated in interface IComponentSpecificationpublic Set getReservedParameterNames()
IComponentSpecification
getReservedParameterNames in interface IComponentSpecification
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||