com.sun.jdo.api.persistence.enhancer.impl
Class ClassControl

java.lang.Object
  extended by com.sun.jdo.api.persistence.enhancer.util.Assertion
      extended by com.sun.jdo.api.persistence.enhancer.util.Support
          extended by com.sun.jdo.api.persistence.enhancer.impl.ClassControl

public final class ClassControl
extends Support

ClassControl acts as the primary handle for a class within the filter tool. ClassControl instances are typically accessed through various methods on Environment.


Field Summary
static int PersistAware
           
static int PersistCapable
           
static int PersistUnknown
           
static int TransientOnly
           
static int UpdateNew
           
static int UpdateNewer
           
static int UpdateNotNeeded
           
static int UpdateUnknown
           
 
Fields inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
timer
 
Constructor Summary
ClassControl(ClassFileSource theSource, ClassFile theFile, Environment env)
          Constructor
ClassControl(ClassFileSource theSource, Environment env)
          Constructor
 
Method Summary
 com.sun.jdo.api.persistence.enhancer.impl.ClassAction action()
          Get the ClassAction for this class
 void annotate()
          perform necessary annotation actions on the class
 boolean annotateable()
          Return true if the class is one which should be a candidate for annotation.
 void augment()
          Reparent class if needed
 ClassFile classFile()
          Get the ClassFile data structure for the class
 String className()
          Return the class name in VM form
 boolean filterRequired()
          Return true if filtering of the class is required.
 void noteUpdate()
          Record a modification of the class
static String packageOf(String vmName)
          Return the vm package name for the vm class name
 int persistType()
          Return the persistence type for this class
 String pkg()
          Return the vm package name for this class
 void requireUpdate()
          Mark the class as requiring update.
 void scan1()
          Note the class characteristics
 ClassFileSource source()
          Return the source of the class
 String sourceName()
          Return the name of the class source
 boolean updated()
          Return true if the classfile has been updated
static String userClassFromVMClass(String vmName)
          Return the class name in user ('.' delimited) form
 String userClassName()
          Return the class name in user ('.' delimited) form
static String vmClassFromUserClass(String userName)
          Return the class name in VM ('/' delimited) form
 void write(File destFile)
          Write the file.
 
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
getI18N, getI18N, getI18N, getI18N, getI18N, getI18N
 
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Assertion
affirm, affirm, affirm, affirm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TransientOnly

public static final int TransientOnly
See Also:
Constant Field Values

PersistUnknown

public static final int PersistUnknown
See Also:
Constant Field Values

PersistAware

public static final int PersistAware
See Also:
Constant Field Values

PersistCapable

public static final int PersistCapable
See Also:
Constant Field Values

UpdateNotNeeded

public static final int UpdateNotNeeded
See Also:
Constant Field Values

UpdateUnknown

public static final int UpdateUnknown
See Also:
Constant Field Values

UpdateNew

public static final int UpdateNew
See Also:
Constant Field Values

UpdateNewer

public static final int UpdateNewer
See Also:
Constant Field Values
Constructor Detail

ClassControl

public ClassControl(ClassFileSource theSource,
                    Environment env)
Constructor


ClassControl

public ClassControl(ClassFileSource theSource,
                    ClassFile theFile,
                    Environment env)
Constructor

Method Detail

updated

public boolean updated()
Return true if the classfile has been updated


noteUpdate

public void noteUpdate()
Record a modification of the class


classFile

public ClassFile classFile()
Get the ClassFile data structure for the class


persistType

public int persistType()
Return the persistence type for this class


filterRequired

public boolean filterRequired()
Return true if filtering of the class is required. This checks only whether the filtered version of the class is up to date w.r.t. its input class.


requireUpdate

public void requireUpdate()
Mark the class as requiring update.


annotateable

public boolean annotateable()
Return true if the class is one which should be a candidate for annotation.


action

public com.sun.jdo.api.persistence.enhancer.impl.ClassAction action()
Get the ClassAction for this class


scan1

public void scan1()
Note the class characteristics


augment

public void augment()
Reparent class if needed


annotate

public void annotate()
perform necessary annotation actions on the class


className

public String className()
Return the class name in VM form


userClassName

public String userClassName()
Return the class name in user ('.' delimited) form


userClassFromVMClass

public static String userClassFromVMClass(String vmName)
Return the class name in user ('.' delimited) form


vmClassFromUserClass

public static String vmClassFromUserClass(String userName)
Return the class name in VM ('/' delimited) form


pkg

public String pkg()
Return the vm package name for this class


packageOf

public static String packageOf(String vmName)
Return the vm package name for the vm class name


sourceName

public String sourceName()
Return the name of the class source


source

public ClassFileSource source()
Return the source of the class


write

public void write(File destFile)
           throws IOException,
                  FileNotFoundException
Write the file. If destination directory is non-null, write the file relative to that directory, else write it relative to its original location.

Throws:
IOException
FileNotFoundException


Copyright © 2012. All Rights Reserved.