Class DocumentWrapper
java.lang.Object
com.blamejared.crafttweaker_annotations.annotations.DocumentWrapper
Wrapper class to read attribute values from Annotation Document.
-
Method Summary
Modifier and TypeMethodDescriptionGets the element on which the wrapped annotation is used.Gets the wrapped AnnotationMirror.static booleanisAnnotated(Element element) Checks if passed element is annotated with this wrapper annotation type : DocumentGets the Document.requiredMods from wrapped annotation.Gets the Document.requiredMods from wrapped annotation.booleanAllows to check if attribute was explicitly set or if default value is used.Gets the Document.scriptFile from wrapped annotation.booleanAllows to check if attribute was explicitly set or if default value is used.value()Gets the Document.value from wrapped annotation.static DocumentWrapperwrap(AnnotationMirror annotationMirror) Wraps an AnnotationMirror.static DocumentWrapperGets the AnnotationMirror from passed element for this wrappers annotation type and creates a wrapper instance.static DocumentWrapperwrap(Element element, AnnotationMirror annotationMirror) Wraps an AnnotationMirror.
-
Method Details
-
_annotatedElement
Gets the element on which the wrapped annotation is used. -
_annotationMirror
Gets the wrapped AnnotationMirror. -
value
Gets the Document.value from wrapped annotation.- Returns:
- the attribute value
-
scriptFile
Gets the Document.scriptFile from wrapped annotation.- Returns:
- the attribute value
-
scriptFileIsDefaultValue
public boolean scriptFileIsDefaultValue()Allows to check if attribute was explicitly set or if default value is used.- Returns:
- true, if default value is used, otherwise false
-
requiredModsAsAnnotationMirrorArray
Gets the Document.requiredMods from wrapped annotation.- Returns:
- the attribute value
-
requiredMods
Gets the Document.requiredMods from wrapped annotation.- Returns:
- the attribute value
-
requiredModsIsDefaultValue
public boolean requiredModsIsDefaultValue()Allows to check if attribute was explicitly set or if default value is used.- Returns:
- true, if default value is used, otherwise false
-
isAnnotated
Checks if passed element is annotated with this wrapper annotation type : Document- Parameters:
element- The element to check for wrapped annotation type- Returns:
- true, if passed element is annotated with Document annotation, otherwise false
-
wrap
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
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
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 AnnotationMirrorannotationMirror- The AnnotationMirror to wrap- Returns:
- The wrapper instance
-