Class Environment
- java.lang.Object
-
- com.sun.jdo.api.persistence.enhancer.util.Assertion
-
- com.sun.jdo.api.persistence.enhancer.util.Support
-
- com.sun.jdo.api.persistence.enhancer.impl.Environment
-
public final class Environment extends Support
Environment serves as a central collection for the options and working environment of the filter tool.
-
-
Constructor Summary
Constructors Constructor Description Environment()
The constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClass(ClassControl cc)
Add the class to the class mapping table.boolean
canFindClass(String className)
Look for the specified class in the class map.ArrayList
collectClasses()
Return an ArrayList of the ClassControls in classMap.ArrayList
collectClasses(int persistType)
Return a ArrayList of ClassControl objects which have the specified persistence typeFile
destinationDirectory()
boolean
doInitializerOptimization()
boolean
doThisOptimization()
boolean
doTimingStatistics()
void
error(String error)
int
errorCount()
void
excludeDestinationDirectory()
Update the class path to remove the destination directory if it is found in the class path.ClassControl
findClass(String className)
Look for the specified class in the class map.boolean
forceOverwrite()
ClassControl
getClass(String className)
Look for the specified class in the class map.Iterator
getClasses()
PrintWriter
getErrorWriter()
JDOMetaData
getJDOMetaData()
Is the class a well known persistent capable class? These are normally the java primitives.String
getLastErrorMessage()
PrintWriter
getOutputWriter()
boolean
isVerbose()
ClassControl
lookupClass(String className)
Look up the specified class in the class search path.ClassFileSource
lookupDestClass(String className)
Look for a class source using the destination directory as a root directory for the lookup which represents the annotated output for the class specified.void
message(String mess)
void
messageNL(String mess)
void
moveDestinationDirectoryToEnd()
Update the class path to move the destination directory to the end of the class path if it is found in the class path.void
reset()
Reset the environment.void
setDestinationDirectory(String dir)
void
setDoTimingStatistics(boolean dontOpt)
void
setErrorWriter(PrintWriter err)
void
setForceOverwrite(boolean forceOverwrite)
void
setJDOMetaData(JDOMetaData jdoMetaData)
void
setNoInitializerOptimization(boolean dontOpt)
void
setNoOptimization(boolean dontOpt)
void
setNoThisOptimization(boolean dontOpt)
void
setNoWrite(boolean dontWrite)
void
setOutputWriter(PrintWriter out)
void
setQuiet(boolean beQuiet)
void
setVerbose(boolean beVerbose)
void
suppressClassWarnings(String className)
Add a suppression entry for a classvoid
suppressFieldWarnings(String fullFieldName)
Add a suppression entry for a field of a classboolean
updateInPlace()
void
warning(String warn)
void
warning(String warn, String classname)
void
warning(String warn, String classname, String fieldname)
boolean
writeClasses()
Expected dump levels are 0, 1, 2, 3 dump level 0 is always on.-
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
getI18N, getI18N, getI18N, getI18N, getI18N, getI18N
-
-
-
-
Method Detail
-
setDoTimingStatistics
public void setDoTimingStatistics(boolean dontOpt)
-
doTimingStatistics
public boolean doTimingStatistics()
-
error
public void error(String error)
-
warning
public void warning(String warn)
-
message
public void message(String mess)
-
messageNL
public void messageNL(String mess)
-
errorCount
public int errorCount()
-
getLastErrorMessage
public final String getLastErrorMessage()
-
forceOverwrite
public boolean forceOverwrite()
-
updateInPlace
public boolean updateInPlace()
-
destinationDirectory
public File destinationDirectory()
-
writeClasses
public boolean writeClasses()
Expected dump levels are 0, 1, 2, 3 dump level 0 is always on.
-
doThisOptimization
public boolean doThisOptimization()
-
doInitializerOptimization
public boolean doInitializerOptimization()
-
getJDOMetaData
public JDOMetaData getJDOMetaData()
Is the class a well known persistent capable class? These are normally the java primitives.
-
setJDOMetaData
public void setJDOMetaData(JDOMetaData jdoMetaData)
-
addClass
public void addClass(ClassControl cc)
Add the class to the class mapping table. Check that it does not conflict with earlier settings.
-
canFindClass
public boolean canFindClass(String className)
Look for the specified class in the class map. If not there, use the class path to find the class. If still not found, return false.
-
getClass
public ClassControl getClass(String className)
Look for the specified class in the class map. No other class lookup is performed. Use this only if you are certain that the class will have been found.
-
getClasses
public Iterator getClasses()
-
findClass
public ClassControl findClass(String className)
Look for the specified class in the class map. If not there, use the class path to find the class. If still not found, return false.
-
lookupClass
public ClassControl lookupClass(String className)
Look up the specified class in the class search path. Callers should normally consult the classmap prior to calling this function. The class is not entered into the classmap
-
collectClasses
public ArrayList collectClasses(int persistType)
Return a ArrayList of ClassControl objects which have the specified persistence type
-
collectClasses
public ArrayList collectClasses()
Return an ArrayList of the ClassControls in classMap. This is useful in that it provides a stable base for enumeration.
-
lookupDestClass
public ClassFileSource lookupDestClass(String className)
Look for a class source using the destination directory as a root directory for the lookup which represents the annotated output for the class specified. Return null if not found.
-
setDestinationDirectory
public void setDestinationDirectory(String dir)
-
excludeDestinationDirectory
public void excludeDestinationDirectory()
Update the class path to remove the destination directory if it is found in the class path.
-
moveDestinationDirectoryToEnd
public void moveDestinationDirectoryToEnd()
Update the class path to move the destination directory to the end of the class path if it is found in the class path.
-
setOutputWriter
public void setOutputWriter(PrintWriter out)
-
getOutputWriter
public PrintWriter getOutputWriter()
-
setErrorWriter
public void setErrorWriter(PrintWriter err)
-
getErrorWriter
public PrintWriter getErrorWriter()
-
setVerbose
public void setVerbose(boolean beVerbose)
-
isVerbose
public boolean isVerbose()
-
setQuiet
public void setQuiet(boolean beQuiet)
-
setNoWrite
public void setNoWrite(boolean dontWrite)
-
setNoThisOptimization
public void setNoThisOptimization(boolean dontOpt)
-
setNoInitializerOptimization
public void setNoInitializerOptimization(boolean dontOpt)
-
setNoOptimization
public void setNoOptimization(boolean dontOpt)
-
setForceOverwrite
public void setForceOverwrite(boolean forceOverwrite)
-
suppressClassWarnings
public void suppressClassWarnings(String className)
Add a suppression entry for a class
-
suppressFieldWarnings
public void suppressFieldWarnings(String fullFieldName)
Add a suppression entry for a field of a class
-
reset
public void reset()
Reset the environment.
-
-