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


Java AnnotationTarget类代码示例

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


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

示例1: process

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
private void process(Map<String, String> paths, String className, List<AnnotationInstance> annotations)
		throws MojoExecutionException {
	AnnotationInstance rootAnnotation = getRootAnnotation(annotations);

	processRootAnnotation(paths, className, rootAnnotation);

	String pathInClass = getRootPath(rootAnnotation);

	for (AnnotationInstance annotation : annotations) {
		AnnotationValue value = annotation.value();
		if (value != null) {
			if (annotation.target().kind() != (AnnotationTarget.Kind.CLASS)) {
				MethodInfo annotatedMethod = annotation.target().asMethod();
				String path = new String();
				path = addHttpVerb(path, annotatedMethod);
				path = addProducer(path, annotatedMethod);
				path = addConsumer(path, annotatedMethod);
				String fullPath = path.concat(
						pathInClass != null ? pathInClass.concat("/").concat(value.asString()) : value.asString());
				addInPaths(paths, className, fullPath);
			}
		}
	}
}
 
开发者ID:ContaAzul,项目名称:jaxrs-path-analyzer,代码行数:25,代码来源:PathAnalyzer.java

示例2: findTransientFieldAndMethodNames

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
/**
 * Populates the sets of transient field and method names.
 */
private void findTransientFieldAndMethodNames() {
	List<AnnotationInstance> transientMembers = classInfo.annotations().get( JPADotNames.TRANSIENT );
	if ( transientMembers == null ) {
		return;
	}

	for ( AnnotationInstance transientMember : transientMembers ) {
		AnnotationTarget target = transientMember.target();
		if ( target instanceof FieldInfo ) {
			transientFieldNames.add( ( (FieldInfo) target ).name() );
		}
		else {
			transientMethodNames.add( ( (MethodInfo) target ).name() );
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:ConfiguredClass.java

示例3: parserSecondaryTable

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserSecondaryTable(JaxbSecondaryTable secondaryTable, AnnotationTarget target) {
	if ( secondaryTable == null ) {
		return null;
	}
	DefaultConfigurationHelper.INSTANCE.applyDefaults(
			new SchemaAware.SecondaryTableSchemaAware( secondaryTable ),
			getDefaults()
	);
	List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
	MockHelper.stringValue( "name", secondaryTable.getName(), annotationValueList );
	MockHelper.stringValue( "catalog", secondaryTable.getCatalog(), annotationValueList );
	MockHelper.stringValue( "schema", secondaryTable.getSchema(), annotationValueList );
	nestedPrimaryKeyJoinColumnList(
			"pkJoinColumns", secondaryTable.getPrimaryKeyJoinColumn(), annotationValueList
	);
	nestedUniqueConstraintList(
			"uniqueConstraints", secondaryTable.getUniqueConstraint(), annotationValueList
	);
	return
			create(
					SECONDARY_TABLE, target, annotationValueList
			);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:EntityMocker.java

示例4: parserSecondaryTableList

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserSecondaryTableList(List<JaxbSecondaryTable> primaryKeyJoinColumnList, AnnotationTarget target) {
	if ( MockHelper.isNotEmpty( primaryKeyJoinColumnList ) ) {
		if ( primaryKeyJoinColumnList.size() == 1 ) {
			return parserSecondaryTable( primaryKeyJoinColumnList.get( 0 ), target );
		}
		else {
			return create(
					SECONDARY_TABLES,
					target,
					nestedSecondaryTableList( "value", primaryKeyJoinColumnList, null )
			);
		}
	}
	return null;

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:EntityMocker.java

示例5: targetEquals

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
/**
 * @param t1 can't be null
 * @param t2 can't be null
 */
public static boolean targetEquals(AnnotationTarget t1, AnnotationTarget t2) {
	if ( t1 == t2 ) {
		return true;
	}
	if ( t1 != null && t2 != null ) {

		if ( t1.getClass() == t2.getClass() ) {
			if ( t1.getClass() == ClassInfo.class ) {
				return ( (ClassInfo) t1 ).name().equals( ( (ClassInfo) t2 ).name() );
			}
			else if ( t1.getClass() == MethodInfo.class ) {
				return ( (MethodInfo) t1 ).name().equals( ( (MethodInfo) t2 ).name() );
			}
			else {
				return ( (FieldInfo) t1 ).name().equals( ( (FieldInfo) t2 ).name() );
			}
		}
	}
	return false;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:MockHelper.java

示例6: processIdAnnotations

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
private static JaxbAccessType processIdAnnotations(List<AnnotationInstance> idAnnotations) {
	JaxbAccessType accessType = null;
	for ( AnnotationInstance annotation : idAnnotations ) {
		AnnotationTarget tmpTarget = annotation.target();
		if ( tmpTarget == null ) {
			throw new AssertionFailure( "@Id has no AnnotationTarget, this is mostly a internal error." );
		}
		if ( accessType == null ) {
			accessType = annotationTargetToAccessType( tmpTarget );
		}
		else {
			if ( !accessType.equals( annotationTargetToAccessType( tmpTarget ) ) ) {
				throw new MappingException( "Inconsistent placement of @Id annotation within hierarchy " );
			}
		}
	}
	return accessType;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AccessHelper.java

示例7: parserJoinTable

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserJoinTable(JaxbJoinTable joinTable, AnnotationTarget target) {
	if ( joinTable == null ) {
		return null;
	}
	DefaultConfigurationHelper.INSTANCE.applyDefaults(
			new SchemaAware.JoinTableSchemaAware( joinTable ),
			getDefaults()
	);
	List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
	MockHelper.stringValue( "name", joinTable.getName(), annotationValueList );
	MockHelper.stringValue( "catalog", joinTable.getCatalog(), annotationValueList );
	MockHelper.stringValue( "schema", joinTable.getSchema(), annotationValueList );
	nestedJoinColumnList( "joinColumns", joinTable.getJoinColumn(), annotationValueList );
	nestedJoinColumnList(
			"inverseJoinColumns", joinTable.getInverseJoinColumn(), annotationValueList
	);
	nestedUniqueConstraintList(
			"uniqueConstraints", joinTable.getUniqueConstraint(), annotationValueList
	);
	return create( JOIN_TABLE, target, annotationValueList );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AnnotationMocker.java

示例8: parserAssociationOverride

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
private AnnotationInstance parserAssociationOverride(JaxbAssociationOverride associationOverride, AnnotationTarget target) {
	if ( associationOverride == null ) {
		return null;
	}
	List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
	MockHelper.stringValue( "name", associationOverride.getName(), annotationValueList );
	if ( associationOverride instanceof JaxbAssociationOverrideProxy ) {
		JaxbAssociationOverrideProxy proxy = (JaxbAssociationOverrideProxy) associationOverride;
		MockHelper.addToCollectionIfNotNull( annotationValueList, proxy.getJoinColumnsAnnotationValue() );
		MockHelper.addToCollectionIfNotNull( annotationValueList, proxy.getJoinTableAnnotationValue() );
	}
	else {
		nestedJoinColumnList(
				"joinColumns", associationOverride.getJoinColumn(), annotationValueList
		);
		MockHelper.nestedAnnotationValue(
				"joinTable", parserJoinTable( associationOverride.getJoinTable(), null ), annotationValueList
		);
	}
	return create( ASSOCIATION_OVERRIDE, target, annotationValueList );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AnnotationMocker.java

示例9: parserColumn

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserColumn(JaxbColumn column, AnnotationTarget target) {
	if ( column == null ) {
		return null;
	}
	List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
	MockHelper.stringValue( "name", column.getName(), annotationValueList );
	MockHelper.stringValue( "columnDefinition", column.getColumnDefinition(), annotationValueList );
	MockHelper.stringValue( "table", column.getTable(), annotationValueList );
	MockHelper.booleanValue( "unique", column.isUnique(), annotationValueList );
	MockHelper.booleanValue( "nullable", column.isNullable(), annotationValueList );
	MockHelper.booleanValue( "insertable", column.isInsertable(), annotationValueList );
	MockHelper.booleanValue( "updatable", column.isUpdatable(), annotationValueList );
	MockHelper.integerValue( "length", column.getLength(), annotationValueList );
	MockHelper.integerValue( "precision", column.getPrecision(), annotationValueList );
	MockHelper.integerValue( "scale", column.getScale(), annotationValueList );
	return create( COLUMN, target, annotationValueList );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:AnnotationMocker.java

示例10: parserAttributeOverride

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
private AnnotationInstance parserAttributeOverride(JaxbAttributeOverride attributeOverride, AnnotationTarget target) {
	if ( attributeOverride == null ) {
		return null;
	}
	List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
	MockHelper.stringValue( "name", attributeOverride.getName(), annotationValueList );
	if ( attributeOverride instanceof JaxbAttributeOverrideProxy ) {
		JaxbAttributeOverrideProxy proxy = (JaxbAttributeOverrideProxy) attributeOverride;
		MockHelper.addToCollectionIfNotNull( annotationValueList, proxy.getColumnAnnotationValue() );
	}
	else {
		MockHelper.nestedAnnotationValue(
				"column", parserColumn( attributeOverride.getColumn(), null ), annotationValueList
		);
	}
	return
			create(
					ATTRIBUTE_OVERRIDE, target, annotationValueList

			);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AnnotationMocker.java

示例11: parserJoinColumn

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserJoinColumn(JaxbJoinColumn column, AnnotationTarget target) {
	if ( column == null ) {
		return null;
	}
	List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
	MockHelper.stringValue( "name", column.getName(), annotationValueList );
	MockHelper.stringValue( "columnDefinition", column.getColumnDefinition(), annotationValueList );
	MockHelper.stringValue( "table", column.getTable(), annotationValueList );
	MockHelper.stringValue(
			"referencedColumnName", column.getReferencedColumnName(), annotationValueList
	);
	MockHelper.booleanValue( "unique", column.isUnique(), annotationValueList );
	MockHelper.booleanValue( "nullable", column.isNullable(), annotationValueList );
	MockHelper.booleanValue( "insertable", column.isInsertable(), annotationValueList );
	MockHelper.booleanValue( "updatable", column.isUpdatable(), annotationValueList );
	return create( JOIN_COLUMN, target, annotationValueList );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:AnnotationMocker.java

示例12: parserPrimaryKeyJoinColumn

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserPrimaryKeyJoinColumn(JaxbPrimaryKeyJoinColumn primaryKeyJoinColumn, AnnotationTarget target) {
	if ( primaryKeyJoinColumn == null ) {
		return null;
	}
	List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
	MockHelper.stringValue( "name", primaryKeyJoinColumn.getName(), annotationValueList );
	MockHelper.stringValue(
			"referencedColumnName", primaryKeyJoinColumn.getReferencedColumnName(), annotationValueList
	);
	MockHelper.stringValue(
			"columnDefinition", primaryKeyJoinColumn.getColumnDefinition(), annotationValueList
	);
	return
			create(
					PRIMARY_KEY_JOIN_COLUMN, target, annotationValueList

			);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AnnotationMocker.java

示例13: parserPrimaryKeyJoinColumnList

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserPrimaryKeyJoinColumnList(List<JaxbPrimaryKeyJoinColumn> primaryKeyJoinColumnList, AnnotationTarget target) {
	if ( MockHelper.isNotEmpty( primaryKeyJoinColumnList ) ) {
		if ( primaryKeyJoinColumnList.size() == 1 ) {
			return parserPrimaryKeyJoinColumn( primaryKeyJoinColumnList.get( 0 ), target );
		}
		else {
			return create(
					PRIMARY_KEY_JOIN_COLUMNS,
					target,
					nestedPrimaryKeyJoinColumnList( "value", primaryKeyJoinColumnList, null )
			);
		}
	}

	return null;

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:AnnotationMocker.java

示例14: getAnnotationInstanceByTarget

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected void getAnnotationInstanceByTarget(DotName annName, AnnotationTarget target, Operation operation) {
	Map<DotName, List<AnnotationInstance>> annotatedMap = indexBuilder.getIndexedAnnotations( getTargetName() );
	if ( !annotatedMap.containsKey( annName ) ) {
		return;
	}
	List<AnnotationInstance> annotationInstanceList = annotatedMap.get( annName );
	if ( MockHelper.isNotEmpty( annotationInstanceList ) ) {
		for ( AnnotationInstance annotationInstance : annotationInstanceList ) {
			AnnotationTarget annotationTarget = annotationInstance.target();
			if ( MockHelper.targetEquals( target, annotationTarget ) ) {
				if ( operation.process( annotationInstance ) ) {
					return;
				}
			}
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:AnnotationMocker.java

示例15: parserCollectionTable

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserCollectionTable(JaxbCollectionTable collectionTable, AnnotationTarget target) {
	if ( collectionTable == null ) {
		return null;
	}
	DefaultConfigurationHelper.INSTANCE.applyDefaults(
			new SchemaAware.CollectionTableSchemaAware( collectionTable ),
			getDefaults()
	);
	List<AnnotationValue> annotationValueList = new ArrayList<AnnotationValue>();
	MockHelper.stringValue( "name", collectionTable.getName(), annotationValueList );
	MockHelper.stringValue( "catalog", collectionTable.getCatalog(), annotationValueList );
	MockHelper.stringValue( "schema", collectionTable.getSchema(), annotationValueList );
	nestedJoinColumnList( "joinColumns", collectionTable.getJoinColumn(), annotationValueList );
	nestedUniqueConstraintList( "uniqueConstraints", collectionTable.getUniqueConstraint(), annotationValueList );
	return create( COLLECTION_TABLE, target, annotationValueList );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:AnnotationMocker.java


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