• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AnnotationValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.javadoc.AnnotationValue的典型用法代码示例。如果您正苦于以下问题:Java AnnotationValue类的具体用法?Java AnnotationValue怎么用?Java AnnotationValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AnnotationValue类属于com.sun.javadoc包,在下文中一共展示了AnnotationValue类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: toAnnotationValueNode

import com.sun.javadoc.AnnotationValue; //导入依赖的package包/类
/**
 *
 * @return an "value" or "array" XML node for the annotation value.
 */
private static XMLNode toAnnotationValueNode(AnnotationValue value) {
  if (value == null) return null;
  XMLNode node = null;
  Object o = value.value();
  Class<?> c = o.getClass();
  if (c.isArray()) {
    node = new XMLNode("array");
    Object[]a = (Object[])o;
    for (Object i : a) {
      if (i instanceof AnnotationValue) {
        node.child(toAnnotationValueNode((AnnotationValue)i));
      } else {
        System.err.println("Unexpected annotation value type"+i);
      }
    }
  } else {
    node = new XMLNode("value");
    node.attribute("type", getAnnotationValueType(o));
    node.attribute("value", o.toString());
  }

  return node;
}
 
开发者ID:pageseeder,项目名称:xmldoclet,代码行数:28,代码来源:XMLDoclet.java


示例2: makeByLinks

import com.sun.javadoc.AnnotationValue; //导入依赖的package包/类
private static List<LinkModel> makeByLinks(final AnnotationDesc desc) {
    final ArrayList<LinkModel> result = new ArrayList<>();
    for (AnnotationDesc.ElementValuePair member : desc.elementValues())
        if ("value".equals(member.element().name())) {
            Arrays.stream((AnnotationValue[]) member.value().value())
                .map(AnnotationValue::value)
                .map(AnnotationDesc.class::cast)
                .forEach(ad -> result.add(new LinkModel(ad)));

        }
    return result;
}
 
开发者ID:myunusov,项目名称:maxur-ldoc,代码行数:13,代码来源:SubDomain.java


示例3: getProducesValue

import com.sun.javadoc.AnnotationValue; //导入依赖的package包/类
private Set<String> getProducesValue(final AnnotationDesc[] annotations) {
	Set<String> result = new HashSet<String>();
	AnnotationDesc annotation = DocletUtility.findAnnotation(annotations, Produces.class);
	if (null != annotation) {
		AnnotationValue[] values = (AnnotationValue[]) DocletUtility.getAnnotationValue(annotation);
		if (null != values) {
			for (AnnotationValue value : values) {
				result.add(value.value().toString());
			}
		}
	}
	return result;
}
 
开发者ID:azuki-framework,项目名称:azuki-doclet-jaxrs,代码行数:14,代码来源:JAXRSDocletParser.java


示例4: getConsumesValue

import com.sun.javadoc.AnnotationValue; //导入依赖的package包/类
private Set<String> getConsumesValue(final AnnotationDesc[] annotations) {
	Set<String> result = new HashSet<String>();
	AnnotationDesc annotation = DocletUtility.findAnnotation(annotations, Consumes.class);
	if (null != annotation) {
		AnnotationValue[] values = (AnnotationValue[]) DocletUtility.getAnnotationValue(annotation);
		if (null != values) {
			for (AnnotationValue value : values) {
				result.add(value.value().toString());
			}
		}
	}
	return result;
}
 
开发者ID:azuki-framework,项目名称:azuki-doclet-jaxrs,代码行数:14,代码来源:JAXRSDocletParser.java


示例5: processAnnotationValue

import com.sun.javadoc.AnnotationValue; //导入依赖的package包/类
/**
 * @return the full JSON for the given annotation type
 */
protected JSONObject processAnnotationValue(AnnotationValue annoValue) {
    
    if (annoValue == null) {
        return null;
    }
    
    JSONObject retMe = new JSONObject();
    retMe.put( "toString", annoValue.toString() );
    
    return retMe;
}
 
开发者ID:rob4lderman,项目名称:javadoc-json-doclet,代码行数:15,代码来源:JsonDoclet.java


示例6: resolveAnnotationValue

import com.sun.javadoc.AnnotationValue; //导入依赖的package包/类
private static List<String> resolveAnnotationValue(AnnotationValue value) {
    List<String> retVal = new ArrayList<String>();
    /**
     * TODO using recursion here is probably flawed.
     */
    if (value.value() instanceof AnnotationValue[])
        for (AnnotationValue annotationValue : (AnnotationValue[])value.value())
            retVal.addAll(resolveAnnotationValue(annotationValue));
    else {
        retVal.add(value.value().toString());

    }

    return retVal;
}
 
开发者ID:calrissian,项目名称:rest-doclet,代码行数:16,代码来源:AnnotationUtils.java


示例7: parseAnnotationTypeElementDoc

import com.sun.javadoc.AnnotationValue; //导入依赖的package包/类
/**
 * Parse the elements of an annotation
 * 
 * @param element
 *            A AnnotationTypeElementDoc instance
 * @return the annotation element node
 */
protected AnnotationElement parseAnnotationTypeElementDoc(AnnotationTypeElementDoc annotationTypeElementDoc) {
  AnnotationElement annotationElementNode = objectFactory.createAnnotationElement();
  annotationElementNode.setName(annotationTypeElementDoc.name());
  annotationElementNode.setIdentifier(parseIdentifier((Doc) annotationTypeElementDoc));
  annotationElementNode.setId(annotationTypeElementDoc.name());
  annotationElementNode.setFull(annotationTypeElementDoc.qualifiedName());
  annotationElementNode.setComment(parseComment(annotationTypeElementDoc));

  AnnotationValue value = annotationTypeElementDoc.defaultValue();
  if (value != null) {
    annotationElementNode.setDefault(value.toString());
  }

  Tag[] tags;
  SeeTag[] seeTags;

  tags = annotationTypeElementDoc.tags("@deprecated");
  if (tags.length > 0) {
    annotationElementNode.setDeprecated(parseComment(tags[0]));
  }

  tags = annotationTypeElementDoc.tags("@since");
  if (tags.length > 0) {
    annotationElementNode.setSince(tags[0].text());
  }

  tags = annotationTypeElementDoc.tags("@version");
  if (tags.length > 0) {
    annotationElementNode.setVersion(tags[0].text());
  }

  Return returnNode = objectFactory.createReturn();

  tags = annotationTypeElementDoc.tags("@return");
  if (tags.length > 0) {
    returnNode.setComment(parseComment(tags[0]));
  }

  returnNode.setType(parseTypeInfo(annotationTypeElementDoc.returnType()));

  annotationElementNode.setReturn(returnNode);

  seeTags = annotationTypeElementDoc.seeTags();
  for (int i = 0; i < seeTags.length; i++) {
    annotationElementNode.getLink().add(parseLink(seeTags[i]));
  }

  return annotationElementNode;
}
 
开发者ID:riptano,项目名称:xml-doclet,代码行数:57,代码来源:Parser.java



注:本文中的com.sun.javadoc.AnnotationValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DialogEvent类代码示例发布时间:2022-05-22
下一篇:
Java Command类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap