org.datanucleus.metadata
Class InterfaceMetaData

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

public class InterfaceMetaData
extends AbstractClassMetaData

Representation of the MetaData of a "persistent-interface".

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.datanucleus.metadata.AbstractClassMetaData
allMemberPositions, cacheable, catalog, detachable, dfgMemberFlags, dfgMemberPositions, embeddedOnly, entityName, excludeDefaultListeners, excludeSuperClassListeners, fetchGroupMetaData, fetchGroupMetaDataByName, fetchGroupMetaWithPostLoad, fetchGroups, foreignKeyMetaData, foreignKeys, fullName, GENERATED_PK_SUFFIX, identityMetaData, identitySpecified, identityType, implementationOfPersistentDefinition, indexes, indexMetaData, inheritanceMetaData, joinMetaData, joins, listeners, LOCALISER_API, managedMembers, memberCount, memberPositionsByName, members, metaDataComplete, name, nonPkMemberFlags, nonPkMemberPositions, noOfInheritedManagedMembers, objectidClass, overriddenMembers, pcSuperclassMetaData, persistenceCapableSuperclass, persistenceModifier, persistentInterfaceImplNeedingTableFromSubclass, persistentInterfaceImplNeedingTableFromSuperclass, pkMemberPositions, primaryKeyMetaData, queries, queryResultMetaData, relationPositions, requiresExtent, schema, scoMutableMemberFlags, scoMutableMemberPositions, scoNonContainerMemberPositions, secondClassContainerMemberPositions, serializeRead, table, uniqueConstraints, uniqueMetaData, unmappedColumns, usesSingleFieldIdentityClass, versionMetaData
 
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
InterfaceMetaData(PackageMetaData parent, java.lang.String name)
          Constructor.
 
Method Summary
protected  void addMetaDataForMembersNotInMetaData(java.lang.Class cls)
          Add MetaData for properties of the interface not declared in MetaData.
 void initialise(ClassLoaderResolver clr, MetaDataManager mmgr)
          Method to initialise the object, creating internal convenience arrays.
protected  AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
          Utility to add a defaulted PropertyMetaData to the class.
 void populate(ClassLoaderResolver clr, java.lang.ClassLoader primary, MetaDataManager mmgr)
          Method to provide the details of the class being represented by this MetaData.
protected  void populatePropertyMetaData(ClassLoaderResolver clr, java.lang.Class cls, boolean pkFields, java.lang.ClassLoader primary, MetaDataManager mmgr)
          Populate PropertyMetaData.
 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.AbstractClassMetaData
addFetchGroup, addForeignKey, addIndex, addJoin, addListener, addMember, addQuery, addQueryResultMetaData, addUniqueConstraint, addUnmappedColumn, applyDefaultDiscriminatorValueWhenNotSpecified, checkInitialised, checkNotYetPopulated, checkPopulated, copyMembersFromInterface, determineIdentity, determineInheritanceMetaData, determineObjectIdClass, determineSuperClassName, excludeDefaultListeners, excludeSuperClassListeners, getAbsoluteMemberPositionForRelativePosition, getAbsolutePositionOfMember, getAbsolutePositionOfMember, getAllMemberPositions, getBaseAbstractClassMetaData, getBaseIdentityMetaData, getBaseInheritanceStrategy, getBasicMemberPositions, getBidirectionalRelationMemberPositions, getCatalog, getDFGMemberFlags, getDFGMemberPositions, getDiscriminatorMetaData, getDiscriminatorMetaDataForTable, getDiscriminatorStrategy, getDiscriminatorStrategyForTable, getEntityName, getFetchGroupMetaData, getFetchGroupMetaData, getFetchGroupMetaData, getForeignKeyMetaData, getFullClassName, getIdentityMetaData, getIdentityType, getIndexMetaData, getInheritanceMetaData, getJoinMetaData, getListenerForClass, getListeners, getManagedMembers, getMemberBeingOverridden, getMemberCount, getMetaDataForManagedMemberAtAbsolutePosition, getMetaDataForManagedMemberAtAbsolutePositionInternal, getMetaDataForManagedMemberAtPosition, getMetaDataForMember, getMetaDataForMemberAtRelativePosition, getMultivaluedMemberPositions, getName, getNonPKMemberFlags, getNonPKMemberPositions, getNoOfInheritedManagedMembers, getNoOfManagedMembers, getNoOfMembers, getNoOfOverriddenMembers, getNoOfPrimaryKeyMembers, getNoOfQueries, getObjectidClass, getOverriddenMember, getOverriddenMember, getOverriddenMembers, getPackageMetaData, getPackageName, getPersistenceCapableSuperclass, getPersistenceModifier, getPKMemberPositions, getPrimaryKeyMemberNames, getPrimaryKeyMetaData, getQueries, getQueryResultMetaData, getRelationMemberPositions, getRelativePositionOfMember, getSchema, getSCOContainerMemberPositions, getSCOMutableMemberFlags, getSCOMutableMemberPositions, getSCONonContainerMemberPositions, getSuperAbstractClassMetaData, getTable, getUniqueMetaData, getUnmappedColumns, getVersionMetaData, getVersionMetaDataForClass, getVersionMetaDataForTable, hasDiscriminatorStrategy, hasFetchGroupWithPostLoad, hasMember, hasRelations, hasVersionStrategy, inheritIdentity, initialiseMemberPositionInformation, isCacheable, isDescendantOf, isDetachable, isEmbeddedOnly, isExcludeDefaultListeners, isExcludeSuperClassListeners, isImplementationOfPersistentDefinition, isMetaDataComplete, isRequiresExtent, isSameOrAncestorOf, isSerializeRead, loadClass, newFetchGroupMetaData, newFieldMetadata, newForeignKeyMetadata, newIdentityMetadata, newIndexMetadata, newInheritanceMetadata, newJoinMetaData, newPrimaryKeyMetadata, newPropertyMetadata, newQueryMetadata, newUniqueMetadata, newUnmappedColumnMetaData, newVersionMetadata, setCacheable, setCacheable, setCatalog, setDetachable, setDetachable, setEmbeddedOnly, setEmbeddedOnly, setEntityName, setIdentityMetaData, setIdentityType, setInheritanceMetaData, setMetaDataComplete, setObjectIdClass, setPersistenceCapableSuperclass, setPersistenceModifier, setPrimaryKeyMetaData, setRequiresExtent, setRequiresExtent, setSchema, setSerializeRead, setTable, setVersionMetaData, usesSingleFieldIdentityClass, validateObjectIdClass, validateUnmappedColumns, validateUserInputForIdentity, validateUserInputForInheritanceMetaData
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterfaceMetaData

public InterfaceMetaData(PackageMetaData parent,
                         java.lang.String name)
Constructor. Takes the basic string information found in the MetaData file.

Parameters:
parent - The package to which this class belongs
name - Name of class
Method Detail

initialise

public void initialise(ClassLoaderResolver clr,
                       MetaDataManager mmgr)
Method to initialise the object, creating internal convenience arrays. Initialises all sub-objects. If populate() is going to be used it should be used BEFORE calling this method.

Specified by:
initialise in class AbstractClassMetaData
Parameters:
clr - ClassLoader resolver
mmgr - MetaData manager

populate

public void populate(ClassLoaderResolver clr,
                     java.lang.ClassLoader primary,
                     MetaDataManager mmgr)
Method to provide the details of the class being represented by this MetaData. This can be used to firstly provide defaults for attributes that aren't specified in the MetaData, and secondly to report any errors with attributes that have been specified that are inconsistent with the class being represented.

One possible use of this method would be to take a basic ClassMetaData for a class and call this, passing in the users class. This would then add AbstractMemberMetaData for all fields in this class providing defaults for all of these.

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

newDefaultedProperty

protected AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
Utility to add a defaulted PropertyMetaData to the class. Provided as a method since then any derived classes can override it.

Overrides:
newDefaultedProperty in class AbstractClassMetaData
Parameters:
name - name of field
Returns:
the new PropertyMetaData

populatePropertyMetaData

protected void populatePropertyMetaData(ClassLoaderResolver clr,
                                        java.lang.Class cls,
                                        boolean pkFields,
                                        java.lang.ClassLoader primary,
                                        MetaDataManager mmgr)
Populate PropertyMetaData.

Parameters:
clr - The ClassLoader
cls - This class
pkFields - Process pk fields (or non-PK fields if false)
primary - the primary ClassLoader to use (or null)
mmgr - MetaData manager
Throws:
InvalidMetaDataException - if the Class for a declared type in a field cannot be loaded by the clr
InvalidMetaDataException - if a field declared in the MetaData does not exist in the Class

addMetaDataForMembersNotInMetaData

protected void addMetaDataForMembersNotInMetaData(java.lang.Class cls)
Add MetaData for properties of the interface not declared in MetaData.

Parameters:
cls - Class represented by this metadata

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object. This can be used as part of a facility to output a MetaData file.

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


Copyright © 2011. All Rights Reserved.