Class ASceneWrapper
java.lang.Object
org.checkerframework.common.wholeprograminference.scenelib.ASceneWrapper
scene-lib (from the Annotation File Utilities) doesn't provide enough information to usefully
print stub files: it lacks information about what is and is not an enum, about the base types of
variables, and about formal parameter names.
This class wraps AScene but provides access to that missing information. This allows us to preserve the code that generates .jaif files, while allowing us to sanely and safely keep the information we need to generate stubs.
This class would be better as a subclass of AScene.
-
Constructor Summary
ConstructorDescriptionASceneWrapper
(org.checkerframework.afu.scenelib.el.AScene theScene) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.checkerframework.afu.scenelib.el.AScene
Avoid using this if possible; use the other methods of this class unless you absolutely need an AScene.void
updateSymbolInformation
(org.checkerframework.afu.scenelib.el.AClass aClass, @Nullable com.sun.tools.javac.code.Symbol.ClassSymbol classSymbol) Updates the symbol information stored in AClass for the given class.void
writeToFile
(String jaifPath, WholeProgramInferenceScenesStorage.AnnotationsInContexts annosToIgnore, WholeProgramInference.OutputFormat outputFormat, BaseTypeChecker checker) Write the scene wrapped by this object to a file at the given path.
-
Constructor Details
-
ASceneWrapper
public ASceneWrapper(org.checkerframework.afu.scenelib.el.AScene theScene) Constructor. Pass the AScene to wrap.- Parameters:
theScene
- the scene to wrap
-
-
Method Details
-
writeToFile
public void writeToFile(String jaifPath, WholeProgramInferenceScenesStorage.AnnotationsInContexts annosToIgnore, WholeProgramInference.OutputFormat outputFormat, BaseTypeChecker checker) Write the scene wrapped by this object to a file at the given path.- Parameters:
jaifPath
- the path of the file to be written, but ending in ".jaif". Ifoutputformat
is notJAIF
, the path will be modified to match.annosToIgnore
- which annotations should be ignored in which contextsoutputFormat
- the output format to usechecker
- the checker from which this method is called, for naming stub files
-
updateSymbolInformation
public void updateSymbolInformation(org.checkerframework.afu.scenelib.el.AClass aClass, @Nullable com.sun.tools.javac.code.Symbol.ClassSymbol classSymbol) Updates the symbol information stored in AClass for the given class. May be called multiple times (and needs to be if the second parameter was null the first time it was called; only some calls provide the symbol information).- Parameters:
aClass
- the class representation in which the symbol information is to be updatedclassSymbol
- the source of the symbol information; may be null, in which case this method does nothing
-
getAScene
public org.checkerframework.afu.scenelib.el.AScene getAScene()Avoid using this if possible; use the other methods of this class unless you absolutely need an AScene.- Returns:
- the AScene representation of this
-