org.datanucleus.enhancer.bcel.metadata
Class BCELClassMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.AbstractClassMetaData
          extended by org.datanucleus.metadata.ClassMetaData
              extended by org.datanucleus.enhancer.bcel.metadata.BCELClassMetaData
All Implemented Interfaces:
java.io.Serializable

public class BCELClassMetaData
extends org.datanucleus.metadata.ClassMetaData

Extension of the standard ClassMetaData adding on attributes for enhancement of the class.

See Also:
Serialized Form

Field Summary
protected  org.apache.bcel.generic.ClassGen classGen
          BCEL class gen.
protected  org.apache.bcel.classfile.JavaClass enhanceClass
          Original BCEL java class.
protected static org.datanucleus.util.Localiser LOCALISER_ENH
           
 
Fields inherited from class org.datanucleus.metadata.ClassMetaData
implementations, implementsMetaData, isAbstractPersistenceCapable
 
Fields inherited from class org.datanucleus.metadata.AbstractClassMetaData
allMemberPositions, cacheable, catalog, detachable, dfgMemberFlags, dfgMemberPositions, embeddedOnly, entityName, excludeDefaultListeners, excludeSuperClassListeners, fetchGroupMetaData, fetchGroupMetaDataByName, fetchGroups, foreignKeyMetaData, foreignKeys, fullName, 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, 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
BCELClassMetaData(org.datanucleus.metadata.InterfaceMetaData imd, java.lang.String implClassName, org.apache.bcel.classfile.JavaClass enhanceClass)
          Constructor for creating the ClassMetaData for an implementation of a "persistent-interface".
BCELClassMetaData(org.datanucleus.metadata.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 modifier, java.lang.String persistenceCapableSuperclass, java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String entityName)
          Constructor.
 
Method Summary
protected  void copyMembersFromInterface(org.datanucleus.metadata.InterfaceMetaData imd)
          Convenience method to copy the fields from an existing interface
 org.datanucleus.metadata.AbstractMemberMetaData findField(org.apache.bcel.classfile.Field f)
          Find the specified field.
 org.datanucleus.metadata.AbstractMemberMetaData findProperty(org.apache.bcel.classfile.Field f)
          Find the specified property (getter/setter) for a java field Caters for the property being in this class, or in its superclass(es).
 org.apache.bcel.generic.ClassGen getClassGen()
          Return ClassGen instance of bcel
 org.apache.bcel.classfile.JavaClass getEnhanceClass()
          Return original JavaClass instance of bcel
protected  org.datanucleus.metadata.AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
          Utility to add a defaulted FieldMetaData to the class.
 
Methods inherited from class org.datanucleus.metadata.ClassMetaData
addImplements, addMetaDataForMembersNotInMetaData, getImplementsMetaData, implementsInterface, initialise, isAbstractPersistenceCapable, populate, populateMemberMetaData, toString
 
Methods inherited from class org.datanucleus.metadata.AbstractClassMetaData
addFetchGroup, addForeignKey, addIndex, addJoin, addListener, addMember, addQuery, addQueryResultMetaData, addUniqueConstraint, addUnmappedColumn, checkInitialised, checkPopulated, determineIdentity, determineInheritanceMetaData, determineObjectIdClass, determineSuperClassName, excludeDefaultListeners, excludeSuperClassListeners, getAbsoluteMemberPositionForRelativePosition, getAbsolutePositionOfMember, getAbsolutePositionOfMember, getAllMemberPositions, getBaseAbstractClassMetaData, getBaseIdentityMetaData, getBasicMemberPositions, getBidirectionalRelationMemberPositions, getCatalog, getDFGMemberFlags, getDFGMemberPositions, getDiscriminatorMetaDataForTable, getDiscriminatorStrategy, getEntityName, getFetchGroupMetaData, getFetchGroupMetaData, getFetchGroupMetaData, getForeignKeyMetaData, getFullClassName, getIdentityMetaData, getIdentityType, getIndexMetaData, getInheritanceMetaData, getJoinMetaData, getListenerForClass, getListeners, getManagedMembers, getMemberBeingOverridden, getMemberCount, getMetaDataForManagedMemberAtAbsolutePosition, getMetaDataForManagedMemberAtAbsolutePositionInternal, getMetaDataForManagedMemberAtPosition, getMetaDataForMember, getMetaDataForMemberAtRelativePosition, getMetaDataManager, 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, getVersionMetaDataForTable, hasDiscriminatorStrategy, hasMember, hasRelations, hasVersionStrategy, inheritDetachableSettings, inheritIdentity, initialiseMemberPositionInformation, isCacheable, isDetachable, isEmbeddedOnly, isExcludeDefaultListeners, isExcludeSuperClassListeners, isImplementationOfPersistentDefinition, isMetaDataComplete, isRequiresExtent, isSameOrAncestorOf, loadClass, setCacheable, setCatalog, setEmbeddedOnly, setIdentityMetaData, setIdentityType, setInheritanceMetaData, setMetaDataComplete, setObjectIdClass, setPrimaryKeyMetaData, setSchema, setTable, setVersionMetaData, usesSingleFieldIdentityClass, validateDeprecatedMetaData, validateObjectIdClass, validateUnmappedColumns, validateUserInputForIdentity, validateUserInputForInheritanceMetaData
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setInitialised, setParent, setPopulated, setUsed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALISER_ENH

protected static final org.datanucleus.util.Localiser LOCALISER_ENH

classGen

protected final org.apache.bcel.generic.ClassGen classGen
BCEL class gen.


enhanceClass

protected final org.apache.bcel.classfile.JavaClass enhanceClass
Original BCEL java class.

Constructor Detail

BCELClassMetaData

public BCELClassMetaData(org.datanucleus.metadata.InterfaceMetaData imd,
                         java.lang.String implClassName,
                         org.apache.bcel.classfile.JavaClass enhanceClass)
Constructor for creating the ClassMetaData for an implementation of a "persistent-interface".

Parameters:
imd - MetaData for the "persistent-interface"
implClassName - Name of the implementation class
enhanceClass - The enhanced class

BCELClassMetaData

public BCELClassMetaData(org.datanucleus.metadata.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 modifier,
                         java.lang.String persistenceCapableSuperclass,
                         java.lang.String catalog,
                         java.lang.String schema,
                         java.lang.String table,
                         java.lang.String entityName)
Constructor.

Method Detail

copyMembersFromInterface

protected void copyMembersFromInterface(org.datanucleus.metadata.InterfaceMetaData imd)
Convenience method to copy the fields from an existing interface

Overrides:
copyMembersFromInterface in class org.datanucleus.metadata.AbstractClassMetaData
Parameters:
imd - The class/interface that we copy from

newDefaultedProperty

protected org.datanucleus.metadata.AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
Utility to add a defaulted FieldMetaData to the class. Override the method in ClassMetaData because we want to add JDOConfigField type. This is called when using populate() and the class has a field that isn't in the MetaData.

Overrides:
newDefaultedProperty in class org.datanucleus.metadata.ClassMetaData
Parameters:
name - name of field

getClassGen

public org.apache.bcel.generic.ClassGen getClassGen()
Return ClassGen instance of bcel

Returns:
ClassGen instance of bcel

getEnhanceClass

public org.apache.bcel.classfile.JavaClass getEnhanceClass()
Return original JavaClass instance of bcel

Returns:
original JavaClass instance of bcel

findField

public org.datanucleus.metadata.AbstractMemberMetaData findField(org.apache.bcel.classfile.Field f)
Find the specified field. Caters for the field being in this class, or in its superclass(es).

Parameters:
f - The field
Returns:
The metadata for the field

findProperty

public org.datanucleus.metadata.AbstractMemberMetaData findProperty(org.apache.bcel.classfile.Field f)
Find the specified property (getter/setter) for a java field Caters for the property being in this class, or in its superclass(es).

Parameters:
f - The field
Returns:
The metadata for the property


Copyright © 2009. All Rights Reserved.