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 >
IComponentDescriptorProcessor
implementations, 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_ALIAS, 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 boolean
equals(java.lang.Object obj)
java.lang.String
getName()
Gets the name of the component.java.util.Properties
getProperties()
Get the properties of this component.java.lang.String
getProperty(java.lang.String name)
Just a short hand forgetProperties().getProperty(String)
java.util.Properties
getRawProperties()
Get the raw properties of this component.long
getRevision()
Get the revision of the component.java.lang.String
getType()
Gets the type of the component.int
hashCode()
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.static java.util.Properties
processProperties(java.util.Properties raw, java.util.function.Function<java.lang.String,IComponentDescriptorProcessor> getProcessor)
Processing with custom retrieval of processors.void
setName(java.lang.String name)
void
setProperties(java.util.Properties properties)
void
setRevision(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:IComponentDescriptor
Get 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:
getRawProperties
in 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:IComponentDescriptor
Gets the name of the component.- Specified by:
getName
in interfaceIComponentDescriptor
-
getProperties
public java.util.Properties getProperties()
Description copied from interface:IComponentDescriptor
Get 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:
getProperties
in 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:IComponentDescriptor
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.- Specified by:
getRevision
in interfaceIComponentDescriptor
-
getType
public java.lang.String getType()
Description copied from interface:IComponentDescriptor
Gets the type of the component. A short-hand forgetProperty(COMPONENT_TYPE)
.- Specified by:
getType
in interfaceIComponentDescriptor
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Description copied from interface:IComponentDescriptor
Just a short hand forgetProperties().getProperty(String)
- Specified by:
getProperty
in interfaceIComponentDescriptor
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-