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

Java AnnotationTarget类代码示例

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

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



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


示例16: parserJoinColumnList

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserJoinColumnList(List<JaxbJoinColumn> joinColumnList, AnnotationTarget target) {
	if ( MockHelper.isNotEmpty( joinColumnList ) ) {
		if ( joinColumnList.size() == 1 ) {
			return parserJoinColumn( joinColumnList.get( 0 ), target );
		}
		else {
			AnnotationValue[] values = nestedJoinColumnList( "value", joinColumnList, null );
			return create(
					JOIN_COLUMNS,
					target,
					values
			);
		}
	}
	return null;

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


示例17: getTargetFromAttributeAccessType

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationTarget getTargetFromAttributeAccessType(JaxbAccessType accessType) {
	if ( accessType == null ) {
		throw new IllegalArgumentException( "access type can't be null." );
	}
	switch ( accessType ) {
		case FIELD:
			return MockHelper.getTarget(
					indexBuilder.getServiceRegistry(),
					classInfo,
					getFieldName(),
					MockHelper.TargetType.FIELD
			);
		case PROPERTY:
			return MockHelper.getTarget(
					indexBuilder.getServiceRegistry(),
					classInfo,
					getFieldName(),
					MockHelper.TargetType.PROPERTY
			);
		default:
			throw new HibernateException( "can't determin access type [" + accessType + "]" );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:PropertyMocker.java


示例18: parserMapKeyColumn

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


示例19: parserMapKeyJoinColumnList

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
protected AnnotationInstance parserMapKeyJoinColumnList(List<JaxbMapKeyJoinColumn> joinColumnList, AnnotationTarget target) {
	if ( MockHelper.isNotEmpty( joinColumnList ) ) {
		if ( joinColumnList.size() == 1 ) {
			return parserMapKeyJoinColumn( joinColumnList.get( 0 ), target );
		}
		else {
			AnnotationValue[] values = nestedMapKeyJoinColumnList( "value", joinColumnList, null );
			return create(
					MAP_KEY_JOIN_COLUMNS,
					target,
					values
			);
		}
	}
	return null;

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


示例20: parserMapKeyJoinColumn

import org.jboss.jandex.AnnotationTarget; //导入依赖的package包/类
private AnnotationInstance parserMapKeyJoinColumn(JaxbMapKeyJoinColumn 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( MAP_KEY_JOIN_COLUMN, target, annotationValueList );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:PropertyMocker.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java EdgeLabelRenderer类代码示例发布时间:2022-05-22
下一篇:
Java DefaultSchemaLdifExtractor类代码示例发布时间: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