Class ClassGenerator
java.lang.Object
org.spongepowered.eventimplgen.factory.ClassGenerator
Generates the bytecode for classes needed by
ClassNameProvider.-
Method Summary
Modifier and TypeMethodDescriptionbooleancontributeField(ClassContext classWriter, DeclaredType parentType, Property property) @Nullable com.palantir.javapoet.JavaFilecreateClass(TypeElement type, com.palantir.javapoet.ClassName name, DeclaredType parentType, EventData data, PropertySorter sorter, Set<? extends EventFactoryPlugin> plugins) Create the event class.getField(DeclaredType clazz, String fieldName) Get the policy regarding how null parameters are handled.getRequiredProperties(List<Property> properties) booleanhasDeclaredMethod(DeclaredType clazz, String name, TypeMirror... params) com.palantir.javapoet.ClassNamequalifiedName(TypeElement event) voidsetNullPolicy(NullPolicy nullPolicy) Set the policy regarding how null parameters are handled.
-
Method Details
-
hasDeclaredMethod
-
getField
-
getNullPolicy
Get the policy regarding how null parameters are handled.- Returns:
- The null policy
-
setNullPolicy
Set the policy regarding how null parameters are handled.- Parameters:
nullPolicy- The null policy
-
contributeField
public boolean contributeField(ClassContext classWriter, DeclaredType parentType, Property property) -
getRequiredProperties
-
createClass
@Nullable public @Nullable com.palantir.javapoet.JavaFile createClass(TypeElement type, com.palantir.javapoet.ClassName name, DeclaredType parentType, EventData data, PropertySorter sorter, Set<? extends EventFactoryPlugin> plugins) Create the event class.- Parameters:
type- The typename- The canonical of the generated classparentType- The parent type- Returns:
- The class' contents, or
nullif an error was reported while generating the class
-
qualifiedName
-