public abstract class AbstractMetadataManager extends Object implements MetadataManager
Modifier and Type | Field and Description |
---|---|
protected DynObjectManager |
dynManager |
protected File |
metadataHomeFile |
METADATA_NAMESPACE
Constructor and Description |
---|
AbstractMetadataManager() |
Modifier and Type | Method and Description |
---|---|
void |
addDefinition(DynClass definition)
Adds a new definition in the metadata manager.
|
DynStruct |
addDefinition(String metadataDefinitionName,
InputStream stream,
ClassLoader loader)
Adds a new definition in the metadata manager.
|
DynStruct |
addDefinition(String name,
String description)
Adds a new definition in the metadata manager.
|
protected abstract Metadata |
createMetadata(DynStruct definition) |
protected abstract MetadataContainer |
createMetadataContainer(DynClass dynClass) |
MetadataContainer |
createMetadataContainer(String name)
This is a utility interface to implement classes that implement the
interface Metadata.
|
DynStruct |
getDefinition(Metadata metadata)
If a Metadata definition (
DynStruct ) with a given metadata that
has been previously registered in this manager, then this method returns
that definition. |
DynStruct |
getDefinition(String metadataName)
If a Metadata definition (
DynStruct ) with the given definition
name has been previously registered in this manager, then this method
returns that definition. |
Iterator |
getDefinitions()
Retrieves all the current definitions in the form of an Iterator
interface.
|
Metadata |
getMetadata(DynStruct definition)
|
Metadata |
getMetadata(String metadataID)
Retrieves a metadata object based on its metadata ID.
|
File |
getMetadataHomeRepository()
Returns the main Metadata extension root repository.
|
File |
getRepositoryFile(String relativePath) |
boolean |
getValidationBeforeExporting()
Added options properties getter for validating before the exporting
function.
|
boolean |
getValidationBeforeSaving()
Added options properties getter for validating before the saving
function.
|
protected void |
initDefinitions() |
void |
loadMetadata(Metadata metadata)
This function populates the given Metadata object with the current values
that the system contains.
|
void |
removeDefinition(DynStruct dynStruct)
If the current dynStruct has been previously registered, it is removed
from both the dynObjectManager and the metadataManager lists.
|
void |
setMetadataHomeRepository(File metadataHomeFile)
Sets the main Metadata root repository for this manager.
|
void |
setValidationBeforeExporting(boolean doValidation)
Added options properties setter for validating before the exporting
function.
|
void |
setValidationBeforeSaving(boolean doValidation)
Added options properties setter for validating before the saving
function.
|
void |
storeDefinitions() |
void |
storeMetadata(Metadata metadata)
This function stores the given Metadata object to an output resource, be
it a database or a file containing its information.
|
protected DynObjectManager dynManager
protected File metadataHomeFile
protected void initDefinitions()
public DynStruct addDefinition(String name, String description) throws MetadataException
MetadataManager
addDefinition
in interface MetadataManager
name
- the definition Namedescription
- the definition DescriptionMetadataException
public DynStruct addDefinition(String metadataDefinitionName, InputStream stream, ClassLoader loader) throws MetadataException
MetadataManager
addDefinition
in interface MetadataManager
metadataDefinitionName
- the definition Namestream
- the input stream to be parsed.loader
- the Class loader that can parse this input streamMetadataException
public DynStruct getDefinition(Metadata metadata) throws MetadataException
MetadataManager
If a Metadata definition ( DynStruct
) with a given metadata that
has been previously registered in this manager, then this method returns
that definition. Otherwise, it returns null.
getDefinition
in interface MetadataManager
metadata
- the given metadata.MetadataException
public DynStruct getDefinition(String metadataName)
MetadataManager
If a Metadata definition ( DynStruct
) with the given definition
name has been previously registered in this manager, then this method
returns that definition. Otherwise, it returns null.
getDefinition
in interface MetadataManager
metadataName
- the name whose corresponding attribute definition is to be
retrieved.public void addDefinition(DynClass definition) throws MetadataException
MetadataManager
addDefinition
in interface MetadataManager
MetadataException
public void removeDefinition(DynStruct dynStruct)
MetadataManager
removeDefinition
in interface MetadataManager
dynStruct
- the dynStruct to be removed.public MetadataContainer createMetadataContainer(String name)
MetadataManager
createMetadataContainer
in interface MetadataManager
name
- the DynStruct name.protected abstract MetadataContainer createMetadataContainer(DynClass dynClass)
public void storeMetadata(Metadata metadata) throws MetadataException
MetadataManager
storeMetadata
in interface MetadataManager
metadata
- the metadata that needs to be stored.MetadataException
- Exception caused by any access violation.public void loadMetadata(Metadata metadata) throws MetadataException
MetadataManager
loadMetadata
in interface MetadataManager
metadata
- the metadata that needs to be populated.MetadataException
- Exception caused by any access violation.public Metadata getMetadata(DynStruct definition) throws InvalidMetadataNamespaceException
MetadataManager
Metadata
instance based on a given
DynStruct
, if it has not been previously registered, and adds
this Metadata to the system.getMetadata
in interface MetadataManager
definition
- the given dynStruct object.InvalidMetadataNamespaceException
public File getMetadataHomeRepository()
MetadataManager
getMetadataHomeRepository
in interface MetadataManager
public void storeDefinitions()
public Iterator getDefinitions()
MetadataManager
Retrieves all the current definitions in the form of an Iterator interface.
getDefinitions
in interface MetadataManager
public void setMetadataHomeRepository(File metadataHomeFile)
MetadataManager
setMetadataHomeRepository
in interface MetadataManager
metadataHomeFile
- the main Repository folder.public Metadata getMetadata(String metadataID) throws InvalidMetadataNamespaceException
MetadataManager
getMetadata
in interface MetadataManager
metadataID
- the metadata ID of the metadata object.InvalidMetadataNamespaceException
- if the metadataID was not previously registered as Metadata.public void setValidationBeforeSaving(boolean doValidation)
MetadataManager
setValidationBeforeSaving
in interface MetadataManager
doValidation
- if the validation must be performed or not before saving metadata objects.public boolean getValidationBeforeSaving()
MetadataManager
getValidationBeforeSaving
in interface MetadataManager
public void setValidationBeforeExporting(boolean doValidation)
MetadataManager
setValidationBeforeExporting
in interface MetadataManager
doValidation
- if the validation must be performed or not before saving metadata objects.public boolean getValidationBeforeExporting()
MetadataManager
getValidationBeforeExporting
in interface MetadataManager