Interface IComponentDescriptor
-
- All Known Implementing Classes:
AbstractComponentDescriptor,FSCRDBComponent
public interface IComponentDescriptorThe Component Descriptor provides access to meta data as provided by component repositories (IComponentsRepositorywithout requiring download of further component resources or other processing.A Component Descriptor can be retrieved by calling
IComponentsRepository.getComponent(String)or by a component lookup passing this interface as expected result type:IComponentsLookup.INSTANCE.lookup(<component name>,IComponentDescriptor.class);Component metadata is provided as properties in the format of aPropertiesproperties file. At least such property file should declare a component type:com.zfabrik.component.type=<component type>
For examplecom.zfabrik.component.type=com.zfabrik.java
would define a Java component.Component property values may be provided dynamically through implementations of
IComponentDescriptorProcessor. Given a component propertysomeNameSpace.somePropertyName, it may be further qualified with a processing style, such as JEXL3, by appending the style to the property name separated by a colon (that needs to be escaped in property file format). In the example this would look as follows:
See the JEXL3 component descriptor processor documentation for more details.someNameSpace.somePropertyName\:JEXL3=....- Author:
- hb
- See Also:
IComponentsRepository,IComponentsLookup
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringANY_COMPONENT_TYPEComponent type for "any" component.static java.lang.StringCOMPONENT_CLZThe class name of the component implementation.static java.lang.StringCOMPONENT_DESCRIPTOR_STYLE_PLAINThe default expression evaluation style for the component descriptor and default value of#COMPONENT_DESCRIPTOR_STYLE.static java.lang.StringCOMPONENT_NAMEThe name of the component.static java.lang.StringCOMPONENT_TYPEThe type of a component.static java.lang.StringDEPENDENCIESComponents declare dependency on other components by specifying a comma-separated list of component names.static java.lang.StringEXTENSION_POINTSA component may declare to an implementation of an extension point.static java.lang.StringLINK_COMPONENT_TYPEComponent type for component (symbolic) links.static java.lang.StringLINK_TARGET_COMPONENTComponent descriptor property defining the link targetstatic java.lang.StringREVISION_INFOAdditional revision information.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetName()Gets the name of the component.java.util.PropertiesgetProperties()Get the properties of this component.java.lang.StringgetProperty(java.lang.String name)Just a short hand forgetProperties().getProperty(String)java.util.PropertiesgetRawProperties()Get the raw properties of this component.longgetRevision()Get the revision of the component.java.lang.StringgetType()Gets the type of the component.
-
-
-
Field Detail
-
COMPONENT_NAME
static final java.lang.String COMPONENT_NAME
The name of the component. This property can be used conveniently to convey a component name, e.g. on a servlet request or elsewhere.- See Also:
- Constant Field Values
-
COMPONENT_TYPE
static final java.lang.String COMPONENT_TYPE
The type of a component. For examplecom.zfabrik.javafor a Java component.- See Also:
- Constant Field Values
-
COMPONENT_DESCRIPTOR_STYLE_PLAIN
static final java.lang.String COMPONENT_DESCRIPTOR_STYLE_PLAIN
The default expression evaluation style for the component descriptor and default value of#COMPONENT_DESCRIPTOR_STYLE. If set to this value, no expression evaluation will take place.- See Also:
- Constant Field Values
-
COMPONENT_CLZ
static final java.lang.String COMPONENT_CLZ
The class name of the component implementation. Many component types support the use of this property, which is why it is declared here. It is by no means a necessary requirement of a component type to require an implementation class. Component's that do support specification of a component implementation class do, by convention, use JavaComponentUtil.html.loadImplementationClassFromJavaComponent() to load that implementation class.- See Also:
- Constant Field Values
-
DEPENDENCIES
static final java.lang.String DEPENDENCIES
Components declare dependency on other components by specifying a comma-separated list of component names. All components will be queried for implementations ofIDependencyComponentand correspondingly invoked before the component resource is even created. This is slightly different to dependencies for system states (see there) in that these dependencies will not be revisited upon synchronisations. The declaring component will be dependent on all declared dependency components.- See Also:
- Constant Field Values
-
REVISION_INFO
static final java.lang.String REVISION_INFO
Additional revision information. This may be some original information as provided by the source.- See Also:
- Constant Field Values
-
EXTENSION_POINTS
static final java.lang.String EXTENSION_POINTS
A component may declare to an implementation of an extension point. This property is used to express a list of extension points implemented.- See Also:
- Constant Field Values
-
LINK_COMPONENT_TYPE
static final java.lang.String LINK_COMPONENT_TYPE
Component type for component (symbolic) links. A component link delegates all lookups and resource retrievals to another, named component that is specified using theLINK_TARGET_COMPONENTproperty. This is a low-level built-in component type.- See Also:
- Constant Field Values
-
LINK_TARGET_COMPONENT
static final java.lang.String LINK_TARGET_COMPONENT
Component descriptor property defining the link target- See Also:
- Constant Field Values
-
ANY_COMPONENT_TYPE
static final java.lang.String ANY_COMPONENT_TYPE
Component type for "any" component. The any component type requires specification ofCOMPONENT_CLZand has behavior depending on the type of class: If no component type is specified on a component descriptor, it defaults to this type.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of the component.
-
getType
java.lang.String getType()
Gets the type of the component. A short-hand forgetProperty(COMPONENT_TYPE).
-
getRevision
long getRevision()
Get the revision of the component. Minimum revision is zero. Revisions may not necessarily be strictly increasing, as components may be provided by different repositories over time.
-
getProperties
java.util.Properties getProperties()
Get the properties of this component. Note that these differ from the original configuration in these may be processed by some expression language evaluator.
-
getRawProperties
java.util.Properties getRawProperties()
Get the raw properties of this component. Note that unlikegetProperties()the result of this method is data as defined in persistent component configuration-
-
getProperty
java.lang.String getProperty(java.lang.String name)
Just a short hand forgetProperties().getProperty(String)
-
-