TypeMirror typeMirror;
TypeHint hintInfo = getAnnotation(TypeHint.class);
if (hintInfo != null) {
try {
Class hint = hintInfo.value();
AnnotationProcessorEnvironment env = net.sf.jelly.apt.Context.getCurrentEnvironment();
if (TypeHint.NO_CONTENT.class.equals(hint)) {
typeMirror = env.getTypeUtils().getVoidType();
}
else {
String hintName = hint.getName();
if (TypeHint.NONE.class.equals(hint)) {
hintName = hintInfo.qualifiedName();
}
if (!"##NONE".equals(hintName)) {
TypeDeclaration type = env.getTypeDeclaration(hintName);
typeMirror = TypeMirrorDecorator.decorate(env.getTypeUtils().getDeclaredType(type));
}
else {
typeMirror = delegate.getType();
}
}
}
catch (MirroredTypeException e) {
typeMirror = e.getTypeMirror();
}
}
else {
typeMirror = delegate.getType();
if (getJavaDoc().get("inputWrapped") != null) { //support jax-doclets. see http://jira.codehaus.org/browse/ENUNCIATE-690
String fqn = getJavaDoc().get("inputWrapped").get(0);
AnnotationProcessorEnvironment env = net.sf.jelly.apt.Context.getCurrentEnvironment();
TypeDeclaration type = env.getTypeDeclaration(fqn);
if (type != null) {
typeMirror = TypeMirrorDecorator.decorate(env.getTypeUtils().getDeclaredType(type));
}
}
}
this.type = typeMirror;