org.datanucleus.metadata
Class ArrayMetaData

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

public class ArrayMetaData
extends ContainerMetaData

Representation of the Meta-Data for an Array.

See Also:
Serialized Form

Field Summary
protected  org.datanucleus.metadata.ContainerComponent element
          Representation of the element of the array.
protected  boolean mayContainPersistenceCapableElements
          wether this array may contain PersistenceCapable elements
 
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
ArrayMetaData()
          Default constructor.
ArrayMetaData(ArrayMetaData arrmd)
          Constructor to create a copy of the passed metadata.
 
Method Summary
 boolean elementIsPersistent()
           
 AbstractClassMetaData getElementClassMetaData(ClassLoaderResolver clr, MetaDataManager mmgr)
          Convenience accessor for the Element ClassMetaData.
 java.lang.String getElementType()
          Accessor for the element implementation types (when element is a reference type).
 boolean isDependentElement()
          Accessor for The dependent-element attribute indicates that the collection's element contains a reference that is to be deleted if the referring instance is deleted.
 boolean isEmbeddedElement()
          Accessor for the embedded-element value
 boolean isSerializedElement()
          Accessor for the serialized-element tag value
 boolean mayContainPersistenceCapableElements()
          Returns whether this array may contain PersistenceCapable elements (as indicated by the user).
 void populate(ClassLoaderResolver clr, java.lang.ClassLoader primary, MetaDataManager mmgr)
          Method to populate any defaults, and check the validity of the MetaData.
 ArrayMetaData setDependentElement(boolean dependent)
           
 ArrayMetaData setDependentElement(java.lang.String dependent)
           
 ArrayMetaData setElementType(java.lang.String type)
           
 ArrayMetaData setEmbeddedElement(boolean embedded)
           
 ArrayMetaData setEmbeddedElement(java.lang.String embedded)
           
 ArrayMetaData setSerializedElement(boolean serialized)
           
 ArrayMetaData setSerializedElement(java.lang.String serialized)
           
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object.
 
Methods inherited from class org.datanucleus.metadata.ContainerMetaData
allowNulls, 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

element

protected org.datanucleus.metadata.ContainerComponent element
Representation of the element of the array.


mayContainPersistenceCapableElements

protected boolean mayContainPersistenceCapableElements
wether this array may contain PersistenceCapable elements

Constructor Detail

ArrayMetaData

public ArrayMetaData(ArrayMetaData arrmd)
Constructor to create a copy of the passed metadata.

Parameters:
arrmd - The metadata to copy

ArrayMetaData

public ArrayMetaData()
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.

Overrides:
populate in class ContainerMetaData
Parameters:
clr - ClassLoaderResolver to use in loading any classes
primary - the primary ClassLoader to use (or null)
mmgr - MetaData manager

getElementType

public java.lang.String getElementType()
Accessor for the element implementation types (when element is a reference type). The return can contain comma-separated values.

Returns:
element implementation types

elementIsPersistent

public boolean elementIsPersistent()

getElementClassMetaData

public AbstractClassMetaData getElementClassMetaData(ClassLoaderResolver clr,
                                                     MetaDataManager mmgr)
Convenience accessor for the Element ClassMetaData.

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

mayContainPersistenceCapableElements

public boolean mayContainPersistenceCapableElements()
Returns whether this array may contain PersistenceCapable elements (as indicated by the user). TODO Remove this. The element-type of the array defines such things and this is not the solution

Returns:
whether this array may contain PersistenceCapable elements

isEmbeddedElement

public boolean isEmbeddedElement()
Accessor for the embedded-element value

Returns:
embedded-element value

isSerializedElement

public boolean isSerializedElement()
Accessor for the serialized-element tag value

Returns:
serialized-element tag value

isDependentElement

public boolean isDependentElement()
Accessor for The dependent-element attribute indicates that the collection's element contains a reference that is to be deleted if the referring instance is deleted.

Returns:
dependent-element tag value

setElementType

public ArrayMetaData setElementType(java.lang.String type)

setEmbeddedElement

public ArrayMetaData setEmbeddedElement(java.lang.String embedded)

setEmbeddedElement

public ArrayMetaData setEmbeddedElement(boolean embedded)

setSerializedElement

public ArrayMetaData setSerializedElement(java.lang.String serialized)

setSerializedElement

public ArrayMetaData setSerializedElement(boolean serialized)

setDependentElement

public ArrayMetaData setDependentElement(java.lang.String dependent)

setDependentElement

public ArrayMetaData setDependentElement(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 - The prefix string
indent - The indent string
Returns:
a string representation of the object.


Copyright © 2011. All Rights Reserved.