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
MetadataManageraddDefinition in interface MetadataManagername - the definition Namedescription - the definition DescriptionMetadataExceptionpublic DynStruct addDefinition(String metadataDefinitionName, InputStream stream, ClassLoader loader) throws MetadataException
MetadataManageraddDefinition in interface MetadataManagermetadataDefinitionName - the definition Namestream - the input stream to be parsed.loader - the Class loader that can parse this input streamMetadataExceptionpublic 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 MetadataManagermetadata - the given metadata.MetadataExceptionpublic 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 MetadataManagermetadataName - the name whose corresponding attribute definition is to be
retrieved.public void addDefinition(DynClass definition) throws MetadataException
MetadataManageraddDefinition in interface MetadataManagerMetadataExceptionpublic void removeDefinition(DynStruct dynStruct)
MetadataManagerremoveDefinition in interface MetadataManagerdynStruct - the dynStruct to be removed.public MetadataContainer createMetadataContainer(String name)
MetadataManagercreateMetadataContainer in interface MetadataManagername - the DynStruct name.protected abstract MetadataContainer createMetadataContainer(DynClass dynClass)
public void storeMetadata(Metadata metadata) throws MetadataException
MetadataManagerstoreMetadata in interface MetadataManagermetadata - the metadata that needs to be stored.MetadataException - Exception caused by any access violation.public void loadMetadata(Metadata metadata) throws MetadataException
MetadataManagerloadMetadata in interface MetadataManagermetadata - the metadata that needs to be populated.MetadataException - Exception caused by any access violation.public Metadata getMetadata(DynStruct definition) throws InvalidMetadataNamespaceException
MetadataManagerMetadata instance based on a given
DynStruct, if it has not been previously registered, and adds
this Metadata to the system.getMetadata in interface MetadataManagerdefinition - the given dynStruct object.InvalidMetadataNamespaceExceptionpublic File getMetadataHomeRepository()
MetadataManagergetMetadataHomeRepository in interface MetadataManagerpublic void storeDefinitions()
public Iterator getDefinitions()
MetadataManagerRetrieves all the current definitions in the form of an Iterator interface.
getDefinitions in interface MetadataManagerpublic void setMetadataHomeRepository(File metadataHomeFile)
MetadataManagersetMetadataHomeRepository in interface MetadataManagermetadataHomeFile - the main Repository folder.public Metadata getMetadata(String metadataID) throws InvalidMetadataNamespaceException
MetadataManagergetMetadata in interface MetadataManagermetadataID - the metadata ID of the metadata object.InvalidMetadataNamespaceException - if the metadataID was not previously registered as Metadata.public void setValidationBeforeSaving(boolean doValidation)
MetadataManagersetValidationBeforeSaving in interface MetadataManagerdoValidation - if the validation must be performed or not before saving metadata objects.public boolean getValidationBeforeSaving()
MetadataManagergetValidationBeforeSaving in interface MetadataManagerpublic void setValidationBeforeExporting(boolean doValidation)
MetadataManagersetValidationBeforeExporting in interface MetadataManagerdoValidation - if the validation must be performed or not before saving metadata objects.public boolean getValidationBeforeExporting()
MetadataManagergetValidationBeforeExporting in interface MetadataManager