當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。