org.jpox.metadata
Class InterfaceMetaData

java.lang.Object
  extended byorg.jpox.metadata.MetaData
      extended byorg.jpox.metadata.ExtendableMetaData
          extended byorg.jpox.metadata.AbstractClassMetaData
              extended byorg.jpox.metadata.InterfaceMetaData
All Implemented Interfaces:
java.io.Serializable

public class InterfaceMetaData
extends AbstractClassMetaData

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

MetaData Element

The MetaData Element represented here is as follows
 <!ELEMENT interface (extension*, datastore-identity?, inheritance?, version?, join*, foreign-key*, index*, 
                      unique*, property*, query*, fetch-group*, extension*)>
 <!ATTLIST interface name CDATA #REQUIRED>
 <!ATTLIST interface catalog CDATA #IMPLIED>
 <!ATTLIST interface schema CDATA #IMPLIED>
 <!ATTLIST interface table CDATA #IMPLIED>
 <!ATTLIST interface identity-type (datastore|application|nondurable) #IMPLIED>
 <!ATTLIST interface objectid-class CDATA #IMPLIED>
 <!ATTLIST interface requires-extent (true|false) 'true'>
 <!ATTLIST interface detachable (true|false) 'false'>
 

Since:
1.1
Version:
$Revision: 1.17 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jpox.metadata.AbstractClassMetaData
allFieldNumbers, catalog, defaultFetchGroupFieldFlags, defaultFetchGroupFieldNumbers, detachable, embeddedOnly, fetchGroupMetaData, fetchGroupMetaDataByName, fetchGroups, fieldNumbersByName, foreignKeyMetaData, foreignKeys, fullName, identityMetaData, identitySpecified, identityType, indexes, indexMetaData, inheritanceMetaData, joinMetaData, joins, managedFields, name, nonPrimaryKeyFieldFlags, nonPrimaryKeyFieldNumbers, noOfInheritedManagedFields, objectidClass, overriddenFields, pcSuperclassMetaData, persistenceCapableFieldNumbers, persistenceCapableSuperclass, persistenceModifier, persistentInterfaceImplNeedingTableFromSubclass, persistentInterfaceImplNeedingTableFromSuperclass, primaryKeyFieldNumbers, primaryKeyMetaData, properties, propertyMetaData, queries, requiresExtent, schema, secondClassMutableFieldFlags, secondClassMutableFieldNumbers, table, uniqueConstraints, uniqueMetaData, unmappedColumns, usesSingleFieldIdentityClass, versionMetaData
 
Fields inherited from class org.jpox.metadata.ExtendableMetaData
extensions, JPOX_VENDOR_NAME
 
Fields inherited from class org.jpox.metadata.MetaData
LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent
 
Constructor Summary
InterfaceMetaData(PackageMetaData parent, java.lang.String name, java.lang.String identityType, java.lang.String objectidClass, java.lang.String requiresExtent, java.lang.String detachable, java.lang.String embeddedOnly, java.lang.String catalog, java.lang.String schema, java.lang.String table)
          Constructor.
 
Method Summary
 void initialise()
          Method to initialise the object, creating internal convenience arrays.
protected  PropertyMetaData newDefaultedProperty(java.lang.String name)
          Utility to add a defaulted PropertyMetaData to the class.
 void populate(ClassLoaderResolver clr)
          Method to provide the details of the class being represented by this MetaData.
protected  void populatePropertyMetaData(ClassLoaderResolver clr, java.lang.Class cls)
          Populate PropertyMetaData
 java.lang.String toString()
          Returns a string representation of the object.
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object.
 
Methods inherited from class org.jpox.metadata.AbstractClassMetaData
addFetchGroup, addForeignKey, addIndex, addJoin, addPropertiesNotInMetaData, addProperty, addQuery, addUniqueConstraint, addUnmappedColumn, checkInitialised, checkPopulated, copyFieldsFromInterface, determineIdentity, determineInheritanceMetaData, determineObjectIdClass, determineSuperClassName, getAbsoluteFieldNumberForRelativeFieldNumber, getAllFieldNumbers, getBaseAbstractClassMetaData, getCatalog, getDefaultFetchGroupFieldFlags, getDefaultFetchGroupFieldNumbers, getDiscriminatorStrategy, getFetchGroupMetaData, getFetchGroupMetaData, getFetchGroupMetaData, getField, getField, getFieldNumber, getFieldNumberAbsolute, getFieldNumberAbsolute, getForeignKeyMetaData, getFullClassName, getIdentityMetaData, getIdentityType, getIndexMetaData, getInheritanceMetaData, getJoinMetaData, getManagedField, getManagedFieldAbsolute, getManagedFieldAbsoluteInternal, getManagedFields, getMetaDataManager, getName, getNonPrimaryKeyFieldFlags, getNonPrimaryKeyFieldNumbers, getNoOfFields, getNoOfInheritedManagedFields, getNoOfManagedFields, getNoOfOverriddenFields, getNoOfPrimaryKeyFields, getNoOfProperties, getNoOfQueries, getObjectidClass, getOverriddenField, getOverriddenField, getOverriddenFields, getPackageMetaData, getPackageName, getPersistenceCapableFieldNumbers, getPersistenceCapableSuperclass, getPersistenceModifier, getPrimaryKeyFieldNumbers, getPrimaryKeyMetaData, getQuery, getSchema, getSecondClassMutableFieldFlags, getSecondClassMutableFieldNumbers, getSuperAbstractClassMetaData, getTable, getUniqueMetaData, getUnmappedColumns, getVersionMetaData, hasField, inheritDetachableSettings, inheritIdentity, isDetachable, isEmbeddedOnly, isRequiresExtent, isSameOrAncestorOf, loadClass, mergeORMData, setIdentityMetaData, setInheritanceMetaData, setPrimaryKeyMetaData, setTable, setVersionMetaData, usesSingleFieldIdentityClass, validateDeprecatedMetaData, validateUserInputForIdentity, validateUserInputForInheritanceMetaData
 
Methods inherited from class org.jpox.metadata.ExtendableMetaData
addExtension, addExtension, getExtension, getExtensions, getNoOfExtensions, getValueForExtension, getValuesForExtension, getValuesForExtensionStartingWith, hasExtension, removeExtension
 
Methods inherited from class org.jpox.metadata.MetaData
getParent, isCreated, isInitialised, isPopulated, isUsed, populate, setInitialised, setPopulated, setUsed
 
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,
                         java.lang.String identityType,
                         java.lang.String objectidClass,
                         java.lang.String requiresExtent,
                         java.lang.String detachable,
                         java.lang.String embeddedOnly,
                         java.lang.String catalog,
                         java.lang.String schema,
                         java.lang.String table)
Constructor. Takes the basic string information found in the MetaData file.

Parameters:
parent - The package to which this class belongs
name - Name of class
identityType - Type of identity
objectidClass - Class of the object id
requiresExtent - Whether the class requires an extent
detachable - Whether this is detachable
embeddedOnly - embedded-only tag
catalog - Name for catalog
schema - Name for schema
table - Name of the table where to persist objects of this type
Method Detail

initialise

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

Overrides:
initialise in class AbstractClassMetaData

populate

public void populate(ClassLoaderResolver clr)
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 specifed 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 AbstractPropertyMetaData 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

newDefaultedProperty

protected PropertyMetaData 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 (e.g JDOConfigClass can create a JDOConfigField)

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

populatePropertyMetaData

protected void populatePropertyMetaData(ClassLoaderResolver clr,
                                        java.lang.Class cls)
Populate PropertyMetaData

Overrides:
populatePropertyMetaData in class AbstractClassMetaData
Parameters:
clr - The ClassLoader
cls - This class
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

toString

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

Overrides:
toString in class ExtendableMetaData
Returns:
a string representation of the object.

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 ExtendableMetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © -2007 . All Rights Reserved.