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


Java XsdTypeMapper.getJavaToXsdMapping方法代码示例

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


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

示例1: findTypeNameUncached

import com.evolveum.midpoint.prism.xml.XsdTypeMapper; //导入方法依赖的package包/类
private QName findTypeNameUncached(Field field, Class contentClass, String schemaNamespace) {
      if (field != null) {
	XmlSchemaType xmlSchemaType = field.getAnnotation(XmlSchemaType.class);
          if (xmlSchemaType != null) {
              return new QName(xmlSchemaType.namespace(), xmlSchemaType.name());
          }
      }
      QName typeName = XsdTypeMapper.getJavaToXsdMapping(contentClass);
      if (typeName != null) {
      	return typeName;
}
// TODO the following code is similar to determineTypeForClass
XmlType xmlType = (XmlType) contentClass.getAnnotation(XmlType.class);
if (xmlType != null) {
	String propTypeLocalPart = xmlType.name();
	String propTypeNamespace = xmlType.namespace();
	if (propTypeNamespace.equals(BeanMarshaller.DEFAULT_PLACEHOLDER)) {
		PrismSchema schema = prismContext.getSchemaRegistry().findSchemaByCompileTimeClass(contentClass);
		if (schema != null && schema.getNamespace() != null) {
			propTypeNamespace = schema.getNamespace();		// should be non-null for properly initialized schemas
		} else {
			// schemaNamespace is only a poor indicator of required namespace (consider e.g. having c:UserType in apit:ObjectListType)
			// so we use it only if we couldn't find anything else
			propTypeNamespace = schemaNamespace;
		}
	}
	return new QName(propTypeNamespace, propTypeLocalPart);
}
return null;
  }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:31,代码来源:PrismBeanInspector.java

示例2: setValue

import com.evolveum.midpoint.prism.xml.XsdTypeMapper; //导入方法依赖的package包/类
public void setValue(T value, QName typeQName) {
       if (value != null) {
           if (typeQName == null) {
               // last desperate attempt to determine type name from the value type
               typeQName = XsdTypeMapper.getJavaToXsdMapping(value.getClass());
               if (typeQName == null) {
                   throw new IllegalStateException("Cannot determine type QName for a value of '" + value + "'");            // todo show only class? (security/size reasons)
               }
           }
		this.setTypeQName(typeQName);
       }
	this.value = value;
       this.valueParser = null;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:15,代码来源:PrimitiveXNode.java

示例3: findTypeNameUncached

import com.evolveum.midpoint.prism.xml.XsdTypeMapper; //导入方法依赖的package包/类
private QName findTypeNameUncached(Field field, Class contentClass, String schemaNamespace) {
  	if (RawType.class.equals(contentClass)) {
  		// RawType is a meta-type. We do not really want to use field types of RawType class.
  		return null;
  	}
      if (field != null) {
	XmlSchemaType xmlSchemaType = field.getAnnotation(XmlSchemaType.class);
          if (xmlSchemaType != null) {
              return new QName(xmlSchemaType.namespace(), xmlSchemaType.name());
          }
      }
      QName typeName = XsdTypeMapper.getJavaToXsdMapping(contentClass);
      if (typeName != null) {
      	return typeName;
}
// TODO the following code is similar to determineTypeForClass
XmlType xmlType = (XmlType) contentClass.getAnnotation(XmlType.class);
if (xmlType != null) {
	String propTypeLocalPart = xmlType.name();
	String propTypeNamespace = xmlType.namespace();
	if (propTypeNamespace.equals(BeanMarshaller.DEFAULT_PLACEHOLDER)) {
		PrismSchema schema = prismContext.getSchemaRegistry().findSchemaByCompileTimeClass(contentClass);
		if (schema != null && schema.getNamespace() != null) {
			propTypeNamespace = schema.getNamespace();		// should be non-null for properly initialized schemas
		} else {
			// schemaNamespace is only a poor indicator of required namespace (consider e.g. having c:UserType in apit:ObjectListType)
			// so we use it only if we couldn't find anything else
			propTypeNamespace = schemaNamespace;
		}
	}
	return new QName(propTypeNamespace, propTypeLocalPart);
}
return null;
  }
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:35,代码来源:PrismBeanInspector.java


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