org.apache.lenya.cms.metadata
Interface MetaData

All Known Subinterfaces:
DublinCore

public interface MetaData

Generic meta data interface.

Version:
$Id: MetaData.java 473861 2006-11-12 03:51:14Z gregor $

Method Summary
 void addValue(java.lang.String key, java.lang.String value)
          Addds a value for a certain key.
 void forcedReplaceBy(MetaData other)
          Replace the contents of the current meta data by the contents of other.
 java.lang.String[] getAvailableKeys()
          Get all available keys.
 ElementSet getElementSet()
           
 java.lang.String getFirstValue(java.lang.String key)
          Returns the first value for a certain key.
 long getLastModified()
          Get last modification date.
 java.lang.String[] getPossibleKeys()
           
 java.lang.String[] getValues(java.lang.String key)
          Returns the values for a certain key.
 boolean isValidAttribute(java.lang.String key)
          Checks if a key represents a valid metadata attribute.
 void removeAllValues(java.lang.String key)
          Removes all values for a certain key.
 void replaceBy(MetaData other)
          Replace the contents of the current meta data by the contents of other.
 void setValue(java.lang.String key, java.lang.String value)
          Sets the value for a certain key.
 

Method Detail

getValues

java.lang.String[] getValues(java.lang.String key)
                             throws MetaDataException
Returns the values for a certain key.

Parameters:
key - The key.
Returns:
An array of strings.
Throws:
MetaDataException - when something went wrong.

getFirstValue

java.lang.String getFirstValue(java.lang.String key)
                               throws MetaDataException
Returns the first value for a certain key.

Parameters:
key - The key.
Returns:
A string or null if no value is set for this key.
Throws:
MetaDataException - if an error occurs.

getAvailableKeys

java.lang.String[] getAvailableKeys()
Get all available keys.

Returns:
The keys available in this MetaData object.

setValue

void setValue(java.lang.String key,
              java.lang.String value)
              throws MetaDataException
Sets the value for a certain key. All existing values will be removed.

Parameters:
key - The key.
value - The value to set.
Throws:
MetaDataException - when something went wrong.

addValue

void addValue(java.lang.String key,
              java.lang.String value)
              throws MetaDataException
Addds a value for a certain key. The existing values will not be removed.

Parameters:
key - The key.
value - The value to add.
Throws:
MetaDataException - if there's already a value set and the element doesn't support multiple values.

replaceBy

void replaceBy(MetaData other)
               throws MetaDataException
Replace the contents of the current meta data by the contents of other.

Parameters:
other - The other meta data manager.
Throws:
MetaDataException - if an error occurs.

forcedReplaceBy

void forcedReplaceBy(MetaData other)
                     throws MetaDataException
Replace the contents of the current meta data by the contents of other. All meta data is replaced, disregarding the rules given by element.getActionOnCopy().

Parameters:
other - The other meta data manager.
Throws:
MetaDataException - if an error occurs.

getPossibleKeys

java.lang.String[] getPossibleKeys()
Returns:
All keys that can be used.

isValidAttribute

boolean isValidAttribute(java.lang.String key)
Checks if a key represents a valid metadata attribute.

Parameters:
key - The key.
Returns:
A boolean value.

getLastModified

long getLastModified()
                     throws MetaDataException
Get last modification date.

Returns:
last modification date
Throws:
MetaDataException - if an error occurs.

getElementSet

ElementSet getElementSet()
Returns:
The element set this meta data object belongs to.

removeAllValues

void removeAllValues(java.lang.String key)
                     throws MetaDataException
Removes all values for a certain key.

Parameters:
key - The key.
Throws:
MetaDataException - if the key is not supported.


Copyright © 1999-2006 Apache Software Foundation. All Rights Reserved.