public class JavaVisitorContext extends MutableConvertibleValuesMap<Object> implements VisitorContext
map
EMPTY
Constructor and Description |
---|
JavaVisitorContext(Messager messager,
Elements elements,
AnnotationUtils annotationUtils,
Types types,
ModelUtils modelUtils,
Filer filer)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
fail(String message,
Element element)
Allows failing compilation for a given element with the given message.
|
AnnotationUtils |
getAnnotationUtils()
The annotation utils.
|
Optional<ClassElement> |
getClassElement(String name)
This method will lookup another class element by name.
|
Elements |
getElements()
The elements.
|
Messager |
getMessager()
The messager.
|
ModelUtils |
getModelUtils()
The model utils.
|
Types |
getTypes()
The types.
|
void |
info(String message)
Allows printing informational messages.
|
void |
info(String message,
Element element)
Allows printing informational messages.
|
Optional<GeneratedFile> |
visitGeneratedFile(String path)
Visit a file that will be located within the generated source directory.
|
Optional<GeneratedFile> |
visitMetaInfFile(String path)
Visit a file within the META-INF directory.
|
void |
warn(String message,
Element element)
Allows printing a warning for the given message and element.
|
clear, put, remove, toString
empty, get, names, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClassElement
clear, of, put, putAll, putAll, remove
asMap, asMap, contains, empty, forEach, getValueType, isEmpty, iterator, names, subMap, subMap, subMap, values
get, get, get, get
forEach, spliterator
public JavaVisitorContext(Messager messager, Elements elements, AnnotationUtils annotationUtils, Types types, ModelUtils modelUtils, Filer filer)
messager
- The messagerelements
- The elementsannotationUtils
- The annotation utilstypes
- Type typesmodelUtils
- The model utilsfiler
- The filerpublic Optional<ClassElement> getClassElement(String name)
VisitorContext
getClassElement
in interface VisitorContext
name
- The namepublic void info(String message, Element element)
VisitorContext
info
in interface VisitorContext
message
- The messageelement
- The elementpublic void info(String message)
VisitorContext
info
in interface VisitorContext
message
- The messagepublic void fail(String message, Element element)
VisitorContext
fail
in interface VisitorContext
message
- The messageelement
- The elementpublic void warn(String message, Element element)
VisitorContext
warn
in interface VisitorContext
message
- The messageelement
- The elementpublic Optional<GeneratedFile> visitMetaInfFile(String path)
VisitorContext
visitMetaInfFile
in interface VisitorContext
path
- The path to the filepublic Optional<GeneratedFile> visitGeneratedFile(String path)
VisitorContext
visitGeneratedFile
in interface VisitorContext
path
- The path to the filepublic Messager getMessager()
public ModelUtils getModelUtils()
public Elements getElements()
public AnnotationUtils getAnnotationUtils()
public Types getTypes()