gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-19 12:26:40 30 4
gpt4 key购买 nike

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

XMLRoot.getLocalName介绍

暂无

代码示例

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

/**
 * Return the name of the root element.
 * The root element is a global element of the XML Schema
 *   with a type compatible to the DataObject.
 * @return the name of the root element.
 */
public String getRootElementName() {
  return super.getLocalName();
}

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

/**
 * Return the name of the root element.
 * The root element is a global element of the XML Schema
 *   with a type compatible to the DataObject.
 * @return the name of the root element.
 */
public String getRootElementName() {        
  return super.getLocalName();
}

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

while(fragment != null && !fragment.nameIsText()) {
  if(fragment.getNextFragment() == null || fragment.getHasText()) {
    if(fragment.getLocalName().equals(root.getLocalName())) {
      String fragUri = fragment.getNamespaceURI();
      String namespaceUri = root.getNamespaceURI();

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

while(fragment != null && !fragment.nameIsText()) {
  if(fragment.getNextFragment() == null || fragment.getHasText()) {
    if(fragment.getLocalName().equals(root.getLocalName())) {
      String fragUri = fragment.getNamespaceURI();
      String namespaceUri = root.getNamespaceURI();

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

while(fragment != null && !fragment.nameIsText()) {
  if(fragment.getNextFragment() == null || fragment.getHasText()) {
    if(fragment.getLocalName().equals(root.getLocalName())) {
      String fragUri = fragment.getNamespaceURI();
      String namespaceUri = root.getNamespaceURI();

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

public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object value, AbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) {
  if(value instanceof XMLRoot) {
    XMLRoot root = (XMLRoot)value;
    XPathFragment fragment = this.xmlField.getXPathFragment();
    while(fragment != null && !fragment.nameIsText) {
      if(fragment.getNextFragment() == null || fragment.getHasText()) {
        if(fragment.getLocalName().equals(root.getLocalName())) {
          String fragUri = fragment.getNamespaceURI();
          String namespaceUri = root.getNamespaceURI();
          if((namespaceUri == null && fragUri == null) || (namespaceUri != null && fragUri != null && namespaceUri.equals(fragUri))) {
            return this.choiceElementNodeValue.marshalSingleValue(xPathFragment, marshalRecord, object, value, session, namespaceResolver, marshalContext);
          }
        }
      }
      fragment = fragment.getNextFragment();
    }
    //if we didn't find a node value associated with this xmlroot, try finding one for the 
    //value's class
    if(root.getObject() != null && xmlChoiceMapping.getClassToFieldMappings().get(root.getObject().getClass()) == this.xmlField) {
      return this.choiceElementNodeValue.marshal(xPathFragment, marshalRecord, object, session, namespaceResolver);
    }
  } else {
    if(value != null && xmlChoiceMapping.getClassToFieldMappings().get(value.getClass()) == this.xmlField) {
      return this.choiceElementNodeValue.marshalSingleValue(xPathFragment, marshalRecord, object, value, session, namespaceResolver, marshalContext);
    }
  }
  return false;
}

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

private Namespace setupFragment(XMLRoot originalValue, XPathFragment xmlRootFragment, MarshalRecord marshalRecord) {
  Namespace generatedNamespace = null;
  String xpath = originalValue.getLocalName();
  if (originalValue.getNamespaceURI() != null) {
    xmlRootFragment.setNamespaceURI((originalValue).getNamespaceURI());
    String prefix = marshalRecord.getNamespaceResolver().resolveNamespaceURI((originalValue).getNamespaceURI());
    if (prefix == null || prefix.length() == 0) {
      prefix = marshalRecord.getNamespaceResolver().generatePrefix();
      generatedNamespace = new Namespace(prefix, xmlRootFragment.getNamespaceURI());
    }
    xpath = prefix + XMLConstants.COLON + xpath;
  }
  xmlRootFragment.setXPath(xpath);
  return generatedNamespace;
}

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

private void writeSimpleValue(XMLField xmlRootField, DOMRecord row, AbstractSession session, Object originalObject, Object value, Node root, Node toReplace, boolean wasXMLRoot) {
  org.w3c.dom.Document doc = row.getDocument();
  if (wasXMLRoot) {
    if (((XMLRoot) originalObject).getNamespaceURI() != null) {
      String prefix = row.getNamespaceResolver().resolveNamespaceURI(((XMLRoot) originalObject).getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix = row.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot) originalObject).getLocalName());
    }
  }
  if (null == xmlRootField) {
    Text textNode = doc.createTextNode((String) value);
    if (toReplace != null) {
      root.replaceChild(textNode, toReplace);
    } else {
      root.appendChild(textNode);
    }
  } else {
    QName qname = ((XMLRoot) originalObject).getSchemaType();
    if(qname != null && !qname.equals(XMLConstants.STRING_QNAME)){
      xmlRootField.setSchemaType(qname);
      xmlRootField.setIsTypedTextField(true);
      xmlRootField.addJavaConversion(value.getClass(), qname);
    }
    Node newNode = XPathEngine.getInstance().create(xmlRootField, root, value, session);
  }
}

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

if(value instanceof XMLRoot) {
  XMLRoot rootValue = (XMLRoot)value;
  String localName = rootValue.getLocalName();
  String namespaceUri = rootValue.getNamespaceURI();
  fieldValue = rootValue.getObject();

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

private void writeSimpleValue(XMLField xmlRootField, DOMRecord row, AbstractSession session, Object originalObject, Object value, Node root, Node toReplace, boolean wasXMLRoot) {
  org.w3c.dom.Document doc = row.getDocument();
  if (wasXMLRoot) {
    if (((XMLRoot) originalObject).getNamespaceURI() != null) {
      String prefix = row.getNamespaceResolver().resolveNamespaceURI(((XMLRoot) originalObject).getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix = row.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot) originalObject).getLocalName());
    }
  }
  if (null == xmlRootField) {
    Text textNode = doc.createTextNode((String) value);
    if (toReplace != null) {
      root.replaceChild(textNode, toReplace);
    } else {
      root.appendChild(textNode);
    }
  } else {
    QName qname = ((XMLRoot) originalObject).getSchemaType();
    if(qname != null && !qname.equals(XMLConstants.STRING_QNAME)){
      xmlRootField.setSchemaType(qname);
      xmlRootField.setIsTypedTextField(true);
      xmlRootField.addJavaConversion(value.getClass(), qname);
    }
    Node newNode = XPathEngine.getInstance().create(xmlRootField, root, value, session);   
  }
}

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

private void writeSimpleValue(XMLField xmlRootField, Object element, Object originalObject, DOMRecord record, org.w3c.dom.Document doc, Node root, boolean wasXMLRoot, AbstractSession session) {
  if (wasXMLRoot) {
    if (((XMLRoot) originalObject).getNamespaceURI() != null) {
      String prefix = record.getNamespaceResolver().resolveNamespaceURI(((XMLRoot) originalObject).getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix = record.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot) originalObject).getLocalName());
    }
  }
  if (xmlRootField != null) {
    xmlRootField.setNamespaceResolver(record.getNamespaceResolver());
    QName qname = ((XMLRoot) originalObject).getSchemaType();
    if(qname != null){
      if(!qname.equals(XMLConstants.STRING_QNAME)){
        xmlRootField.setSchemaType(qname);
        xmlRootField.setIsTypedTextField(true);
        xmlRootField.addJavaConversion(((XMLRoot) originalObject).getObject().getClass(), qname);
      }
    }
    Node newNode = XPathEngine.getInstance().create(xmlRootField, root, element, session);
  } else {
    Text textNode = doc.createTextNode((String) element);
    root.appendChild(textNode);
  }
}

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

private Namespace setupFragment(XMLRoot originalValue, XPathFragment xmlRootFragment, MarshalRecord marshalRecord) {
  Namespace generatedNamespace = null;
  String xpath = originalValue.getLocalName();
  if (originalValue.getNamespaceURI() != null) {
    xmlRootFragment.setNamespaceURI((originalValue).getNamespaceURI());
    String prefix = marshalRecord.getNamespaceResolver().resolveNamespaceURI((originalValue).getNamespaceURI());
    if (prefix == null || prefix.length() == 0) {
      prefix = marshalRecord.getNamespaceResolver().generatePrefix("ns0");
      generatedNamespace = new Namespace(prefix, xmlRootFragment.getNamespaceURI());
    }
    xpath = prefix + XMLConstants.COLON + xpath;
  }
  xmlRootFragment.setXPath(xpath);
  return generatedNamespace;
}

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

private void writeSimpleValue(XMLField xmlRootField, Object element, Object originalObject, DOMRecord record, org.w3c.dom.Document doc, Node root, boolean wasXMLRoot, AbstractSession session) {
  if (wasXMLRoot) {
    if (((XMLRoot) originalObject).getNamespaceURI() != null) {
      String prefix = record.getNamespaceResolver().resolveNamespaceURI(((XMLRoot) originalObject).getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix = record.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot) originalObject).getLocalName());
    }
  }
  if (xmlRootField != null) {
    xmlRootField.setNamespaceResolver(record.getNamespaceResolver());
    QName qname = ((XMLRoot) originalObject).getSchemaType();
    if(qname != null){
      if(!qname.equals(XMLConstants.STRING_QNAME)){
        xmlRootField.setSchemaType(qname);
        xmlRootField.setIsTypedTextField(true);
        xmlRootField.addJavaConversion(((XMLRoot) originalObject).getObject().getClass(), qname);
      }
    }
    Node newNode = XPathEngine.getInstance().create(xmlRootField, root, element, session);
  } else {
    Text textNode = doc.createTextNode((String) element);
    root.appendChild(textNode);
  }
}

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

private void writeSimpleValue(XMLField xmlRootField, DOMRecord row, AbstractSession session, Object originalObject, Object value, Node root, Node toReplace, boolean wasXMLRoot) {
  org.w3c.dom.Document doc = row.getDocument();
  if (wasXMLRoot) {
    if (((XMLRoot) originalObject).getRootFragment().getNamespaceURI() != null) {
      String prefix = row.getNamespaceResolver().resolveNamespaceURI(((XMLRoot) originalObject).getRootFragment().getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix = row.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot) originalObject).getLocalName());
    }
  }
  if (null == xmlRootField) {
    Text textNode = doc.createTextNode((String) value);
    if (toReplace != null) {
      root.replaceChild(textNode, toReplace);
    } else {
      root.appendChild(textNode);
    }
  } else {
    QName qname = ((XMLRoot) originalObject).getSchemaType();
    if(qname != null && !qname.equals(XMLConstants.STRING_QNAME)){
      xmlRootField.setSchemaType(qname);
      xmlRootField.setIsTypedTextField(true);
      xmlRootField.addJavaConversion(value.getClass(), qname);
    }
    Node newNode = XPathEngine.getInstance().create(xmlRootField, root, value, session);   
  }
}

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

private void writeSimpleValue(XMLField xmlRootField, Object element, Object originalObject, DOMRecord record, org.w3c.dom.Document doc, Node root, boolean wasXMLRoot, AbstractSession session) {
  if (wasXMLRoot) {
    if (((XMLRoot) originalObject).getRootFragment().getNamespaceURI() != null) {
      String prefix = record.getNamespaceResolver().resolveNamespaceURI(((XMLRoot) originalObject).getRootFragment().getNamespaceURI());
      if ((prefix == null) || prefix.length() == 0) {
        xmlRootField.getXPathFragment().setGeneratedPrefix(true);
        prefix = record.getNamespaceResolver().generatePrefix();
      }
      xmlRootField.getXPathFragment().setXPath(prefix + XMLConstants.COLON + ((XMLRoot) originalObject).getLocalName());
    }
  }
  if (xmlRootField != null) {
    xmlRootField.setNamespaceResolver(record.getNamespaceResolver());
    QName qname = ((XMLRoot) originalObject).getSchemaType();
    if(qname != null){
      if(!qname.equals(XMLConstants.STRING_QNAME)){
        xmlRootField.setSchemaType(qname);
        xmlRootField.setIsTypedTextField(true);
        xmlRootField.addJavaConversion(((XMLRoot) originalObject).getObject().getClass(), qname);
      }
    }
    Node newNode = XPathEngine.getInstance().create(xmlRootField, root, element, session);
  } else {
    Text textNode = doc.createTextNode((String) element);
    root.appendChild(textNode);
  }
}

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

XMLRoot xmlRoot = (XMLRoot) setting.getValue();
if (null != xmlRoot) {
  property = dataObject.getInstanceProperty(xmlRoot.getLocalName());
  valuesToSettings.remove(new Key(property, setting.getValue()));

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

XMLRoot xmlRoot = (XMLRoot) setting.getValue();
if (null != xmlRoot) {
  property = dataObject.getInstanceProperty(xmlRoot.getLocalName());
  valuesToSettings.remove(new Key(property, setting.getValue()));

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

rootFragment = ((XMLRoot) object).getRootFragment();
String xmlRootUri = ((XMLRoot) object).getNamespaceURI();
String xmlRootLocalName = ((XMLRoot) object).getLocalName();
if (xmlRootUri != null) {
  if (descriptor != null) {

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

XMLRoot xmlRoot = new XMLRoot();
if (value instanceof XMLRoot) {
  xmlRoot.setLocalName(((XMLRoot) value).getLocalName());
  xmlRoot.setNamespaceURI(((XMLRoot) value).getNamespaceURI());
  xmlRoot.setObject(((XMLRoot) value).getObject());

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

XMLRoot xmlRoot = new XMLRoot();
if (value instanceof XMLRoot) {
  xmlRoot.setLocalName(((XMLRoot) value).getLocalName());
  xmlRoot.setNamespaceURI(((XMLRoot) value).getNamespaceURI());
  xmlRoot.setObject(((XMLRoot) value).getObject());

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com