|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jelly.apt.freemarker.FreemarkerProcessor
org.codehaus.enunciate.apt.EnunciateAnnotationProcessor
public class EnunciateAnnotationProcessor
Root annotation processor for enunciate. Initializes the model and signals the modules to generate.
Even though it extendsFreemarkerProcessor, it does not process any Freemarker templates directly. It extends
FreemarkerProcessor only to inherit certain functionality.
| Constructor Summary | |
|---|---|
EnunciateAnnotationProcessor(Enunciate enunciate,
java.lang.String... additionalApiClasses)
|
|
| Method Summary | |
|---|---|
RootElementDeclaration |
createRootElementDeclaration(com.sun.mirror.declaration.ClassDeclaration declaration,
TypeDefinition typeDefinition)
Find or create the root element declaration for the specified type definition. |
TypeDefinition |
createTypeDefinition(com.sun.mirror.declaration.ClassDeclaration declaration,
EnunciateFreemarkerModel model)
Find the type definition for a class given the class's declaration, or null if the class is xml transient. |
void |
debug(java.lang.String message,
java.lang.Object... formatArgs)
Handle a debug-level message. |
protected com.sun.mirror.apt.Messager |
getMessager()
Get the messager for the current environment. |
protected EnunciateFreemarkerModel |
getRootModel()
Getting the root model pulls all endpoint interfaces and schema types out of the source base, adds the classes specified to be included, and adds them to the model, then validates the model. |
java.util.Collection<net.sf.jelly.apt.freemarker.FreemarkerTransform> |
getTransforms()
|
void |
info(java.lang.String message,
java.lang.Object... formatArgs)
Handle an info-level message. |
boolean |
isEndpointInterface(com.sun.mirror.declaration.TypeDeclaration declaration)
A quick check to see if a declaration is an endpoint interface. |
boolean |
isJAXRSRootResource(com.sun.mirror.declaration.TypeDeclaration declaration)
Whether the specified type is a JAX-RS root resource. |
boolean |
isJAXRSSupport(com.sun.mirror.declaration.TypeDeclaration declaration)
Whether the specified type is a JAX-RS support class (resource and/or provider). |
protected boolean |
isPotentialJsonSchemaType(com.sun.mirror.declaration.TypeDeclaration declaration)
Whether the specified declaration is a potential schema type for JSON data. |
protected boolean |
isPotentialXmlSchemaType(com.sun.mirror.declaration.TypeDeclaration declaration)
Whether the specified declaration is a potential schema type. |
protected boolean |
isRegistry(com.sun.mirror.declaration.TypeDeclaration declaration)
Whether the specified declaration is a registry. |
protected boolean |
isRootSchemaElement(com.sun.mirror.declaration.TypeDeclaration declaration)
A quick check to see if a declaration defines a root schema element. |
protected boolean |
isThrowable(com.sun.mirror.declaration.TypeDeclaration declaration)
Whether the specified declaration is throwable. |
protected com.sun.mirror.declaration.TypeDeclaration[] |
loadAdditionalApiDefinitions()
Loads the type declarations for the additional API definitions. |
protected void |
loadJsonTypeDef(JsonTypeDefinition typeDefinition,
EnunciateFreemarkerModel model)
Loads the specified type definition into the specified model. |
protected void |
loadTypeDef(TypeDefinition typeDef,
EnunciateFreemarkerModel model)
Loads the specified type definition into the specified model. |
protected net.sf.jelly.apt.freemarker.FreemarkerModel |
newRootModel()
|
protected void |
onUnhandledDeclaration(EnunciateFreemarkerModel model,
com.sun.mirror.declaration.TypeDeclaration declaration)
|
void |
process()
|
protected void |
process(EnunciateException e)
|
protected void |
process(java.io.IOException e)
|
protected void |
process(java.lang.RuntimeException e)
|
protected void |
process(freemarker.template.TemplateException e)
|
protected void |
removeExcludedClasses(java.util.Collection<com.sun.mirror.declaration.TypeDeclaration> typeDeclarations)
Remove any classes that are explicitly exluded from this (presumably modifiable) collection. |
void |
throwAnyErrors()
Throws any errors that occurred during processing. |
protected void |
trimNotIncludedClasses(java.util.Collection<com.sun.mirror.declaration.TypeDeclaration> typeDeclarations)
Trim any classes that are not explicitly included from this (presumably modifiable) collection. |
protected void |
validate(EnunciateFreemarkerModel model)
Validate the model. |
protected ValidationResult |
validate(EnunciateFreemarkerModel model,
Validator validator)
Validates the model given a validator. |
void |
warn(java.lang.String message,
java.lang.Object... formatArgs)
Handle a warn-level message. |
| Methods inherited from class net.sf.jelly.apt.freemarker.FreemarkerProcessor |
|---|
getConfiguration, getObjectWrapper, getTemplateLoader, getTemplateURL, getVariables |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EnunciateAnnotationProcessor(Enunciate enunciate,
java.lang.String... additionalApiClasses)
throws EnunciateException
EnunciateException| Method Detail |
|---|
public void process()
process in interface com.sun.mirror.apt.AnnotationProcessorprocess in class net.sf.jelly.apt.freemarker.FreemarkerProcessor
protected EnunciateFreemarkerModel getRootModel()
throws freemarker.template.TemplateModelException
getRootModel in class net.sf.jelly.apt.freemarker.FreemarkerProcessorfreemarker.template.TemplateModelException
protected void onUnhandledDeclaration(EnunciateFreemarkerModel model,
com.sun.mirror.declaration.TypeDeclaration declaration)
protected void removeExcludedClasses(java.util.Collection<com.sun.mirror.declaration.TypeDeclaration> typeDeclarations)
typeDeclarations - the declarations.protected void trimNotIncludedClasses(java.util.Collection<com.sun.mirror.declaration.TypeDeclaration> typeDeclarations)
typeDeclarations - The declarations.protected com.sun.mirror.declaration.TypeDeclaration[] loadAdditionalApiDefinitions()
protected void loadJsonTypeDef(JsonTypeDefinition typeDefinition,
EnunciateFreemarkerModel model)
typeDefinition - The type definition to load.model - The model into which to load the type definition.
protected void loadTypeDef(TypeDefinition typeDef,
EnunciateFreemarkerModel model)
typeDef - The type definition to load.model - The model into which to load the type definition.
protected void validate(EnunciateFreemarkerModel model)
throws ModelValidationException
model - The model to validate.
ModelValidationException - If any validation errors are encountered.protected com.sun.mirror.apt.Messager getMessager()
protected net.sf.jelly.apt.freemarker.FreemarkerModel newRootModel()
newRootModel in class net.sf.jelly.apt.freemarker.FreemarkerProcessorprotected boolean isRegistry(com.sun.mirror.declaration.TypeDeclaration declaration)
declaration - The declaration.
protected boolean isPotentialJsonSchemaType(com.sun.mirror.declaration.TypeDeclaration declaration)
declaration - The declaration to determine whether it's a potential schema type for JSON data.
protected boolean isPotentialXmlSchemaType(com.sun.mirror.declaration.TypeDeclaration declaration)
declaration - The declaration to determine whether it's a potential schema type.
protected boolean isThrowable(com.sun.mirror.declaration.TypeDeclaration declaration)
declaration - The declaration to determine whether it is throwable.
public boolean isEndpointInterface(com.sun.mirror.declaration.TypeDeclaration declaration)
public boolean isJAXRSRootResource(com.sun.mirror.declaration.TypeDeclaration declaration)
declaration - The declaration.
public boolean isJAXRSSupport(com.sun.mirror.declaration.TypeDeclaration declaration)
declaration - The declaration.
public TypeDefinition createTypeDefinition(com.sun.mirror.declaration.ClassDeclaration declaration,
EnunciateFreemarkerModel model)
declaration - The declaration.model - The model to use to create the type declaration.
public RootElementDeclaration createRootElementDeclaration(com.sun.mirror.declaration.ClassDeclaration declaration,
TypeDefinition typeDefinition)
declaration - The class declarationtypeDefinition - The specified type definition.
protected boolean isRootSchemaElement(com.sun.mirror.declaration.TypeDeclaration declaration)
public java.util.Collection<net.sf.jelly.apt.freemarker.FreemarkerTransform> getTransforms()
getTransforms in class net.sf.jelly.apt.freemarker.FreemarkerProcessor
protected ValidationResult validate(EnunciateFreemarkerModel model,
Validator validator)
model - The model to validate.validator - The validator.
protected void process(freemarker.template.TemplateException e)
process in class net.sf.jelly.apt.freemarker.FreemarkerProcessorprotected void process(EnunciateException e)
protected void process(java.io.IOException e)
process in class net.sf.jelly.apt.freemarker.FreemarkerProcessorprotected void process(java.lang.RuntimeException e)
public void throwAnyErrors()
throws EnunciateException,
java.io.IOException
EnunciateException
java.io.IOException
public void info(java.lang.String message,
java.lang.Object... formatArgs)
message - The info message.formatArgs - The format args of the message.
public void debug(java.lang.String message,
java.lang.Object... formatArgs)
message - The debug message.formatArgs - The format args of the message.
public void warn(java.lang.String message,
java.lang.Object... formatArgs)
message - The warn message.formatArgs - The format args of the message.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||