Examples of JavadocTagElement


Examples of org.openiaml.docs.modeldoc.JavadocTagElement

          @Override
          public List<ITagHandler> getSemanticTagHandlers() {
            return generator.getSemanticTagHandlers();
          }
        };
        JavadocTagElement e = helper.getTaglineForEMFElement(factory, ref);
        if (e != null) {
          newRef.setTagline(e);
        }
       
        source.getReferences().add(newRef);
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

   */
  public void handleTag(String tag, String text) {
    if (tag == null)
      throw new NullPointerException("tag cannot be null");
   
    JavadocTagElement fragment = factory.createJavadocTagElement();
    fragment.setName(tag);
   
    JavadocTextElement text2 = factory.createJavadocTextElement();
    text2.setValue(text);
    fragment.getFragments().add(text2);
   
    tagElement.getFragments().add(fragment);

  }
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

      EMap<String, String> details = ann.getDetails();
      for (String key : details.keySet()) {
        if (key.equals(annotationKey)) {
          // found a tag line
          // parse for JavaDoc
          JavadocTagElement e = factory.createJavadocTagElement();
         
          // parse the line into javadoc elements
          // (the line needs to be parsed into fragments before we can find semantic references)
          new BasicJavadocParser(getSemanticTagHandlers()).parseSemanticLineIntoFragments(details.get(key), factory, e);
         
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

    String firstComment = getFirstJavadocComment(lines);
    if (firstComment == null || firstComment.trim().isEmpty())
      return null;
   
    // create a new fragment for this comment
    JavadocTagElement e = factory.createJavadocTagElement();
    e.setName("summary");
   
    // parse the line into javadoc elements
    // (the line needs to be parsed into fragments before we can find semantic references)
    parseSemanticLineIntoFragments(firstComment, factory, e);
   
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

       
        JavaElement ref = creator.createReference(lines, i + 1);
        if (ref != null) {
       
          // a root tag for @tagName
          JavadocTagElement e = factory.createJavadocTagElement();
          e.setJavaParent(ref);
          e.setName(tagName);
         
          // parse the line into javadoc elements
          // (the line needs to be parsed into fragments before we can find semantic references)
          parseSemanticLineIntoFragments(line, factory, e);
         
          // identify semantic rules back
          handleModelReferences(e, ref, root, helper);
        }
      } else if (line.startsWith("/**")) {
       
        // get all @tags
        String[] tags = getJavadocTags(lines, i);
       
        for (String tag : tags) {
          if (!tag.contains(" ")) {
            throw new RuntimeException("Malformed Javadoc tag, expected a space: '" + line + "'");
          }
         
          // extract tag
          String tagName = tag.substring(0, tag.indexOf(' '));
          // extract line
          tag = tag.substring(tag.indexOf(' ') + 1);
         
          JavaElement ref = creator.createReference(lines, i + 1);
          if (ref != null) {
         
            // a root tag for @tagName
            JavadocTagElement e = factory.createJavadocTagElement();
            e.setJavaParent(ref);
            e.setName(tagName);
           
            // parse the line into javadoc elements
            // (the line needs to be parsed into fragments before we can find semantic references)
            parseSemanticLineIntoFragments(tag, factory, e);
           
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

     Iterator<EObject> it = root.eAllContents();
     while (it.hasNext()) {
       EObject obj = it.next();
      
       if (obj instanceof JavadocTagElement) {
         JavadocTagElement tag = (JavadocTagElement) obj;
         if ("@model".equals(tag.getName())) {
           // get the description
           String desc = "";
           for (JavadocFragment frag : tag.getFragments()) {
             if (frag instanceof JavadocTextElement) {
               desc += ((JavadocTextElement) frag).getValue();
             }
           }
          
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

        JavaElement javaReference) throws SemanticHandlerException {
      List<JavadocFragment> result = new ArrayList<JavadocFragment>();
      for (Object o : fragments) {
        if (o instanceof TagElement) {
          TagElement tag = (TagElement) o;
          JavadocTagElement e = factory.createJavadocTagElement();
          e.setName(tag.getTagName());
         
          // recurse to create parents           
          e.getFragments().addAll(handleTagFragment(tag.fragments(), javaReference));
         
          // link up any references to model elements
          handleModelReferences(e, javaReference);
         
          result.add(e);
        } else if (o instanceof TextElement) {
          TextElement text = (TextElement) o;
          JavadocTextElement e = factory.createJavadocTextElement();
          e.setValue(text.getText());
          result.add(e);
        } else if (o instanceof MethodRef) {
          MethodRef ref = (MethodRef) o;
          JavaMethod method = getMethodFor(ref);
          if (method != null) {
            JavadocMethodReference e = factory.createJavadocMethodReference();
            e.setReference(method);
            result.add(e);
          }
        } else if (o instanceof SimpleName) {
          // assume it is a class name
          JavaClass cls = getJavaClassFor((SimpleName) o);
          if (cls != null) {
            JavadocClassReference e = factory.createJavadocClassReference();
            e.setReference(cls);
            result.add(e);
          }
        } else if (o instanceof QualifiedName) {
          // assume it is a class name (with package)
          JavaClass cls = getJavaClassFor((QualifiedName) o);
          if (cls != null) {
            JavadocClassReference e = factory.createJavadocClassReference();
            e.setReference(cls);
            result.add(e);
          }
        } else if (o instanceof MemberRef) {
          // ignore
        } else {
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

        TagElement fragment, JavaElement javaReference) throws SemanticHandlerException {
      List<Object> input = new ArrayList<Object>();
      input.add(fragment);
      List<JavadocFragment> result = handleTagFragment(input, javaReference);

      JavadocTagElement je = (JavadocTagElement) result.get(0);
     
      return je;
    }
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

          TypeDeclaration parent = (TypeDeclaration) node.getParent();
       
          if (parentMatches(parent, cls)) {         
            for (Object o : node.tags()) {
              TagElement tag = (TagElement) o;
              JavadocTagElement docs = handleTagFragment(tag, cls);
              cls.getJavadocs().add(docs);
            }
          }
        } else if (node.getParent() instanceof MethodDeclaration) {
          // a method
          MethodDeclaration parent = (MethodDeclaration) node.getParent();
         
          JavaMethod method = getMethodFor(parent, cls);
          if (method != null) {
            for (Object o : node.tags()) {
              TagElement tag = (TagElement) o;
              JavadocTagElement docs = handleTagFragment(tag, method);
              method.getJavadocs().add(docs);
            }
          }
         
        }
View Full Code Here

Examples of org.openiaml.docs.modeldoc.JavadocTagElement

        c.setAbstract(cls.isAbstract());
        c.setInterface(cls.isInterface());

        // add tagline
        {
          JavadocTagElement e = getTaglineForEMFElement(factory, cls);
          if (e != null) {
            c.setTagline(e);
          }
        }
       
        // add rationale
        {
          JavadocTagElement e = getRationaleForEMFElement(factory, cls);
          if (e != null) {
            c.setRationale(e);
          }
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.