|
||||||||||
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 |
addElementEventListener(String elementId,
String[] events,
String methodName,
String formId,
boolean validateForm,
boolean async,
boolean focus)
Adds a deferred event listener binding for the specified html element. |
void |
addEventListener(String componentId,
String[] events,
String methodName,
String formId,
boolean validateForm,
boolean async,
boolean focus,
boolean autoSubmit)
Adds a deferred event listener binding for the specified 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. |
void |
connectAutoSubmitEvents(IComponent component,
IForm form)
Invoked during rendering when a component has been detected as a IFormComponent and may
possibly need its events to be wired up as form events. |
boolean |
equals(Object obj)
|
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 IAssetSpecification with 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 IBeanSpecification for 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). |
Map |
getComponentEvents()
Gets all component event mappings. |
ComponentEventProperty |
getComponentEvents(String id)
Gets component bound event properties. |
List |
getComponentIds()
Returns an List of the String names of the IContainedComponent s for
this component. |
String |
getDescription()
Returns the documentation for this component. |
Map |
getElementEvents()
Gets all mapped element events for this component. |
ComponentEventProperty |
getElementEvents(String id)
Gets element bound event properties. |
EventBoundListener[] |
getFormEvents(String formId,
BrowserEvent event)
Returns a list of element / component bound event listeners that were specified as invoking the form component with a matching id to formId of type
EventBoundListener . |
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 IPropertySpecification s. |
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. |
org.apache.hivemind.Resource |
getSpecificationLocation()
|
boolean |
hasElementEvents()
Checks if any element events are bound to this component. |
int |
hashCode()
|
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 |
rewireComponentId(String componentId,
String extendedId,
String idPath)
Invoked during page load to map event connections previously made via the IComponent.getId() identifier
to use the more unique IComponent.getIdPath() . |
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(org.apache.hivemind.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, finalize, getClass, 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 IComponentSpecification
org.apache.hivemind.ApplicationRuntimeException
- if the name already exists.public void addComponent(String id, IContainedComponent component)
addComponent
in interface IComponentSpecification
org.apache.hivemind.ApplicationRuntimeException
- if the id is already defined.public void addParameter(IParameterSpecification spec)
addParameter
in interface IComponentSpecification
org.apache.hivemind.ApplicationRuntimeException
- if the name already exists.public boolean getAllowBody()
getAllowBody
in interface IComponentSpecification
setAllowBody(boolean)
public boolean getAllowInformalParameters()
The default value is true.
getAllowInformalParameters
in interface IComponentSpecification
setAllowInformalParameters(boolean)
public IAssetSpecification getAsset(String name)
IAssetSpecification
with the given name, or null if no such specification
exists.
getAsset
in interface IComponentSpecification
addAsset(String,IAssetSpecification)
public List getAssetNames()
List
of the String names of all assets, in alphabetical order.
getAssetNames
in interface IComponentSpecification
public IContainedComponent getComponent(String id)
getComponent
in interface IComponentSpecification
addComponent(String, IContainedComponent)
public String getComponentClassName()
IComponentSpecification
getComponentClassName
in interface IComponentSpecification
public List getComponentIds()
List
of the String names of the IContainedComponent
s for
this component.
getComponentIds
in interface IComponentSpecification
addComponent(String, IContainedComponent)
public IParameterSpecification getParameter(String name)
getParameter
in interface IComponentSpecification
addParameterByName(String, IParameterSpecification)
public Collection getRequiredParameters()
IComponentSpecification
IParameterSpecification
, for
all parameters that are required. This includes only "real" parameters,
not aliases.
getRequiredParameters
in interface IComponentSpecification
public List getParameterNames()
getParameterNames
in interface IComponentSpecification
addParameterByName(String, IParameterSpecification)
public void setAllowBody(boolean value)
setAllowBody
in interface IComponentSpecification
public void setAllowInformalParameters(boolean value)
setAllowInformalParameters
in interface IComponentSpecification
public void setComponentClassName(String value)
setComponentClassName
in interface IComponentSpecification
public void addBeanSpecification(String name, IBeanSpecification specification)
addBeanSpecification
in interface IComponentSpecification
org.apache.hivemind.ApplicationRuntimeException
- if the bean already has a specification.public IBeanSpecification getBeanSpecification(String name)
IBeanSpecification
for the given name, or null if not such specification
exists.
getBeanSpecification
in interface IComponentSpecification
public Collection getBeanNames()
getBeanNames
in interface IComponentSpecification
public void addReservedParameterName(String value)
addReservedParameterName
in interface IComponentSpecification
public boolean isReservedParameterName(String value)
isReservedParameterName
in interface IComponentSpecification
public String toString()
toString
in class Object
public String getDescription()
getDescription
in interface IComponentSpecification
public void setDescription(String description)
setDescription
in interface IComponentSpecification
public 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 IComponentSpecification
public void setPublicId(String publicId)
setPublicId
in interface IComponentSpecification
public boolean isPageSpecification()
isPageSpecification
in interface IComponentSpecification
public void setPageSpecification(boolean pageSpecification)
setPageSpecification
in interface IComponentSpecification
public org.apache.hivemind.Resource getSpecificationLocation()
getSpecificationLocation
in interface IComponentSpecification
public void setSpecificationLocation(org.apache.hivemind.Resource specificationLocation)
setSpecificationLocation
in interface IComponentSpecification
public void addPropertySpecification(IPropertySpecification spec)
addPropertySpecification
in interface IComponentSpecification
public List getPropertySpecificationNames()
IPropertySpecification
s.
getPropertySpecificationNames
in interface IComponentSpecification
public IPropertySpecification getPropertySpecification(String name)
IPropertySpecification
, or null if no
such specification exist.
getPropertySpecification
in interface IComponentSpecification
addPropertySpecification(IPropertySpecification)
public void addInjectSpecification(InjectSpecification spec)
IComponentSpecification
InjectSpecification
.
addInjectSpecification
in interface IComponentSpecification
public List getInjectSpecifications()
IComponentSpecification
InjectSpecification
. Will return an empty
list if no specifications have been added.
getInjectSpecifications
in interface IComponentSpecification
public boolean isDeprecated()
IComponentSpecification
isDeprecated
in interface IComponentSpecification
public void setDeprecated(boolean deprecated)
setDeprecated
in interface IComponentSpecification
public Set getReservedParameterNames()
IComponentSpecification
getReservedParameterNames
in interface IComponentSpecification
public void addEventListener(String componentId, String[] events, String methodName, String formId, boolean validateForm, boolean async, boolean focus, boolean autoSubmit)
addEventListener
in interface IEventListener
componentId
- The component this is for.events
- The events that should cause the listener to be executed.methodName
- The page/component listener name that should be executed when
one of the supplied events occurs.formId
- The optional id of the form that should be submitted as part of this event invocation.validateForm
- If a formId was specified, whether or not that form should have client side valiation
invoked during the process.async
- If submitting a form, whether or not to do it asynchronously.focus
- If submitting a form, controls whether or not to focus it after an update.autoSubmit
- If true - auto form wiring is performed on any component targets implementing IFormComponent
so
that the enclosing form is submitted as part of the event in order to maintain consistent form state as in normal listener method
invocations.public void addElementEventListener(String elementId, String[] events, String methodName, String formId, boolean validateForm, boolean async, boolean focus)
addElementEventListener
in interface IEventListener
elementId
- The client side html element id to match against.events
- The client side events to bind to.methodName
- The listener that should be invoked when the event happens.formId
- The optional id of the form that should be submitted as part of this event invocation.validateForm
- If a formId was specified, whether or not that form should have client side valiation
invoked during the process.async
- If submitting a form, whether or not to do it asynchronously.focus
- If submitting a form, controls whether or not to focus it after an update.public void connectAutoSubmitEvents(IComponent component, IForm form)
IEventListener
IFormComponent
and may
possibly need its events to be wired up as form events.
connectAutoSubmitEvents
in interface IEventListener
component
- The component to rewire form events for.form
- The form containing the component.public void rewireComponentId(String componentId, String extendedId, String idPath)
IEventListener
IComponent.getId()
identifier
to use the more unique IComponent.getIdPath()
.
rewireComponentId
in interface IEventListener
componentId
- The base component id.extendedId
- The id of the component as returned by IComponent.getExtendedId()
idPath
- The id of the component as returned by IComponent.getIdPath()
public ComponentEventProperty getComponentEvents(String id)
getComponentEvents
in interface IEventListener
id
- The component to get event listeners for.
public Map getComponentEvents()
IEventListener
getComponentEvents
in interface IEventListener
ComponentEventProperty
values this component is listening to.public ComponentEventProperty getElementEvents(String id)
getElementEvents
in interface IEventListener
id
- The element to get listeners for.
public Map getElementEvents()
getElementEvents
in interface IEventListener
public EventBoundListener[] getFormEvents(String formId, BrowserEvent event)
formId
of type
EventBoundListener
.
getFormEvents
in interface IEventListener
formId
- The form that the event listeners were bound to submit when the event occurs.event
- The event that caused the current invocation.
public boolean hasElementEvents()
hasElementEvents
in interface IEventListener
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |