Class DublinCoreMetadataProvider
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.explorer.dublincore.DublinCoreMetadataProvider
-
- All Implemented Interfaces:
Initializable
,Component
,Contextualizable
,LogEnabled
,ThreadSafe
public class DublinCoreMetadataProvider extends AbstractLogEnabled implements Component, Contextualizable, ThreadSafe, Initializable
This class handle the enumerated values for DublinCore metadata
-
-
Constructor Summary
Constructors Constructor Description DublinCoreMetadataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,I18nizableText>
_parseEnumerator(Configuration configuration)
Parses the enumerator.protected void
_parseFile(String metadataName)
Parses the enumerator.protected I18nizableText
_parseI18nizableText(Configuration config, String name)
Parses an i18n text.void
contextualize(Context context)
Map<String,I18nizableText>
getEntries(String metadataName)
Provides the enumerated valuesI18nizableText
getEntry(String metadataName, String value)
Retrieves a single label from a value.Set<String>
getEnumeratedMetadataNames()
Get the enumerated metadata namesvoid
initialize()
boolean
isEnumerated(String metadataName)
Determines if the DublinCore metadata is enumerated-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
DublinCoreMetadataProvider
public DublinCoreMetadataProvider()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getEnumeratedMetadataNames
public Set<String> getEnumeratedMetadataNames()
Get the enumerated metadata names- Returns:
- the enumerated metadata names
-
isEnumerated
public boolean isEnumerated(String metadataName)
Determines if the DublinCore metadata is enumerated- Parameters:
metadataName
- the metadata name- Returns:
- true if the DublinCore metadata is enumerated
-
getEntries
public Map<String,I18nizableText> getEntries(String metadataName)
Provides the enumerated values- Parameters:
metadataName
- the metadata name- Returns:
- the enumerated values. Can be null.
-
getEntry
public I18nizableText getEntry(String metadataName, String value)
Retrieves a single label from a value.- Parameters:
metadataName
- the metadata nalevalue
- the value.- Returns:
- the label or
null
if not found.
-
_parseFile
protected void _parseFile(String metadataName) throws ConfigurationException
Parses the enumerator.- Parameters:
metadataName
- the metadata name- Throws:
ConfigurationException
- if the configuration is not valid.
-
_parseEnumerator
protected Map<String,I18nizableText> _parseEnumerator(Configuration configuration) throws ConfigurationException
Parses the enumerator.- Parameters:
configuration
- the configuration to use- Returns:
- the enumerator values
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_parseI18nizableText
protected I18nizableText _parseI18nizableText(Configuration config, String name) throws ConfigurationException
Parses an i18n text.- Parameters:
config
- the configuration to use.name
- the child name.- Returns:
- the i18n text.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
-