public class GroovyVisitorContext extends Object implements VisitorContext
EMPTY| Constructor and Description | 
|---|
GroovyVisitorContext(org.codehaus.groovy.control.SourceUnit sourceUnit,
                    org.codehaus.groovy.control.CompilationUnit compilationUnit)  | 
| Modifier and Type | Method and Description | 
|---|---|
MutableConvertibleValues<Object> | 
clear()
Clear all values. 
 | 
void | 
fail(String message,
    Element element)
Allows failing compilation for a given element with the given message. 
 | 
void | 
finish()
Finish writing and flush any service entries to disk. 
 | 
<T> Optional<T> | 
get(CharSequence name,
   ArgumentConversionContext<T> conversionContext)
Resolve the given property for the given name. 
 | 
Optional<ClassElement> | 
getClassElement(Class<?> type)
This method will lookup another class element by name. 
 | 
Optional<ClassElement> | 
getClassElement(String name)
This method will lookup another class element by name. 
 | 
ClassElement[] | 
getClassElements(String aPackage,
                String... stereotypes)
Find all the classes within the given package and having the given annotation. 
 | 
Iterable<URL> | 
getClasspathResources(String path)
Obtain a set of resources from the user classpath. 
 | 
void | 
info(String message)
Allows printing informational messages. 
 | 
void | 
info(String message,
    Element element)
Allows printing informational messages. 
 | 
Set<String> | 
names()  | 
MutableConvertibleValues<Object> | 
put(CharSequence key,
   Object value)
Insert a value for the given key and value. 
 | 
MutableConvertibleValues<Object> | 
remove(CharSequence key)
Remove a value for the given key. 
 | 
Collection<Object> | 
values()  | 
OutputStream | 
visitClass(String classname)
Visits a new class and returns the output stream with which should be written the bytes of the class to be
 generated. 
 | 
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 | 
visitServiceDescriptor(String type,
                      String classname)
Allows adding a class that will be written to the  
META-INF/services file under the given type and class
 name. | 
void | 
warn(String message,
    Element element)
Allows printing a warning for the given message and element. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitof, putAll, putAllasMap, asMap, asProperties, contains, empty, forEach, getValueType, isEmpty, iterator, subMap, subMap, subMapget, get, getforEach, spliteratorgetServiceEntries, visitServiceDescriptorpublic GroovyVisitorContext(org.codehaus.groovy.control.SourceUnit sourceUnit,
                            @Nullable
                            org.codehaus.groovy.control.CompilationUnit compilationUnit)
sourceUnit - The source unitcompilationUnit - The compilation unit@Nonnull public Iterable<URL> getClasspathResources(@Nonnull String path)
VisitorContextgetClasspathResources in interface VisitorContextpath - The pathpublic Optional<ClassElement> getClassElement(String name)
VisitorContextgetClassElement in interface VisitorContextname - The namepublic Optional<ClassElement> getClassElement(Class<?> type)
VisitorContextgetClassElement in interface VisitorContexttype - The name@Nonnull public ClassElement[] getClassElements(@Nonnull String aPackage, @Nonnull String... stereotypes)
VisitorContextgetClassElements in interface VisitorContextaPackage - The packagestereotypes - The stereotypespublic void info(String message, @Nullable Element element)
VisitorContextinfo in interface VisitorContextmessage - The messageelement - The elementpublic void info(String message)
VisitorContextinfo in interface VisitorContextmessage - The messagepublic void fail(String message, @Nullable Element element)
VisitorContextfail in interface VisitorContextmessage - The messageelement - The elementpublic void warn(String message, @Nullable Element element)
VisitorContextwarn in interface VisitorContextmessage - The messageelement - The elementpublic OutputStream visitClass(String classname) throws IOException
ClassWriterOutputVisitorvisitClass in interface ClassWriterOutputVisitorclassname - the fully qualified classnameIOException - if an error occurs creating the output streampublic void visitServiceDescriptor(String type, String classname)
ClassWriterOutputVisitorMETA-INF/services file under the given type and class
 name.visitServiceDescriptor in interface ClassWriterOutputVisitortype - the fully qualified service nameclassname - the fully qualified classnamepublic Optional<GeneratedFile> visitMetaInfFile(String path)
VisitorContextvisitMetaInfFile in interface VisitorContextvisitMetaInfFile in interface ClassWriterOutputVisitorpath - The path to the filepublic Optional<GeneratedFile> visitGeneratedFile(String path)
VisitorContextvisitGeneratedFile in interface VisitorContextvisitGeneratedFile in interface ClassWriterOutputVisitorpath - The path to the filepublic void finish()
ClassWriterOutputVisitorfinish in interface ClassWriterOutputVisitorpublic MutableConvertibleValues<Object> put(CharSequence key, @Nullable Object value)
MutableConvertibleValuesput in interface MutableConvertibleValues<Object>key - The keyvalue - The valuepublic MutableConvertibleValues<Object> remove(CharSequence key)
MutableConvertibleValuesremove in interface MutableConvertibleValues<Object>key - The keypublic MutableConvertibleValues<Object> clear()
MutableConvertibleValuesclear in interface MutableConvertibleValues<Object>public Set<String> names()
names in interface ConvertibleValues<Object>public Collection<Object> values()
values in interface ConvertibleValues<Object>public <T> Optional<T> get(CharSequence name, ArgumentConversionContext<T> conversionContext)
ValueResolverget in interface ValueResolver<CharSequence>T - The concrete typename - The nameconversionContext - The conversion context