org.datanucleus.metadata
Class MapMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.ContainerMetaData
          extended by org.datanucleus.metadata.MapMetaData
All Implemented Interfaces:
java.io.Serializable

public class MapMetaData
extends ContainerMetaData

Representation of the Meta-Data for a Map.

See Also:
Serialized Form

Nested Class Summary
static class MapMetaData.MapType
           
 
Field Summary
protected  org.datanucleus.metadata.ContainerComponent key
          Representation of the key of the map.
protected  MapMetaData.MapType mapType
          Type of map.
protected  org.datanucleus.metadata.ContainerComponent value
          Representation of the value of the map.
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
MapMetaData()
          Default constructor.
MapMetaData(MapMetaData mapmd)
          Constructor to create a copy of the passed metadata.
 
Method Summary
 AbstractClassMetaData getKeyClassMetaData(ClassLoaderResolver clr, MetaDataManager mmgr)
          Convenience accessor for the Key ClassMetaData.
 java.lang.String getKeyType()
          Accessor for the key-type tag value.
 MapMetaData.MapType getMapType()
           
 AbstractClassMetaData getValueClassMetaData(ClassLoaderResolver clr, MetaDataManager mmgr)
          Convenience accessor for the Value ClassMetaData
 java.lang.String getValueType()
          Accessor for the value-type tag value.
 boolean isDependentKey()
          Accessor for the dependent-key attribute indicates that the map's key contains references that are to be deleted if the referring instance is deleted.
 boolean isDependentValue()
          Accessor for the dependent-value attribute indicates that the map's value contains references that are to be deleted if the referring instance is deleted.
 boolean isEmbeddedKey()
          Accessor for the embedded-key tag value.
 boolean isEmbeddedValue()
          Accessor for the embedded-value tag value.
 boolean isSerializedKey()
          Accessor for the serialized-key tag value.
 boolean isSerializedValue()
          Accessor for the serialized-value tag value.
 boolean keyIsPersistent()
           
 void populate(ClassLoaderResolver clr, java.lang.ClassLoader primary, MetaDataManager mmgr)
          Method to populate any defaults, and check the validity of the MetaData.
 MapMetaData setDependentKey(boolean dependent)
           
 MapMetaData setDependentKey(java.lang.String dependent)
           
 MapMetaData setDependentValue(boolean dependent)
           
 MapMetaData setDependentValue(java.lang.String dependent)
           
 MapMetaData setEmbeddedKey(boolean embedded)
           
 MapMetaData setEmbeddedKey(java.lang.String embedded)
           
 MapMetaData setEmbeddedValue(boolean embedded)
           
 MapMetaData setEmbeddedValue(java.lang.String embedded)
           
 MapMetaData setKeyType(java.lang.String type)
           
 MapMetaData setSerializedKey(boolean serialized)
           
 MapMetaData setSerializedKey(java.lang.String serialized)
           
 MapMetaData setSerializedValue(boolean serialized)
           
 MapMetaData setSerializedValue(java.lang.String serialized)
           
 MapMetaData setValueType(java.lang.String type)
           
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object.
 boolean valueIsPersistent()
           
 
Methods inherited from class org.datanucleus.metadata.ContainerMetaData
getFieldName, getMemberMetaData
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mapType

protected MapMetaData.MapType mapType
Type of map.


key

protected org.datanucleus.metadata.ContainerComponent key
Representation of the key of the map.


value

protected org.datanucleus.metadata.ContainerComponent value
Representation of the value of the map.

Constructor Detail

MapMetaData

public MapMetaData(MapMetaData mapmd)
Constructor to create a copy of the passed metadata.

Parameters:
mapmd - The metadata to copy

MapMetaData

public MapMetaData()
Default constructor. Set the fields using setters, before populate().

Method Detail

populate

public void populate(ClassLoaderResolver clr,
                     java.lang.ClassLoader primary,
                     MetaDataManager mmgr)
Method to populate any defaults, and check the validity of the MetaData.

Parameters:
clr - ClassLoaderResolver to use for loading any key/value types
primary - the primary ClassLoader to use (or null)
mmgr - MetaData manager

getMapType

public MapMetaData.MapType getMapType()

getKeyType

public java.lang.String getKeyType()
Accessor for the key-type tag value. May be comma-separated if several key types are possible.

Returns:
key-type tag value

getKeyClassMetaData

public AbstractClassMetaData getKeyClassMetaData(ClassLoaderResolver clr,
                                                 MetaDataManager mmgr)
Convenience accessor for the Key ClassMetaData.

Parameters:
clr - ClassLoader resolver (in case we need to initialise it)
mmgr - MetaData manager (in case we need to initialise it)
Returns:
key ClassMetaData

keyIsPersistent

public boolean keyIsPersistent()

getValueType

public java.lang.String getValueType()
Accessor for the value-type tag value. May be comma-separated if several value types are possible.

Returns:
value-type tag value

getValueClassMetaData

public AbstractClassMetaData getValueClassMetaData(ClassLoaderResolver clr,
                                                   MetaDataManager mmgr)
Convenience accessor for the Value ClassMetaData

Parameters:
clr - ClassLoader resolver (in case we need to initialise it)
mmgr - MetaData manager (in case we need to initialise it)
Returns:
value ClassMetaData

valueIsPersistent

public boolean valueIsPersistent()

isEmbeddedKey

public boolean isEmbeddedKey()
Accessor for the embedded-key tag value.

Returns:
embedded-key tag value

isEmbeddedValue

public boolean isEmbeddedValue()
Accessor for the embedded-value tag value.

Returns:
embedded-value tag value

isSerializedKey

public boolean isSerializedKey()
Accessor for the serialized-key tag value.

Returns:
serialized-key tag value

isSerializedValue

public boolean isSerializedValue()
Accessor for the serialized-value tag value.

Returns:
serialized-value tag value

isDependentKey

public boolean isDependentKey()
Accessor for the dependent-key attribute indicates that the map's key contains references that are to be deleted if the referring instance is deleted.

Returns:
dependent-key tag value

isDependentValue

public boolean isDependentValue()
Accessor for the dependent-value attribute indicates that the map's value contains references that are to be deleted if the referring instance is deleted.

Returns:
dependent-value tag value

setKeyType

public MapMetaData setKeyType(java.lang.String type)

setEmbeddedKey

public MapMetaData setEmbeddedKey(java.lang.String embedded)

setEmbeddedKey

public MapMetaData setEmbeddedKey(boolean embedded)

setSerializedKey

public MapMetaData setSerializedKey(java.lang.String serialized)

setSerializedKey

public MapMetaData setSerializedKey(boolean serialized)

setDependentKey

public MapMetaData setDependentKey(java.lang.String dependent)

setDependentKey

public MapMetaData setDependentKey(boolean dependent)

setValueType

public MapMetaData setValueType(java.lang.String type)

setEmbeddedValue

public MapMetaData setEmbeddedValue(java.lang.String embedded)

setEmbeddedValue

public MapMetaData setEmbeddedValue(boolean embedded)

setSerializedValue

public MapMetaData setSerializedValue(java.lang.String serialized)

setSerializedValue

public MapMetaData setSerializedValue(boolean serialized)

setDependentValue

public MapMetaData setDependentValue(java.lang.String dependent)

setDependentValue

public MapMetaData setDependentValue(boolean dependent)

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object.

Overrides:
toString in class MetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © 2010. All Rights Reserved.