本文整理汇总了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());
}
}
示例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;
}
示例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 );
}
示例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;
}