public class StaticCompositeMetadata extends Object implements CompositeMetadata
CompositeMetadata containing no metadata.CompositeMetadata.MetadataType| Constructor and Description | 
|---|
StaticCompositeMetadata()
Constructor 
 | 
StaticCompositeMetadata(Map<String,Object> metadata)
Constructor 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
copyTo(ModifiableCompositeMetadata metadata)
Copy the current  
CompositeMetadata to the given composite metadata. | 
BinaryMetadata | 
getBinaryMetadata(String metadataName)
Returns the named metadata's value as  
BinaryMetadata.If the metadata does not exist, an UnknownMetadataException is thrown. | 
boolean | 
getBoolean(String metadataName)
Returns the named metadata's value as boolean. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. | 
boolean | 
getBoolean(String metadataName,
          boolean defaultValue)
Returns the named metadata's value as boolean. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned.  | 
boolean[] | 
getBooleanArray(String metadataName)
Returns the named metadata's value as boolean array. 
 | 
boolean[] | 
getBooleanArray(String metadataName,
               boolean[] defaultValues)
Returns the named metadata's value as boolean array. 
If the metadata does not exist, the default values are returned.  | 
CompositeMetadata | 
getCompositeMetadata(String metadataName)
Returns the named metadata's value as  
CompositeMetadata.If the metadata is multi-valued, one of the value is returned. If the metadata does not exist an UnknownMetadataException is thrown. | 
Date | 
getDate(String metadataName)
Returns the named metadata's value as Date. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. | 
Date | 
getDate(String metadataName,
       Date defaultValue)
Returns the named metadata's value as Date. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned.  | 
Date[] | 
getDateArray(String metadataName)
Returns the named metadata's value as Date array. 
 | 
Date[] | 
getDateArray(String metadataName,
            Date[] defaultValues)
Returns the named metadata's value as Date array. 
If the metadata does not exist, the default values are returned.  | 
double | 
getDouble(String metadataName)
Returns the named metadata's value as double. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. | 
double | 
getDouble(String metadataName,
         double defaultValue)
Returns the named metadata's value as double. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned.  | 
double[] | 
getDoubleArray(String metadataName)
Returns the named metadata's value as double array. 
 | 
double[] | 
getDoubleArray(String metadataName,
              double[] defaultValues)
Returns the named metadata's value as double array. 
If the metadata does not exist, the default values are returned.  | 
String | 
getLocalizedString(String metadataName,
                  Locale locale)
Returns the named metadata's value of a multilingual metadata as String. 
 | 
String | 
getLocalizedString(String metadataName,
                  Locale locale,
                  String defaultValue)
Returns the named metadata's value of a multilingual metadata as String. 
If the metadata does not exist, the default value is returned.  | 
long | 
getLong(String metadataName)
Returns the named metadata's value as long. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. | 
long | 
getLong(String metadataName,
       long defaultValue)
Returns the named metadata's value as long. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned.  | 
long[] | 
getLongArray(String metadataName)
Returns the named metadata's value as long array. 
 | 
long[] | 
getLongArray(String metadataName,
            long[] defaultValues)
Returns the named metadata's value as long array. 
If the metadata does not exist, the default values are returned.  | 
String[] | 
getMetadataNames()
Returns an array containing metadata names. 
 | 
MultilingualString | 
getMultilingualString(String metadataName)
Returns the named metadata's values of a multilingual metadata. 
 | 
TraversableAmetysObject | 
getObjectCollection(String metadataName)
Returns an object collection metadata as a  
TraversableAmetysObject.  | 
RichText | 
getRichText(String metadataName)
Returns the named metadata's value as  
RichText.If the metadata does not exist, an UnknownMetadataException is thrown. | 
String | 
getString(String metadataName)
Returns the named metadata's value as String. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. | 
String | 
getString(String metadataName,
         String defaultValue)
Returns the named metadata's value as String. 
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned.  | 
String[] | 
getStringArray(String metadataName)
Returns the named metadata's value as String array. 
 | 
String[] | 
getStringArray(String metadataName,
              String[] defaultValues)
Returns the named metadata's value as String array. 
If the metadata does not exist, the default values are returned.  | 
CompositeMetadata.MetadataType | 
getType(String metadataName)
Returns the type of the given metadata. 
 | 
UserIdentity | 
getUser(String metadataName)
Returns the named metadata's value as  
UserIdentity.If the metadata does not exist, an UnknownMetadataException is thrown. | 
UserIdentity | 
getUser(String metadataName,
       UserIdentity defaultValue)
Returns the named metadata's value as  
UserIdentity.If the metadata does not exist, the default value is returned.  | 
UserIdentity[] | 
getUserArray(String metadataName)
Returns the named metadata's value as  
UserIdentity array. | 
UserIdentity[] | 
getUserArray(String metadataName,
            UserIdentity[] defaultValues)
Returns the named metadata's value as  
UserIdentity array.If the metadata does not exist, the default values are returned.  | 
boolean | 
hasMetadata(String metadataName)
Tests if a metadata with a given name exists. 
 | 
boolean | 
isMultiple(String metadataName)
Test if the given metadata is multiple. 
 | 
public StaticCompositeMetadata()
public StaticCompositeMetadata(Map<String,Object> metadata)
metadata - the composite metadatapublic BinaryMetadata getBinaryMetadata(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataBinaryMetadata.UnknownMetadataException is thrown.getBinaryMetadata in interface CompositeMetadatametadataName - the metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public boolean getBoolean(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataUnknownMetadataException is thrown.getBoolean in interface CompositeMetadatametadataName - the metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public boolean getBoolean(String metadataName, boolean defaultValue) throws AmetysRepositoryException
CompositeMetadatagetBoolean in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.public boolean[] getBooleanArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadatagetBooleanArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public boolean[] getBooleanArray(String metadataName, boolean[] defaultValues) throws AmetysRepositoryException
CompositeMetadatagetBooleanArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.AmetysRepositoryException - if an error occurs.public CompositeMetadata getCompositeMetadata(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataCompositeMetadata.UnknownMetadataException is thrown.getCompositeMetadata in interface CompositeMetadatametadataName - the metadata name.CompositeMetadata.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public Date getDate(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataUnknownMetadataException is thrown.getDate in interface CompositeMetadatametadataName - the metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public Date getDate(String metadataName, Date defaultValue) throws AmetysRepositoryException
CompositeMetadatagetDate in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.public Date[] getDateArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadatagetDateArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public Date[] getDateArray(String metadataName, Date[] defaultValues) throws AmetysRepositoryException
CompositeMetadatagetDateArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.AmetysRepositoryException - if an error occurs.public double getDouble(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataUnknownMetadataException is thrown.getDouble in interface CompositeMetadatametadataName - the metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public double getDouble(String metadataName, double defaultValue) throws AmetysRepositoryException
CompositeMetadatagetDouble in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.public double[] getDoubleArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadatagetDoubleArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public double[] getDoubleArray(String metadataName, double[] defaultValues) throws AmetysRepositoryException
CompositeMetadatagetDoubleArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.AmetysRepositoryException - if an error occurs.public long getLong(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataUnknownMetadataException is thrown.getLong in interface CompositeMetadatametadataName - the metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public long getLong(String metadataName, long defaultValue) throws AmetysRepositoryException
CompositeMetadatagetLong in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.public long[] getLongArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadatagetLongArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public long[] getLongArray(String metadataName, long[] defaultValues) throws AmetysRepositoryException
CompositeMetadatagetLongArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.AmetysRepositoryException - if an error occurs.public String[] getMetadataNames() throws AmetysRepositoryException
CompositeMetadatagetMetadataNames in interface CompositeMetadataAmetysRepositoryException - if an error occurs.public RichText getRichText(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataRichText.UnknownMetadataException is thrown.getRichText in interface CompositeMetadatametadataName - the metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public String getString(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataUnknownMetadataException is thrown.getString in interface CompositeMetadatametadataName - the metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public String getString(String metadataName, String defaultValue) throws AmetysRepositoryException
CompositeMetadatagetString in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.public String[] getStringArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadatagetStringArray in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public String[] getStringArray(String metadataName, String[] defaultValues) throws AmetysRepositoryException
CompositeMetadatagetStringArray in interface CompositeMetadatametadataName - metadata name.defaultValues - the default values.AmetysRepositoryException - if an error occurs.public String getLocalizedString(String metadataName, Locale locale) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadatagetLocalizedString in interface CompositeMetadatametadataName - the metadata name.locale - the locale of value to retrieveUnknownMetadataException - if the named metadata does not exist for the given locale.AmetysRepositoryException - if an error occurs.public String getLocalizedString(String metadataName, Locale locale, String defaultValue) throws AmetysRepositoryException
CompositeMetadatagetLocalizedString in interface CompositeMetadatametadataName - the metadata name.locale - the locale of value to retrievedefaultValue - the default value.AmetysRepositoryException - if an error occurs.public MultilingualString getMultilingualString(String metadataName) throws AmetysRepositoryException
CompositeMetadatagetMultilingualString in interface CompositeMetadatametadataName - the metadata name.AmetysRepositoryException - if an error occurs.public UserIdentity getUser(String metadataName) throws AmetysRepositoryException
CompositeMetadataUserIdentity.UnknownMetadataException is thrown.getUser in interface CompositeMetadatametadataName - the metadata name.AmetysRepositoryException - if an error occurs.public UserIdentity getUser(String metadataName, UserIdentity defaultValue) throws AmetysRepositoryException
CompositeMetadataUserIdentity.getUser in interface CompositeMetadatametadataName - the metadata name.defaultValue - the default value.AmetysRepositoryException - if an error occurs.public UserIdentity[] getUserArray(String metadataName) throws AmetysRepositoryException
CompositeMetadataUserIdentity array.getUserArray in interface CompositeMetadatametadataName - the metadata name.AmetysRepositoryException - if an error occurs.public UserIdentity[] getUserArray(String metadataName, UserIdentity[] defaultValues) throws AmetysRepositoryException
CompositeMetadataUserIdentity array.getUserArray in interface CompositeMetadatametadataName - the metadata name.defaultValues - the default values.AmetysRepositoryException - if an error occurs.public CompositeMetadata.MetadataType getType(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadatagetType in interface CompositeMetadatametadataName - metadata name.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public boolean hasMetadata(String metadataName)
CompositeMetadatahasMetadata in interface CompositeMetadatametadataName - the metadataName to test.true if the given metadata exists, false otherwise.public boolean isMultiple(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadataisMultiple in interface CompositeMetadatametadataName - the metadata name.true if the given metadata is multiple,
         false otherwise.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.public void copyTo(ModifiableCompositeMetadata metadata) throws AmetysRepositoryException
CompositeMetadataCompositeMetadata to the given composite metadata.copyTo in interface CompositeMetadatametadata - The parent composite metadata. Can not be null.AmetysRepositoryException - if an error occurs.public TraversableAmetysObject getObjectCollection(String metadataName) throws AmetysRepositoryException
CompositeMetadataTraversableAmetysObjectgetObjectCollection in interface CompositeMetadatametadataName - the metadata name.TraversableAmetysObject.UnknownMetadataException - if the named metadata does not exist.AmetysRepositoryException - if an error occurs.