java.lang.Object
org.spongepowered.eventimplgen.factory.ClassGenerator

public class ClassGenerator extends Object
Generates the bytecode for classes needed by ClassNameProvider.
  • Method Details

    • hasDeclaredMethod

      public boolean hasDeclaredMethod(DeclaredType clazz, String name, TypeMirror... params)
    • getField

      public VariableElement getField(DeclaredType clazz, String fieldName)
    • getNullPolicy

      public NullPolicy getNullPolicy()
      Get the policy regarding how null parameters are handled.
      Returns:
      The null policy
    • setNullPolicy

      public void setNullPolicy(NullPolicy nullPolicy)
      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

      public List<Property> getRequiredProperties(List<Property> properties)
    • 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 type
      name - The canonical of the generated class
      parentType - The parent type
      Returns:
      The class' contents, or null if an error was reported while generating the class
    • qualifiedName

      public com.palantir.javapoet.ClassName qualifiedName(TypeElement event)