gpt4 book ai didi

org.eclipse.persistence.platform.xml.XMLPlatform.createDocument()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 03:47:05 25 4
gpt4 key购买 nike

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

XMLPlatform.createDocument介绍

[英]Creates a new document.
[中]创建一个新文档。

代码示例

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

public Document getInitializedDocument() throws SAXException {
  if (document == null) {
    try {
      document = xmlPlatform.createDocument();
      nodes.add(document);
    } catch (Exception e) {
      throw new SAXException(e);
    }
  }
  return document;
}

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

public Document getInitializedDocument() throws SAXException {
  if (document == null) {
    try {
      document = xmlPlatform.createDocument();
      nodes.add(document);
    } catch (Exception e) {
      throw new SAXException(e);
    }
  }
  return document;
}

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

public void startDocument() throws SAXException {
  try {
    document = xmlPlatform.createDocument();
    nodes.add(document);
  } catch (Exception e) {
    throw new SAXException(e);
  }
}

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

public void startDocument() throws SAXException {
  try {
    document = xmlPlatform.createDocument();
    nodes.add(document);
  } catch (Exception e) {
    throw new SAXException(e);
  }
}

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

public void startDocument() throws SAXException {
  try {
    document = xmlPlatform.createDocument();
    nodes.add(document);
  } catch (Exception e) {
    throw new SAXException(e);
  }
}

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

public Document getInitializedDocument() throws SAXException {
  if (document == null) {
    try {
      document = xmlPlatform.createDocument();
      nodes.add(document);
    } catch (Exception e) {
      throw new SAXException(e);
    }
  }
  return document;
}

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

/**
 * INTERNAL:
 * Default constructor.
 */
public NodeRecord() {
  super();
  XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
  document = xmlPlatform.createDocument();
  node = document;
}

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

/**
 * INTERNAL:
 * Creates a new Document and returns the root element of that document
 */
public Node createNewDocument(String defaultRootElementName, String namespaceURI) {
  XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
  Document document = xmlPlatform.createDocument();
  if (defaultRootElementName == null || defaultRootElementName.length() == 0) {
    DocumentFragment fragment = document.createDocumentFragment();
    return fragment;
  } else {
    Node rootNode = document.createElementNS(namespaceURI, defaultRootElementName);
    document.appendChild(rootNode);
    return document.getDocumentElement();
  }
}

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

/**
 * INTERNAL:
 * Default constructor.
 */
public NodeRecord() {
  super();
  XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
  document = xmlPlatform.createDocument();
  node = document;
}

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

/**
 * INTERNAL:
 * Creates a new Document and returns the root element of that document
 */
public Node createNewDocument(String defaultRootElementName, String namespaceURI) {
  XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
  Document document = xmlPlatform.createDocument();
  if (defaultRootElementName == null || defaultRootElementName.length() == 0) {
    DocumentFragment fragment = document.createDocumentFragment();
    return fragment;
  } else {
    Node rootNode = document.createElementNS(namespaceURI, defaultRootElementName);
    document.appendChild(rootNode);
    return document.getDocumentElement();
  }
}

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

/**
 * INTERNAL:
 * Default constructor.
 */
public NodeRecord() {
  super();
  XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
  document = xmlPlatform.createDocument();
  node = document;
}

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

/**
 * INTERNAL:
 * Creates a new Document and returns the root element of that document
 */
public Node createNewDocument(String defaultRootElementName, String namespaceURI) {
  XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
  Document document = xmlPlatform.createDocument();
  if (defaultRootElementName == null || defaultRootElementName.length() == 0) {
    DocumentFragment fragment = document.createDocumentFragment();
    return fragment;
  } else {
    Node rootNode = document.createElementNS(namespaceURI, defaultRootElementName);
    document.appendChild(rootNode);
    return document.getDocumentElement();
  }
}

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

/**
* Validate the given object.
* @param object A single object to validate
* @return true if this is a valid object, otherwise false
*/
public boolean validate(Object object) throws XMLMarshalException {
  if (object == null) {
    throw XMLMarshalException.nullArgumentException();
  }
  try {
    // Create a new XML Record using the object's class name (not fully qualified) as the root            
    String name = ((XMLDescriptor)xmlContext.getSession(object).getDescriptor(object)).getDefaultRootElement();
    if (name == null) {
      String qualifiedName = object.getClass().getName();
      int idx = qualifiedName.lastIndexOf('.');
      name = qualifiedName.substring(idx + 1);
    }
    XMLDescriptor descriptor = marshaller.getDescriptor(object);
    XMLRoot root = new XMLRoot();
    root.setObject(object);
    root.setLocalName(name);
    
    XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
    Document doc = xmlPlatform.createDocument();
    marshaller.marshal(root, doc);
    return xmlPlatform.validate(doc.getDocumentElement(), descriptor, getErrorHandler());
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.validateException(e);
  }
}

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

/**
* Validate the given object.
* @param object A single object to validate
* @return true if this is a valid object, otherwise false
*/
public boolean validate(Object object) throws XMLMarshalException {
  if (object == null) {
    throw XMLMarshalException.nullArgumentException();
  }
  try {
    // Create a new XML Record using the object's class name (not fully qualified) as the root
    String name = ((XMLDescriptor)xmlContext.getSession(object).getDescriptor(object)).getDefaultRootElement();
    if (name == null) {
      String qualifiedName = object.getClass().getName();
      int idx = qualifiedName.lastIndexOf('.');
      name = qualifiedName.substring(idx + 1);
    }
    XMLDescriptor descriptor = marshaller.getDescriptor(object);
    Root root = new Root();
    root.setObject(object);
    root.setLocalName(name);
    XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
    Document doc = xmlPlatform.createDocument();
    marshaller.marshal(root, doc);
    return xmlPlatform.validate(doc.getDocumentElement(), descriptor, getErrorHandler());
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.validateException(e);
  }
}

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

/**
* Validate the given object.
* @param object A single object to validate
* @return true if this is a valid object, otherwise false
*/
public boolean validate(Object object) throws XMLMarshalException {
  if (object == null) {
    throw XMLMarshalException.nullArgumentException();
  }
  try {
    // Create a new XML Record using the object's class name (not fully qualified) as the root            
    String name = ((XMLDescriptor)xmlContext.getSession(object).getDescriptor(object)).getDefaultRootElement();
    if (name == null) {
      String qualifiedName = object.getClass().getName();
      int idx = qualifiedName.lastIndexOf('.');
      name = qualifiedName.substring(idx + 1);
    }
    XMLDescriptor descriptor = marshaller.getDescriptor(object);
    Root root = new Root();
    root.setObject(object);
    root.setLocalName(name);
    
    XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
    Document doc = xmlPlatform.createDocument();
    marshaller.marshal(root, doc);
    return xmlPlatform.validate(doc.getDocumentElement(), descriptor, getErrorHandler());
  } catch (XMLPlatformException e) {
    throw XMLMarshalException.validateException(e);
  }
}

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

private Object buildFragment(Property property, SDODataObject parentObject, SDODataObject value) {
    //build an XML Fragment from this SDO
    XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
    XMLMarshaller xmlMarshaller = ((SDOXMLHelper)helperContext.getXMLHelper()).getXmlContext().createMarshaller();
    Document doc = xmlPlatform.createDocument();
    XMLRoot root = new XMLRoot();
    root.setObject(value);
    root.setLocalName(property.getName());
    if(((SDOProperty)property).isNamespaceQualified()){
     root.setNamespaceURI(parentObject.getType().getURI());
    }
    xmlMarshaller.marshal(root, doc);
    return doc.getDocumentElement();
  }
}

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

private Object buildFragment(Property property, SDODataObject parentObject, SDODataObject value) {
    //build an XML Fragment from this SDO
    XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
    XMLMarshaller xmlMarshaller = ((SDOXMLHelper)helperContext.getXMLHelper()).getXmlContext().createMarshaller();
    Document doc = xmlPlatform.createDocument();
    XMLRoot root = new XMLRoot();
    root.setObject(value);
    root.setLocalName(property.getName());
    if(((SDOProperty)property).isNamespaceQualified()){
     root.setNamespaceURI(parentObject.getType().getURI());
    }
    xmlMarshaller.marshal(root, doc);
    return doc.getDocumentElement();
  }
}

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

Document document = XMLPlatformFactory.getInstance().getXMLPlatform().createDocument();
Element csNode = null;
List modifiedItems = changeSummary.getModified();

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

Document document = XMLPlatformFactory.getInstance().getXMLPlatform().createDocument();
Element csNode = null;
List modifiedItems = changeSummary.getModified();

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