当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationMemberValue类代码示例

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


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

示例1: getApiParamAnnotations

import javassist.bytecode.annotation.AnnotationMemberValue; //导入依赖的package包/类
/**
 * Returns the api parameter annotations
 * 
 * @return
 */
protected Annotation getApiParamAnnotations() {
	Annotation implicitParams = new Annotation(ApiImplicitParams.class.getCanonicalName(), ctClass.getClassFile().getConstPool());
	List<AnnotationMemberValue> annotationMemberValues = new ArrayList<AnnotationMemberValue>();
	List<Annotation> annotations = Lists.newArrayList();
	annotations.addAll(getApiPathParamAnnotations());
	annotations.addAll(getApiQueryParamAnnotations());
	annotations.addAll(getApiAdditionalParamAnnotations());
	for (Annotation annotation : annotations) {
		annotationMemberValues.add(new AnnotationMemberValue(annotation, ctClass.getClassFile().getConstPool()));
	}
	ArrayMemberValue values = new ArrayMemberValue(ctClass.getClassFile().getConstPool());
	values.setValue(annotationMemberValues.toArray(new AnnotationMemberValue[0]));
	implicitParams.addMemberValue("value", values);
	return implicitParams;
}
 
开发者ID:minnal,项目名称:minnal,代码行数:21,代码来源:AbstractMethodCreator.java

示例2: getExistingXmlJavaTypeAdapters

import javassist.bytecode.annotation.AnnotationMemberValue; //导入依赖的package包/类
/**
 * A narrow-purpose helper method that accepts an {@link
 * ArrayMemberValue} parameter whose value is (semantically) the
 * return value of the {@link XmlJavaTypeAdapters#value()}
 * annotation attribute, and returns a {@link Map} of {@link
 * Annotation} objects representing {@link XmlJavaTypeAdapter}
 * annotations indexed by the {@linkplain XmlJavaTypeAdapter#type()
 * types} that each of them governs.
 *
 * <p>This method never returns {@code null}.</p>
 *
 * @param adaptersHolder the {@link ArrayMemberValue} that resulted
 * from calling {@link Annotation#getMemberValue(String)
 * Annotation#getMemberValue("value")} on an {@link Annotation} that
 * is Javassist's representation of the {@link XmlJavaTypeAdapters}
 * annotation.  This parameter may be {@code null}.
 *
 * @return a {@link Map} of {@link Annotation} objects representing
 * {@link XmlJavaTypeAdapter} annotations indexed by the {@linkplain
 * XmlJavaTypeAdapter#type() types} that each of them governs; never
 * {@code null}
 */
private static final Map<String, Annotation> getExistingXmlJavaTypeAdapters(final ArrayMemberValue adaptersHolder) {
  // Build a Map indexing existing @XmlJavaTypeAdapter annotations
  // by the types that they govern.
  final Map<String, Annotation> xmlJavaTypeAdapters = new HashMap<String, Annotation>();
  if (adaptersHolder != null) {
    final MemberValue[] rawMemberValue = adaptersHolder.getValue();
    if (rawMemberValue != null && rawMemberValue.length > 0) {
      for (final MemberValue mv : rawMemberValue) {
        if (mv instanceof AnnotationMemberValue) {
          final Annotation xmlJavaTypeAdapter = ((AnnotationMemberValue)mv).getValue();
          if (xmlJavaTypeAdapter != null && XmlJavaTypeAdapter.class.getName().equals(xmlJavaTypeAdapter.getTypeName())) {
            final ClassMemberValue typeHolder = (ClassMemberValue)xmlJavaTypeAdapter.getMemberValue("type");
            if (typeHolder != null) {
              final String interfaceTypeName = typeHolder.getValue();
              if (interfaceTypeName != null) {
                xmlJavaTypeAdapters.put(interfaceTypeName, xmlJavaTypeAdapter);
              }
            }
          }
        }
      }
    }
  }
  return xmlJavaTypeAdapters;
}
 
开发者ID:ljnelson,项目名称:jaxb-tools,代码行数:48,代码来源:PackageInfoModifier.java

示例3: getApiResponsesAnnotation

import javassist.bytecode.annotation.AnnotationMemberValue; //导入依赖的package包/类
protected Annotation getApiResponsesAnnotation() {
	Annotation apiResponses = new Annotation(ApiResponses.class.getCanonicalName(), ctClass.getClassFile().getConstPool());
	ArrayMemberValue values = new ArrayMemberValue(ctClass.getClassFile().getConstPool());
	List<AnnotationMemberValue> memberValues = new ArrayList<AnnotationMemberValue>();
	for (Annotation annotation : getApiResponseAnnotations()) {
		memberValues.add(new AnnotationMemberValue(annotation, ctClass.getClassFile().getConstPool()));
	}
	values.setValue(memberValues.toArray(new AnnotationMemberValue[0]));
	apiResponses.addMemberValue("value", values);
	return apiResponses;
}
 
开发者ID:minnal,项目名称:minnal,代码行数:12,代码来源:AbstractMethodCreator.java

示例4: visitAnnotationMemberValue

import javassist.bytecode.annotation.AnnotationMemberValue; //导入依赖的package包/类
@Override
public void visitAnnotationMemberValue(AnnotationMemberValue node) {
  values.add(String.valueOf(node.getValue()));
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:ClassPathScanner.java

示例5: visitAnnotationMemberValue

import javassist.bytecode.annotation.AnnotationMemberValue; //导入依赖的package包/类
@Override
public void visitAnnotationMemberValue(AnnotationMemberValue node) {

}
 
开发者ID:aschattney,项目名称:annotated-mvp,代码行数:5,代码来源:ByteCodeProcessor.java


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