org.eclipse.persistence.oxm.XMLField.isTypedTextField()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中org.eclipse.persistence.oxm.XMLField.isTypedTextField()方法的一些代码示例,展示了XMLField.isTypedTextField()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLField.isTypedTextField()方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.XMLField
类名称:XMLField
方法名:isTypedTextField

XMLField.isTypedTextField介绍

[英]Returns if the field is a typed text field True when we should base conversions on the "type" attribute on elements
[中]当我们应该基于元素的“type”属性进行转换时,如果字段是类型化文本字段,则返回True

代码示例

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

if (!field.isTypedTextField()) {
  return;

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

private QName getSchemaType(XMLField xmlField, Object value, AbstractSession session) {
  QName schemaType = null;
  if (xmlField.isTypedTextField()) {
    schemaType = xmlField.getXMLType(value.getClass());
  } else if (xmlField.isUnionField()) {
    return getSchemaTypeForUnion((XMLUnionField) xmlField, value, session);
  } else if (xmlField.getSchemaType() != null) {
    schemaType = xmlField.getSchemaType();
  }
  return schemaType;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected void updateNamespaces(QName qname, MarshalRecord marshalRecord, XMLField xmlField){
  if (qname != null){        
    if(xmlField != null){
      if(xmlField.isTypedTextField()){           
        if(xmlField.getSchemaType() == null){
          if(qname.equals(XMLConstants.STRING_QNAME)){

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

private Object convertValue(Element node, XMLField key, Object value) {
  XMLConversionManager xmlCnvMgr = (XMLConversionManager) session.getDatasourcePlatform().getConversionManager();
  if (key.isTypedTextField() && (node != null)) {
    String schemaType = node.getAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL, XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
    if ((null != schemaType) && (schemaType.length() > 0)) {
      QName qname = null;
      int index = schemaType.indexOf(XMLConstants.COLON);
      if (index == -1) {
        qname = new QName(schemaType);
        Class convertClass = key.getJavaClass(qname);
        return xmlCnvMgr.convertObject(value, convertClass);
      } else {
        String prefix = schemaType.substring(0, index);
        String localPart = schemaType.substring(index + 1);
        XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
        String url = xmlPlatform.resolveNamespacePrefix(node, prefix);
        qname = new QName(url, localPart);
        Class convertClass = key.getJavaClass(qname);
        return xmlCnvMgr.convertObject(value, convertClass, qname);
      }
    }
  }
  currentNode = node;
  Object convertedValue = key.convertValueBasedOnSchemaType(value, xmlCnvMgr, this);
  currentNode = getDOM();
  return convertedValue;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Return a QName representation the schema type for a given XMLField, if
 * applicable.
 * 
 * Note:  This method performs the same functionality as 'getSchemaType' in 
 * org.eclipse.persistence.internal.oxm.XMLSimpleMappingNodeValue.
 * 
 * @param xmlField
 * @param value
 * @return
 */
protected QName getSchemaType(XMLField xmlField, Object value, AbstractSession session) {
  QName schemaType = null;
  if (xmlField.isTypedTextField()) {
    schemaType = xmlField.getXMLType(value.getClass());
  } else if (xmlField.isUnionField()) {
    return getSingleValueToWriteForUnion((XMLUnionField) xmlField, value, session);
  } else if (xmlField.getSchemaType() != null) {
    schemaType = xmlField.getSchemaType();
  }
  return schemaType;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected QName getSchemaType(XMLField xmlField, Object value, AbstractSession session) {
  QName schemaType = null;
  if(xmlField.getLeafElementType() != null){
    schemaType = xmlField.getLeafElementType();
  }else if (xmlField.isTypedTextField()) {
    schemaType = xmlField.getXMLType(value.getClass());
  } else if (xmlField.isUnionField()) {
    return getSingleValueToWriteForUnion((XMLUnionField) xmlField, value, session);
  } else if (xmlField.getSchemaType() != null) {
    schemaType = xmlField.getSchemaType();
  }
  return schemaType;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

if (xmlField.isTypedTextField()) {

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Return a QName representation the schema type for a given XMLField, if
 * applicable.
 *
 * Note:  This method performs the same functionality as 'getSchemaType' in
 * org.eclipse.persistence.internal.oxm.XMLSimpleMappingNodeValue.
 *
 * @param xmlField
 * @param value
 * @return
 */
protected QName getSchemaType(XMLField xmlField, Object value, AbstractSession session) {
  QName schemaType = null;
  if (xmlField.isTypedTextField()) {
    ConversionManager conversionManager = (ConversionManager) session.getDatasourcePlatform().getConversionManager();
    schemaType = xmlField.getXMLType(value.getClass(), conversionManager);
  } else if (xmlField.isUnionField()) {
    return getSingleValueToWriteForUnion((XMLUnionField) xmlField, value, session);
  } else if (xmlField.getSchemaType() != null) {
    schemaType = xmlField.getSchemaType();
  }
  return schemaType;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * Return a QName representation the schema type for a given XMLField, if
 * applicable.
 * 
 * Note:  This method performs the same functionality as 'getSchemaType' in 
 * org.eclipse.persistence.internal.oxm.XMLSimpleMappingNodeValue.
 * 
 * @param xmlField
 * @param value
 * @return
 */
protected QName getSchemaType(XMLField xmlField, Object value, AbstractSession session) {
  QName schemaType = null;
  if (xmlField.isTypedTextField()) {
    ConversionManager conversionManager = (ConversionManager) session.getDatasourcePlatform().getConversionManager();
    schemaType = xmlField.getXMLType(value.getClass(), conversionManager);
  } else if (xmlField.isUnionField()) {
    return getSingleValueToWriteForUnion((XMLUnionField) xmlField, value, session);
  } else if (xmlField.getSchemaType() != null) {
    schemaType = xmlField.getSchemaType();
  }
  return schemaType;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

}else if (xmlField.isUnionField()) {
  return getValueToWriteForUnion((XMLUnionField)xmlField, value, session);
}else if (xmlField.isTypedTextField()) {
  schemaType = xmlField.getXMLType(value.getClass());
}else if (xmlField.getSchemaType() != null) {

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

Object textValue = getValueToWrite(value, xmlField, session);
if (textValue instanceof String) {
  if (xmlField.isTypedTextField()) {
    XMLNodeList createdElements = new XMLNodeList();
    createdElements.add(element);

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

if (xmlField.isTypedTextField()) {
  addTypeAttributes(createdElements, xmlField, value, resolveNamespacePrefixForURI(XMLConstants.SCHEMA_INSTANCE_URL, getNamespaceResolverForField(xmlField)));

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

addChild(null, mappingNodeValue, xmlDescriptor.getNamespaceResolver());
if (xmlMapping.isAbstractDirectMapping() && xmlField.isTypedTextField()) {
  XPathFragment nextFragment = xmlField.getXPathFragment();
  String typeXPath = XMLConstants.EMPTY_STRING;

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

marshalRecord.closeStartElement();
} else {
  if (xmlField.isTypedTextField()) {
    updateNamespaces(schemaType, marshalRecord, xmlField);

相关文章