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 voidaddClass(ClassControl cc)Add the class to the class mapping table.booleancanFindClass(String className)Look for the specified class in the class map.ArrayListcollectClasses()Return an ArrayList of the ClassControls in classMap.ArrayListcollectClasses(int persistType)Return a ArrayList of ClassControl objects which have the specified persistence typeFiledestinationDirectory()booleandoInitializerOptimization()booleandoThisOptimization()booleandoTimingStatistics()voiderror(String error)interrorCount()voidexcludeDestinationDirectory()Update the class path to remove the destination directory if it is found in the class path.ClassControlfindClass(String className)Look for the specified class in the class map.booleanforceOverwrite()ClassControlgetClass(String className)Look for the specified class in the class map.IteratorgetClasses()PrintWritergetErrorWriter()JDOMetaDatagetJDOMetaData()Is the class a well known persistent capable class? These are normally the java primitives.StringgetLastErrorMessage()PrintWritergetOutputWriter()booleanisVerbose()ClassControllookupClass(String className)Look up the specified class in the class search path.ClassFileSourcelookupDestClass(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.voidmessage(String mess)voidmessageNL(String mess)voidmoveDestinationDirectoryToEnd()Update the class path to move the destination directory to the end of the class path if it is found in the class path.voidreset()Reset the environment.voidsetDestinationDirectory(String dir)voidsetDoTimingStatistics(boolean dontOpt)voidsetErrorWriter(PrintWriter err)voidsetForceOverwrite(boolean forceOverwrite)voidsetJDOMetaData(JDOMetaData jdoMetaData)voidsetNoInitializerOptimization(boolean dontOpt)voidsetNoOptimization(boolean dontOpt)voidsetNoThisOptimization(boolean dontOpt)voidsetNoWrite(boolean dontWrite)voidsetOutputWriter(PrintWriter out)voidsetQuiet(boolean beQuiet)voidsetVerbose(boolean beVerbose)voidsuppressClassWarnings(String className)Add a suppression entry for a classvoidsuppressFieldWarnings(String fullFieldName)Add a suppression entry for a field of a classbooleanupdateInPlace()voidwarning(String warn)voidwarning(String warn, String classname)voidwarning(String warn, String classname, String fieldname)booleanwriteClasses()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.
-
-