Class AbstractComponentDescriptor
- java.lang.Object
-
- com.zfabrik.components.provider.util.AbstractComponentDescriptor
-
- All Implemented Interfaces:
IComponentDescriptor,java.io.Serializable
- Direct Known Subclasses:
FSCRDBComponent
public abstract class AbstractComponentDescriptor extends java.lang.Object implements IComponentDescriptor, java.io.Serializable
Abstract implementation of a component descriptor. Useful in component repository implementations This implementation supports the switch board development mode feature. That is, in development mode, component properties may be overwritten by system properties following the naming scheme:
This implementation furthermore supports processing of properties for< component name >/ < property name > = < new value >IComponentDescriptorProcessorimplementations, such as the built-in JEXL3 support.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.zfabrik.components.IComponentDescriptor
ANY_COMPONENT_TYPE, COMPONENT_CLZ, COMPONENT_DESCRIPTOR_STYLE_PLAIN, COMPONENT_NAME, COMPONENT_TYPE, DEPENDENCIES, EXTENSION_POINTS, LINK_COMPONENT_TYPE, LINK_TARGET_COMPONENT, REVISION_INFO
-
-
Constructor Summary
Constructors Constructor Description AbstractComponentDescriptor()Default constructorAbstractComponentDescriptor(AbstractComponentDescriptor a)Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)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.inthashCode()static java.util.PropertiesprocessProperties(java.util.Properties raw)This method uses the to process properties to their target representation using none or some resolvable expression processing facility.static java.util.PropertiesprocessProperties(java.util.Properties raw, java.util.function.Function<java.lang.String,IComponentDescriptorProcessor> getProcessor)Processing with custom retrieval of processors.voidsetName(java.lang.String name)voidsetProperties(java.util.Properties properties)voidsetRevision(long revision)
-
-
-
Constructor Detail
-
AbstractComponentDescriptor
public AbstractComponentDescriptor()
Default constructor
-
AbstractComponentDescriptor
public AbstractComponentDescriptor(AbstractComponentDescriptor a)
Copy constructor
-
-
Method Detail
-
setProperties
public void setProperties(java.util.Properties properties)
-
getRawProperties
public java.util.Properties getRawProperties()
Description copied from interface:IComponentDescriptorGet the raw properties of this component. Note that unlikeIComponentDescriptor.getProperties()the result of this method is data as defined in persistent component configuration-- Specified by:
getRawPropertiesin interfaceIComponentDescriptor
-
setName
public void setName(java.lang.String name)
-
setRevision
public void setRevision(long revision)
-
getName
public java.lang.String getName()
Description copied from interface:IComponentDescriptorGets the name of the component.- Specified by:
getNamein interfaceIComponentDescriptor
-
getProperties
public java.util.Properties getProperties()
Description copied from interface:IComponentDescriptorGet the properties of this component. Note that these differ from the original configuration in these may be processed by some expression language evaluator.- Specified by:
getPropertiesin interfaceIComponentDescriptor
-
processProperties
public static java.util.Properties processProperties(java.util.Properties raw)
This method uses the to process properties to their target representation using none or some resolvable expression processing facility.
-
processProperties
public static java.util.Properties processProperties(java.util.Properties raw, java.util.function.Function<java.lang.String,IComponentDescriptorProcessor> getProcessor)Processing with custom retrieval of processors. See alsoIComponentDescriptor.
-
getRevision
public long getRevision()
Description copied from interface:IComponentDescriptorGet 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.- Specified by:
getRevisionin interfaceIComponentDescriptor
-
getType
public java.lang.String getType()
Description copied from interface:IComponentDescriptorGets the type of the component. A short-hand forgetProperty(COMPONENT_TYPE).- Specified by:
getTypein interfaceIComponentDescriptor
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Description copied from interface:IComponentDescriptorJust a short hand forgetProperties().getProperty(String)- Specified by:
getPropertyin interfaceIComponentDescriptor
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-