Class NativeMethodWrapper

java.lang.Object
com.blamejared.crafttweaker_annotations.annotations.NativeMethodWrapper

public class NativeMethodWrapper extends Object
Wrapper class to read attribute values from Annotation NativeMethod.
  • Method Details

    • _annotatedElement

      public Element _annotatedElement()
      Gets the element on which the wrapped annotation is used.
    • _annotationMirror

      public AnnotationMirror _annotationMirror()
      Gets the wrapped AnnotationMirror.
    • name

      public String name()
      Gets the NativeMethod.name from wrapped annotation.
      Returns:
      the attribute value
    • parametersAsTypeMirror

      public TypeMirror[] parametersAsTypeMirror()
      Gets the NativeMethod.parameters from wrapped annotation.
      Returns:
      the attribute value as a TypeMirror
    • parametersAsTypeMirrorWrapper

      public io.toolisticon.aptk.tools.TypeMirrorWrapper[] parametersAsTypeMirrorWrapper()
      Gets the NativeMethod.parameters from wrapped annotation.
      Returns:
      the attribute value as a TypeMirror
    • parametersAsFqn

      public String[] parametersAsFqn()
      Gets the NativeMethod.parameters from wrapped annotation.
      Returns:
      the attribute value as a fqn
    • getterName

      public String getterName()
      Gets the NativeMethod.getterName from wrapped annotation.
      Returns:
      the attribute value
    • getterNameIsDefaultValue

      public boolean getterNameIsDefaultValue()
      Allows to check if attribute was explicitly set or if default value is used.
      Returns:
      true, if default value is used, otherwise false
    • setterName

      public String setterName()
      Gets the NativeMethod.setterName from wrapped annotation.
      Returns:
      the attribute value
    • setterNameIsDefaultValue

      public boolean setterNameIsDefaultValue()
      Allows to check if attribute was explicitly set or if default value is used.
      Returns:
      true, if default value is used, otherwise false
    • isAnnotated

      public static boolean isAnnotated(Element element)
      Checks if passed element is annotated with this wrapper annotation type : NativeMethod
      Parameters:
      element - The element to check for wrapped annotation type
      Returns:
      true, if passed element is annotated with NativeMethod annotation, otherwise false
    • wrap

      public static NativeMethodWrapper wrap(Element element)
      Gets the AnnotationMirror from passed element for this wrappers annotation type and creates a wrapper instance.
      Parameters:
      element - The element to read the annotations from
      Returns:
      The wrapped AnnotationMirror if Element is annotated with this wrappers annotation type, otherwise null.
    • wrap

      public static NativeMethodWrapper wrap(AnnotationMirror annotationMirror)
      Wraps an AnnotationMirror. Throws an IllegalArgumentException if passed AnnotationMirror type doesn't match the wrapped annotation type.
      Parameters:
      annotationMirror - The element annotated with the annotation to wrap
      Returns:
      The wrapper instance
    • wrap

      public static NativeMethodWrapper wrap(Element element, AnnotationMirror annotationMirror)
      Wraps an AnnotationMirror. Throws an IllegalArgumentException if passed AnnotationMirror type doesn't match the wrapped annotation type.
      Parameters:
      element - the element bound to the usage of passed AnnotationMirror
      annotationMirror - The AnnotationMirror to wrap
      Returns:
      The wrapper instance