Search in sources :

Example 11 with DecoratedElement

use of com.webcohesion.enunciate.javac.decorations.element.DecoratedElement in project enunciate by stoicflame.

the class DataTypeExampleImpl method getDocumentationExampleTags.

private JavaDoc.JavaDocTagList getDocumentationExampleTags(Member member) {
    JavaDoc.JavaDocTagList tags = member.getJavaDoc().get("documentationExample");
    if (tags == null || tags.isEmpty()) {
        DecoratedTypeMirror accessorType = member.getBareAccessorType();
        if (accessorType instanceof DecoratedDeclaredType) {
            Element element = ((DecoratedDeclaredType) accessorType).asElement();
            tags = element instanceof DecoratedElement ? ((DecoratedElement) element).getJavaDoc().get("documentationExample") : null;
        }
    }
    return tags;
}
Also used : DecoratedDeclaredType(com.webcohesion.enunciate.javac.decorations.type.DecoratedDeclaredType) DecoratedElement(com.webcohesion.enunciate.javac.decorations.element.DecoratedElement) DecoratedTypeMirror(com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror) TypeElement(javax.lang.model.element.TypeElement) DecoratedElement(com.webcohesion.enunciate.javac.decorations.element.DecoratedElement) Element(javax.lang.model.element.Element) JavaDoc(com.webcohesion.enunciate.javac.javadoc.JavaDoc)

Aggregations

DecoratedElement (com.webcohesion.enunciate.javac.decorations.element.DecoratedElement)11 Element (javax.lang.model.element.Element)6 TypeElement (javax.lang.model.element.TypeElement)6 JavaDoc (com.webcohesion.enunciate.javac.javadoc.JavaDoc)5 DecoratedDeclaredType (com.webcohesion.enunciate.javac.decorations.type.DecoratedDeclaredType)4 DecoratedTypeMirror (com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror)4 DeclaredType (javax.lang.model.type.DeclaredType)4 DecoratedTypeElement (com.webcohesion.enunciate.javac.decorations.element.DecoratedTypeElement)3 VariableElement (javax.lang.model.element.VariableElement)3 TypeMirror (javax.lang.model.type.TypeMirror)3 ElementAdaptor (com.webcohesion.enunciate.javac.decorations.adaptors.ElementAdaptor)2 ArrayList (java.util.ArrayList)2 ExecutableElement (javax.lang.model.element.ExecutableElement)2 CompilationUnitTree (com.sun.source.tree.CompilationUnitTree)1 SourcePositions (com.sun.source.util.SourcePositions)1 TreePath (com.sun.source.util.TreePath)1 DataType (com.webcohesion.enunciate.api.datatype.DataType)1 Property (com.webcohesion.enunciate.api.datatype.Property)1 Syntax (com.webcohesion.enunciate.api.datatype.Syntax)1 Value (com.webcohesion.enunciate.api.datatype.Value)1