Class GeneratorUtils
java.lang.Object
com.oracle.truffle.dsl.processor.generator.GeneratorUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBoundaryOrTransferToInterpreter(CodeExecutableElement method, CodeTreeBuilder builder) static voidaddGeneratedBy(ProcessorContext context, CodeTypeElement generatedType, TypeElement generatedByType) static voidaddOverride(CodeExecutableElement method) static voidaddThrownExceptions(CodeExecutableElement executable, List<? extends TypeMirror> thrownTypes) static CodeTypeElementcreateClass(Template sourceModel, TemplateMethod sourceMethod, Set<Modifier> modifiers, String simpleName, TypeMirror superType) static CodeTypeElementcreateClass(TypeElement templateType, TemplateMethod sourceMethod, Set<Modifier> modifiers, String simpleName, TypeMirror superType) static CodeExecutableElementcreateConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz) static CodeExecutableElementcreateConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz, ExecutableElement superConstructor) static CodeExecutableElementcreateConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz, ExecutableElement superConstructor, Set<String> ignoreFields) static CodeExecutableElementcreateCopyConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz, Set<String> ignoreFields) static CodeExecutableElementcreateCopyConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz, ExecutableElement superConstructor, Set<String> ignoreFields) static CodeTreestatic CodeTreestatic CodeTreecreateShouldNotReachHere(CodeTree causeExpression) static CodeTreecreateShouldNotReachHere(String message) static CodeTreestatic voidmarkUnsafeAccessed(CodeElement<?> element) static voidmergeSuppressWarnings(CodeElement<?> element, String... addWarnings) static CodeExecutableElementoverride(ExecutableElement method) Generates an override of the given method.static CodeExecutableElementoverride(DeclaredType type, String methodName) Generates an override of the given method defined on the given type that takes no parameters.static CodeExecutableElementoverride(DeclaredType type, String methodName, String[] parameterNames) Generates an override of the given method defined on the given type.static CodeExecutableElementoverride(DeclaredType type, String methodName, String[] parameterNames, TypeMirror[] parameterTypes) Generates an override of the given method defined on the given type.static voidpopEncapsulatingNode(CodeTreeBuilder builder) static voidpushEncapsulatingNode(CodeTreeBuilder builder, CodeTree nodeRef)
-
Constructor Details
-
GeneratorUtils
public GeneratorUtils()
-
-
Method Details
-
pushEncapsulatingNode
-
popEncapsulatingNode
-
createTransferToInterpreterAndInvalidate
-
createNeverPartOfCompilation
-
createShouldNotReachHere
-
createShouldNotReachHere
-
createShouldNotReachHere
-
createConstructorUsingFields
public static CodeExecutableElement createConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz) -
addBoundaryOrTransferToInterpreter
public static void addBoundaryOrTransferToInterpreter(CodeExecutableElement method, CodeTreeBuilder builder) -
addOverride
-
markUnsafeAccessed
-
mergeSuppressWarnings
-
createConstructorUsingFields
public static CodeExecutableElement createConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz, ExecutableElement superConstructor) -
createConstructorUsingFields
public static CodeExecutableElement createConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz, ExecutableElement superConstructor, Set<String> ignoreFields) -
createCopyConstructorUsingFields
public static CodeExecutableElement createCopyConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz, Set<String> ignoreFields) -
createCopyConstructorUsingFields
public static CodeExecutableElement createCopyConstructorUsingFields(Set<Modifier> modifiers, CodeTypeElement clazz, ExecutableElement superConstructor, Set<String> ignoreFields) -
createClass
public static CodeTypeElement createClass(Template sourceModel, TemplateMethod sourceMethod, Set<Modifier> modifiers, String simpleName, TypeMirror superType) -
createClass
public static CodeTypeElement createClass(TypeElement templateType, TemplateMethod sourceMethod, Set<Modifier> modifiers, String simpleName, TypeMirror superType) -
addGeneratedBy
public static void addGeneratedBy(ProcessorContext context, CodeTypeElement generatedType, TypeElement generatedByType) -
override
Generates an override of the given method defined on the given type that takes no parameters. -
override
public static CodeExecutableElement override(DeclaredType type, String methodName, String[] parameterNames) Generates an override of the given method defined on the given type. Updates the result's parameters to have the given parameter names. -
override
public static CodeExecutableElement override(DeclaredType type, String methodName, String[] parameterNames, TypeMirror[] parameterTypes) Generates an override of the given method defined on the given type. Updates the result's parameters to have the given parameter names. Uses the given parameter types (which can benull) to disambiguate overloads.Callers must specify parameter names because the parent method may change its parameter names. Additionally, if the parent
typeis loaded from a class file, the original source parameter names are (usually) not available. -
override
Generates an override of the given method. -
addThrownExceptions
public static void addThrownExceptions(CodeExecutableElement executable, List<? extends TypeMirror> thrownTypes)
-