Methods Summary |
---|
public final int | getClassModifiers(java.lang.String classname)Gets the access modifier of a class.
JDOClass clazz = getJDOClass (classname);
return (clazz != null ? clazz.getModifiers () : 0);
|
public int | getFieldFlags(java.lang.String classPath, java.lang.String fieldName)
if (!isManagedField(classPath, fieldName)) {
affirm(!isTransactionalField(classPath, fieldName));
affirm(!isPersistentField(classPath, fieldName));
affirm(!isKeyField(classPath, fieldName));
affirm(!isDefaultFetchGroupField(classPath, fieldName));
return 0;
}
//affirm(isManagedField(classPath, fieldName));
if (isTransactionalField(classPath, fieldName)) {
affirm(!isPersistentField(classPath, fieldName));
affirm(!isKeyField(classPath, fieldName));
// ignore any dfg membership of transactional fields
//affirm(!isDefaultFetchGroupField(classPath, fieldName));
return CHECK_WRITE;
}
//affirm(!isTransactionalField(classPath, fieldName));
affirm(isPersistentField(classPath, fieldName));
if (isKeyField(classPath, fieldName)) {
// ignore any dfg membership of key fields
//affirm(!isDefaultFetchGroupField(classPath, fieldName));
return MEDIATE_WRITE;
}
//affirm(!isKeyField(classPath, fieldName));
if (isDefaultFetchGroupField(classPath, fieldName)) {
return CHECK_READ | CHECK_WRITE;
}
//affirm(!isDefaultFetchGroupField(classPath, fieldName));
return MEDIATE_READ | MEDIATE_WRITE;
|
public int[] | getFieldFlags(java.lang.String classPath, java.lang.String[] fieldNames)
final int n = (fieldNames != null ? fieldNames.length : 0);
final int[] flags = new int[n];
for (int i = 0; i < n; i++) {
flags[i] = getFieldFlags(classPath, fieldNames[i]);
}
return flags;
|
public final int | getFieldModifiers(java.lang.String classname, java.lang.String fieldname)Gets the access modifier of a field.
JDOField field = getJDOField (classname, fieldname);
return (field != null ? field.getModifiers () : 0);
|
public int | getFieldNo(java.lang.String classPath, java.lang.String fieldName)Returns the unique field index of a declared, persistent field of a
class.
JDOClass clazz = getJDOClass (classPath);
return (clazz != null ? clazz.getIndexOfField (fieldName) : -1);
|
public int[] | getFieldNo(java.lang.String classPath, java.lang.String[] fieldNames)
final int n = (fieldNames != null ? fieldNames.length : 0);
final int[] flags = new int[n];
for (int i = 0; i < n; i++) {
flags[i] = getFieldNo(classPath, fieldNames[i]);
}
return flags;
|
public final java.lang.String | getFieldType(java.lang.String classname, java.lang.String fieldname)
JDOField field = getJDOField (classname, fieldname);
return (field != null ? field.getType () : null);
|
public final java.lang.String[] | getFieldType(java.lang.String classname, java.lang.String[] fieldnames)
final int n = (fieldnames != null ? fieldnames.length : 0);
final String[] types = new String[n];
for (int i = 0; i < n; i++) {
types[i] = getFieldType(classname, fieldnames[i]);
}
return types;
|
private final com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataProperties.JDOClass | getJDOClass(java.lang.String classname)
return this.properties.getJDOClass (classname);
|
private final com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataProperties.JDOField | getJDOField(java.lang.String classname, java.lang.String fieldname)
JDOClass clazz = getJDOClass (classname);
return (clazz != null ? clazz.getField (fieldname) : null);
|
public java.lang.String | getKeyClass(java.lang.String classPath)
final JDOClass clazz = getJDOClass(classPath);
return (clazz != null ? clazz.getOidClassName() : null);
|
public java.lang.String[] | getKeyFields(java.lang.String classPath)
final List keys = new ArrayList();
final String[] fieldNames = getManagedFields(classPath);
final int n = fieldNames.length;
for (int i = 0; i < n; i++) {
if (isKeyField(classPath, fieldNames[i])) {
keys.add(fieldNames[i]);
}
}
return (String[])keys.toArray(new String[keys.size()]);
|
public final java.lang.String[] | getKnownClasses()No interface method.
return this.properties.getKnownClassNames ();
|
public final java.lang.String[] | getKnownFields(java.lang.String classname)Gets all known fields of a class.
JDOClass clazz = getJDOClass (classname);
return (clazz != null ? clazz.getFields () : new String [] {});
|
public java.lang.String[] | getManagedFields(java.lang.String classname)Returns an array of field names of all declared, persistent fields
of a class.
JDOClass clazz = getJDOClass (classname);
return (clazz != null ? clazz.getManagedFieldNames () : new String [] {});
|
public java.lang.String | getPersistenceCapableRootClass(java.lang.String classPath)Returns the name of the persistence-capable root class of a class.
//^olsen: exchange dummy implementation
return (isPersistenceCapableClass(classPath) ? classPath : null);
|
public java.lang.String | getPersistenceCapableSuperClass(java.lang.String classPath)
for (String clazz = getSuperClass(classPath);
clazz != null;
clazz = getSuperClass(clazz)) {
if (isPersistenceCapableClass(clazz)) {
return clazz;
}
}
return null;
|
public final java.lang.String | getSuperClass(java.lang.String classname)Returns the superclass of a class.
JDOClass clazz = getJDOClass (classname);
return (clazz != null ? clazz.getSuperClassName () : null);
|
public java.lang.String | getSuperKeyClass(java.lang.String classPath)
for (String superClass = getPersistenceCapableSuperClass(classPath);
superClass != null;
superClass = getPersistenceCapableSuperClass(superClass)) {
final String superKeyClass = getKeyClass(superClass);
if (superKeyClass != null) {
return superKeyClass;
}
}
return null;
|
public boolean | isDefaultFetchGroupField(java.lang.String classPath, java.lang.String fieldName)Tests whether a field of a class is known to be part of the
Default Fetch Group.
JDOField field = getJDOField (classPath, fieldName);
return (field != null ? field.isInDefaultFetchGroup () : false);
|
public boolean | isKeyField(java.lang.String classPath, java.lang.String fieldName)
final JDOField field = getJDOField(classPath, fieldName);
return (field != null ? field.isPk() : false);
|
public boolean | isKnownNonManagedField(java.lang.String classPath, java.lang.String fieldName, java.lang.String fieldSig)
final JDOClass clazz = getJDOClass(classPath);
if (clazz == null) {
return true;
}
final JDOField field = clazz.getField(fieldName);
return (field != null ? field.isKnownTransient() : false);
|
public boolean | isManagedField(java.lang.String classPath, java.lang.String fieldName)
return (isPersistentField(classPath, fieldName)
|| isTransactionalField(classPath, fieldName));
|
public boolean | isMutableSecondClassObjectType(java.lang.String classPath)Tests whether a type is known for Mutable Second Class Objects.
return mutableSecondClassObjectTypes.contains(classPath);
|
public boolean | isPersistenceCapableClass(java.lang.String classPath)Tests whether a class is known to be persistence-capable.
//check the transient prefixes
for (Iterator i = transientTypePrefixes.iterator(); i.hasNext();) {
final String typePrefix = (String)i.next();
if (classPath.startsWith(typePrefix))
return false;
}
JDOClass clazz = getJDOClass (classPath);
return (clazz != null ? clazz.isPersistent () : false);
|
public boolean | isPersistenceCapableRootClass(java.lang.String classPath)Tests whether a class is known as a persistence-capable root class.
//@lars
if ( ! isPersistenceCapableClass (classPath))
{
return false;
}
String superclass = getSuperClass (classPath);
return (superclass != null ? ! isPersistenceCapableClass (superclass) : true);
//^olsen: exchange dummy implementation
// return isPersistenceCapableClass(classPath);
|
public boolean | isPersistentField(java.lang.String classPath, java.lang.String fieldName)Tests whether a field of a class is known to be persistent.
JDOField field = getJDOField (classPath, fieldName);
return (field != null ? field.isPersistent () : false);
|
public boolean | isPrimaryKeyField(java.lang.String classPath, java.lang.String fieldName)Tests whether a field of a class is known to be Primary Key.
JDOField field = getJDOField (classPath, fieldName);
return (field != null ? field.isPk () : false);
|
public boolean | isSecondClassObjectType(java.lang.String classPath)Tests whether a type is known for Second Class Objects.
return secondClassObjectTypes.contains(classPath);
|
public boolean | isTransactionalField(java.lang.String classPath, java.lang.String fieldName)Tests whether a field of a class is known to be transactional.
JDOField field = getJDOField (classPath, fieldName);
return (field != null ? field.isTransactional () : false);
|
public boolean | isTransientClass(java.lang.String classPath)
return ! isPersistenceCapableClass (classPath);
|
private final void | readProperties()
//read all classes
String [] classnames = this.properties.getKnownClassNames ();
for (int i = classnames.length - 1; i >= 0; i--)
{
JDOClass clazz = getJDOClass (classnames [i]); //should be always != null
//if the class is persistence it cannot be a second class object type
if (clazz.isPersistent () && secondClassObjectTypes.contains (clazz.getName ()))
{
throw new JDOMetaDataUserException ("ERROR: Parsing meta data properties: " +
"The persistent-capable class '" + clazz.getName () +
"' is second class object type.");
}
}
|