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


Java XSComplexType.getName方法代码示例

本文整理汇总了Java中com.sun.xml.xsom.XSComplexType.getName方法的典型用法代码示例。如果您正苦于以下问题:Java XSComplexType.getName方法的具体用法?Java XSComplexType.getName怎么用?Java XSComplexType.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.xml.xsom.XSComplexType的用法示例。


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

示例1: complexType

import com.sun.xml.xsom.XSComplexType; //导入方法依赖的package包/类
@Override
public QName complexType(final XSComplexType type) {
	if (type.getName() == null) {
		return new QName(type.getTargetNamespace(), "anonymousComplexType");
	} else {
		return new QName(type.getTargetNamespace(), type.getName());
	}
}
 
开发者ID:mklemm,项目名称:jaxb2-rich-contract-plugin,代码行数:9,代码来源:MetaPlugin.java

示例2: createObjectClassDefinition

import com.sun.xml.xsom.XSComplexType; //导入方法依赖的package包/类
private ComplexTypeDefinition createObjectClassDefinition(XSComplexType complexType,
		PrismContext prismContext, XSAnnotation annotation) throws SchemaException {
	QName typeName = new QName(complexType.getTargetNamespace(),complexType.getName());
	
	ObjectClassComplexTypeDefinitionImpl ocDef = new ObjectClassComplexTypeDefinitionImpl(typeName, prismContext);
	
	// nativeObjectClass
	Element nativeAttrElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_NATIVE_OBJECT_CLASS);
	String nativeObjectClass = nativeAttrElement == null ? null : nativeAttrElement.getTextContent();
	ocDef.setNativeObjectClass(nativeObjectClass);
	
	ShadowKindType kind = null;
	Element kindElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_KIND);
	if (kindElement != null) {
		String kindString = kindElement.getTextContent();
		if (StringUtils.isEmpty(kindString)) {
			throw new SchemaException("The definition of kind is empty in the annotation of object class "+typeName);
		}
		try {
			kind = ShadowKindType.fromValue(kindString);
		} catch (IllegalArgumentException e) {
			throw new SchemaException("Definition of unknown kind '"+kindString+"' in the annotation of object class "+typeName);
		}
		ocDef.setKind(kind);
	}
	
	Boolean defaultInAKind = SchemaProcessorUtil.getAnnotationBooleanMarker(annotation, MidPointConstants.RA_DEFAULT);
	if (defaultInAKind == null) {
		ocDef.setDefaultInAKind(false);
	} else {
		ocDef.setDefaultInAKind(defaultInAKind);
	}
	
	Boolean auxiliary = SchemaProcessorUtil.getAnnotationBooleanMarker(annotation, MidPointConstants.RA_AUXILIARY);
	if (auxiliary == null) {
		ocDef.setAuxiliary(false);
	} else {
		ocDef.setAuxiliary(auxiliary);
	}
	
	String intent = null;
	Element intentElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_INTENT);
	if (intentElement != null) {
		intent = intentElement.getTextContent();
		if (StringUtils.isEmpty(intent)) {
			throw new SchemaException("The definition of intent is empty in the annotation of object class "+typeName);
		}
		ocDef.setIntent(intent);
	}
	
	// accountType: DEPRECATED
	if (isAccountObject(annotation)) {
		if (kind != null && kind != ShadowKindType.ACCOUNT) {
			throw new SchemaException("Conflicting definition of kind and legacy account annotation in the annotation of object class "+typeName);
		}
		ocDef.setKind(ShadowKindType.ACCOUNT);
		Element account = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_ACCOUNT);
		if (account != null && !defaultInAKind) {
			String defaultValue = account.getAttribute("default");
			// Compatibility (DEPRECATED)
			if (defaultValue != null) {
				ocDef.setDefaultInAKind(Boolean.parseBoolean(defaultValue));
			}
		}
		Element accountTypeElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_ACCOUNT_TYPE);
		if (accountTypeElement != null) {
			String accountType = accountTypeElement.getTextContent();
			if (intent != null && !intent.equals(accountType)) {
				throw new SchemaException("Conflicting definition of intent and legacy accountType annotation in the annotation of object class "+typeName);
			}
			ocDef.setIntent(accountType);
		}
	}
			
	return ocDef;

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:78,代码来源:MidPointSchemaDefinitionFactory.java

示例3: complexType

import com.sun.xml.xsom.XSComplexType; //导入方法依赖的package包/类
/**
 * @see com.sun.xml.xsom.visitor.XSFunction#complexType(XSComplexType)
 */
public String complexType(XSComplexType type) {
    String name = type.getName();
    if( name == null ) name = "anonymous";
    return name + " " + nameGetter.complexType( type );
}
 
开发者ID:jolie,项目名称:jolie,代码行数:9,代码来源:ComponentNameFunction.java

示例4: createObjectClassDefinition

import com.sun.xml.xsom.XSComplexType; //导入方法依赖的package包/类
private ComplexTypeDefinition createObjectClassDefinition(XSComplexType complexType,
		PrismContext prismContext, XSAnnotation annotation) throws SchemaException {
	QName typeName = new QName(complexType.getTargetNamespace(),complexType.getName());

	ObjectClassComplexTypeDefinitionImpl ocDef = new ObjectClassComplexTypeDefinitionImpl(typeName, prismContext);

	// nativeObjectClass
	Element nativeAttrElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_NATIVE_OBJECT_CLASS);
	String nativeObjectClass = nativeAttrElement == null ? null : nativeAttrElement.getTextContent();
	ocDef.setNativeObjectClass(nativeObjectClass);

	ShadowKindType kind = null;
	Element kindElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_KIND);
	if (kindElement != null) {
		String kindString = kindElement.getTextContent();
		if (StringUtils.isEmpty(kindString)) {
			throw new SchemaException("The definition of kind is empty in the annotation of object class "+typeName);
		}
		try {
			kind = ShadowKindType.fromValue(kindString);
		} catch (IllegalArgumentException e) {
			throw new SchemaException("Definition of unknown kind '"+kindString+"' in the annotation of object class "+typeName);
		}
		ocDef.setKind(kind);
	}

	Boolean defaultInAKind = SchemaProcessorUtil.getAnnotationBooleanMarker(annotation, MidPointConstants.RA_DEFAULT);
	if (defaultInAKind == null) {
		ocDef.setDefaultInAKind(false);
	} else {
		ocDef.setDefaultInAKind(defaultInAKind);
	}

	Boolean auxiliary = SchemaProcessorUtil.getAnnotationBooleanMarker(annotation, MidPointConstants.RA_AUXILIARY);
	if (auxiliary == null) {
		ocDef.setAuxiliary(false);
	} else {
		ocDef.setAuxiliary(auxiliary);
	}

	String intent = null;
	Element intentElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_INTENT);
	if (intentElement != null) {
		intent = intentElement.getTextContent();
		if (StringUtils.isEmpty(intent)) {
			throw new SchemaException("The definition of intent is empty in the annotation of object class "+typeName);
		}
		ocDef.setIntent(intent);
	}

	// accountType: DEPRECATED
	if (isAccountObject(annotation)) {
		if (kind != null && kind != ShadowKindType.ACCOUNT) {
			throw new SchemaException("Conflicting definition of kind and legacy account annotation in the annotation of object class "+typeName);
		}
		ocDef.setKind(ShadowKindType.ACCOUNT);
		Element account = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_ACCOUNT);
		if (account != null && !defaultInAKind) {
			String defaultValue = account.getAttribute("default");
			// Compatibility (DEPRECATED)
			if (defaultValue != null) {
				ocDef.setDefaultInAKind(Boolean.parseBoolean(defaultValue));
			}
		}
		Element accountTypeElement = SchemaProcessorUtil.getAnnotationElement(annotation, MidPointConstants.RA_ACCOUNT_TYPE);
		if (accountTypeElement != null) {
			String accountType = accountTypeElement.getTextContent();
			if (intent != null && !intent.equals(accountType)) {
				throw new SchemaException("Conflicting definition of intent and legacy accountType annotation in the annotation of object class "+typeName);
			}
			ocDef.setIntent(accountType);
		}
	}

	return ocDef;

}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:78,代码来源:MidPointSchemaDefinitionFactory.java


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