- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.objectToXML()
方法的一些代码示例,展示了XMLMarshaller.objectToXML()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLMarshaller.objectToXML()
方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.XMLMarshaller
类名称:XMLMarshaller
方法名:objectToXML
[英]PUBLIC: Convert the given object to an XML Document
[中]PUBLIC:将给定对象转换为XML文档
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* Convert the given object to an XML Document
*/
public Document objectToXML(Object object, XMLDescriptor descriptor, XMLRecord xmlRow, boolean isXMLRoot, DocumentPreservationPolicy docPresPolicy) {
return objectToXML(object, null, descriptor, xmlRow, isXMLRoot, docPresPolicy);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* Convert the given object to an XML Document
*/
public Document objectToXML(Object object, XMLDescriptor descriptor, XMLRecord xmlRow, boolean isXMLRoot, DocumentPreservationPolicy docPresPolicy) {
return objectToXML(object, null, descriptor, xmlRow, isXMLRoot, docPresPolicy);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* PUBLIC:
* Convert the given object to descendants of the parent element
* @param object the object to marshal
* @param parent the node to marshal the object to
* @return the document which the specified object has been marshalled to
* @throws XMLMarshalException if an error occurred during marshalling
* @deprecated
*/
public Document objectToXML(Object object, Node parent) throws XMLMarshalException {
return objectToXML(object, parent, null);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* PUBLIC:
* Convert the given object to descendants of the parent element
* @param object the object to marshal
* @param parent the node to marshal the object to
* @return the document which the specified object has been marshalled to
* @throws XMLMarshalException if an error occurred during marshalling
* @deprecated
*/
public Document objectToXML(Object object, Node parent) throws XMLMarshalException {
return objectToXML(object, parent, null);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* Convert the given object to an XML Document
*/
public Document objectToXML(Object object, XMLDescriptor descriptor, XMLRecord xmlRow, boolean isXMLRoot, DocumentPreservationPolicy docPresPolicy) {
return objectToXML(object, null, descriptor, xmlRow, isXMLRoot, docPresPolicy);
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* PUBLIC:
* Convert the given object to descendants of the parent element
* @param object the object to marshal
* @param parent the node to marshal the object to
* @return the document which the specified object has been marshalled to
* @throws XMLMarshalException if an error occurred during marshalling
* @deprecated
*/
@Deprecated
public Document objectToXML(Object object, Node parent) throws XMLMarshalException {
return objectToXML(object, parent, null);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* PUBLIC:
* Convert the given object to an XML Document
* @param object the object to marshal
* @return the document which the specified object has been marshalled to
* @throws XMLMarshalException if an error occurred during marshalling
*/
public Document objectToXML(Object object) throws XMLMarshalException {
boolean isXMLRoot = (object instanceof XMLRoot);
XMLDescriptor xmlDescriptor = getDescriptor(object, isXMLRoot);
return objectToXML(object, xmlDescriptor, isXMLRoot);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
protected Node objectToXMLNode(Object object, Node rootNode, AbstractSession session,XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {
DocumentPreservationPolicy docPresPolicy = context.getDocumentPreservationPolicy(session);
if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
XMLRecord xmlRow = null;
if (!isXMLRoot) {
xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, context.getDocumentPreservationPolicy(session));
xmlRow.setMarshaller(this);
if (this.attachmentMarshaller != null) {
xmlRow.setXOPPackage(this.attachmentMarshaller.isXOPPackage());
}
if (xmlRow.getDOM().getNodeType() == Node.ELEMENT_NODE) {
addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);
}
}
Document doc = objectToXML(object, rootNode, descriptor, xmlRow, isXMLRoot, docPresPolicy);
if ((xmlRow != null) && (xmlRow.getDOM().getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)) {
return xmlRow.getDOM();
} else {
return doc;
}
}
return super.objectToXMLNode(object, rootNode, session, descriptor, isXMLRoot);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* Validate the given root object.
* @param rootObject A single root object to validate
* @return true if this is a valid object, otherwise false
*/
public boolean validateRoot(Object rootObject) throws XMLMarshalException {
if (rootObject == null) {
throw XMLMarshalException.nullArgumentException();
}
XMLDescriptor xmlDescriptor = (XMLDescriptor)xmlContext.getSession(rootObject).getDescriptor(rootObject);
Document document = marshaller.objectToXML(rootObject, xmlDescriptor, false);
if (xmlDescriptor.getSchemaReference() == null) {
throw XMLMarshalException.schemaReferenceNotSet(xmlDescriptor);
}
return xmlDescriptor.getSchemaReference().isValid(document, getErrorHandler());
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* Validate the given root object.
* @param rootObject A single root object to validate
* @return true if this is a valid object, otherwise false
*/
public boolean validateRoot(Object rootObject) throws XMLMarshalException {
if (rootObject == null) {
throw XMLMarshalException.nullArgumentException();
}
XMLDescriptor xmlDescriptor = (XMLDescriptor)xmlContext.getSession(rootObject).getDescriptor(rootObject);
Document document = marshaller.objectToXML(rootObject, xmlDescriptor, false);
if (xmlDescriptor.getSchemaReference() == null) {
throw XMLMarshalException.schemaReferenceNotSet(xmlDescriptor);
}
return xmlDescriptor.getSchemaReference().isValid(document, getErrorHandler());
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* Validate the given root object.
* @param rootObject A single root object to validate
* @return true if this is a valid object, otherwise false
*/
public boolean validateRoot(Object rootObject) throws XMLMarshalException {
if (rootObject == null) {
throw XMLMarshalException.nullArgumentException();
}
XMLDescriptor xmlDescriptor = (XMLDescriptor)xmlContext.getSession(rootObject).getDescriptor(rootObject);
Document document = marshaller.objectToXML(rootObject, xmlDescriptor, false);
if (xmlDescriptor.getSchemaReference() == null) {
throw XMLMarshalException.schemaReferenceNotSet(xmlDescriptor);
}
return xmlDescriptor.getSchemaReference().isValid(document, getErrorHandler());
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
@Override
protected Node objectToXMLNode(Object object, Node rootNode, AbstractSession session,XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {
DocumentPreservationPolicy docPresPolicy = context.getDocumentPreservationPolicy(session);
if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
XMLRecord xmlRow = null;
if (!isXMLRoot) {
xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, context.getDocumentPreservationPolicy(session));
xmlRow.setMarshaller(this);
if (this.attachmentMarshaller != null) {
xmlRow.setXOPPackage(this.attachmentMarshaller.isXOPPackage());
}
if (xmlRow.getDOM().getNodeType() == Node.ELEMENT_NODE) {
addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);
}
}
Document doc = objectToXML(object, rootNode, descriptor, xmlRow, isXMLRoot, docPresPolicy);
if ((xmlRow != null) && (xmlRow.getDOM().getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)) {
return xmlRow.getDOM();
} else {
return doc;
}
}
return super.objectToXMLNode(object, rootNode, session, descriptor, isXMLRoot);
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* Convert the given object to an XML Document
* @param object the object to marshal
* @return the document which the specified object has been marshalled to
* @param descriptor the XMLDescriptor for the object being marshalled
* @throws XMLMarshalException if an error occurred during marshalling
*/
@Override
protected Document objectToXML(Object object, XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {
AbstractSession session = context.getSession(descriptor);
DocumentPreservationPolicy docPresPolicy = context.getDocumentPreservationPolicy(session);
if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
XMLRecord xmlRow = null;
if (!isXMLRoot) {
xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, context.getDocumentPreservationPolicy(session));
xmlRow.setMarshaller(this);
if (this.attachmentMarshaller != null) {
xmlRow.setXOPPackage(this.attachmentMarshaller.isXOPPackage());
}
addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);
}
return objectToXML(object, descriptor, xmlRow, isXMLRoot, docPresPolicy);
}
return super.objectToXML(object, descriptor, isXMLRoot);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* Convert the given object to an XML Document
* @param object the object to marshal
* @return the document which the specified object has been marshalled to
* @param descriptor the XMLDescriptor for the object being marshalled
* @throws XMLMarshalException if an error occurred during marshalling
*/
protected Document objectToXML(Object object, XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {
AbstractSession session = context.getSession(descriptor);
DocumentPreservationPolicy docPresPolicy = context.getDocumentPreservationPolicy(session);
if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
XMLRecord xmlRow = null;
if (!isXMLRoot) {
xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, context.getDocumentPreservationPolicy(session));
xmlRow.setMarshaller(this);
if (this.attachmentMarshaller != null) {
xmlRow.setXOPPackage(this.attachmentMarshaller.isXOPPackage());
}
addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);
}
return objectToXML(object, descriptor, xmlRow, isXMLRoot, docPresPolicy);
}
return super.objectToXML(object, descriptor, isXMLRoot);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
protected Node objectToXMLNode(Object object, Node rootNode, AbstractSession session,XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {
DocumentPreservationPolicy docPresPolicy = xmlContext.getDocumentPreservationPolicy(session);
if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
XMLRecord xmlRow = null;
if (!isXMLRoot) {
xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, xmlContext.getDocumentPreservationPolicy(session));
xmlRow.setMarshaller(this);
if (getAttachmentMarshaller() != null) {
xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage());
}
if (xmlRow.getDOM().getNodeType() == Node.ELEMENT_NODE) {
addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);
}
}
Document doc = objectToXML(object, rootNode, descriptor, xmlRow, isXMLRoot, docPresPolicy);
if ((xmlRow != null) && (xmlRow.getDOM().getNodeType() == Node.DOCUMENT_FRAGMENT_NODE)) {
return xmlRow.getDOM();
} else {
return doc;
}
}
MarshalRecord marshalRecord = new NodeRecord();
marshalRecord.setMarshaller(this);
marshalRecord.getNamespaceResolver().setDOM(rootNode);
marshal(object, marshalRecord, session, descriptor, isXMLRoot);
return marshalRecord.getDocument();
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* Convert the given object to an XML Document
* @param object the object to marshal
* @return the document which the specified object has been marshalled to
* @param descriptor the XMLDescriptor for the object being marshalled
* @throws XMLMarshalException if an error occurred during marshalling
*/
protected Document objectToXML(Object object, XMLDescriptor descriptor, boolean isXMLRoot) throws XMLMarshalException {
AbstractSession session = xmlContext.getSession(descriptor);
DocumentPreservationPolicy docPresPolicy = xmlContext.getDocumentPreservationPolicy(session);
if (docPresPolicy != null && docPresPolicy.shouldPreserveDocument()) {
XMLRecord xmlRow = null;
if (!isXMLRoot) {
xmlRow = (XMLRecord) ((XMLObjectBuilder) descriptor.getObjectBuilder()).createRecordFor(object, xmlContext.getDocumentPreservationPolicy(session));
xmlRow.setMarshaller(this);
if (getAttachmentMarshaller() != null) {
xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage());
}
addDescriptorNamespacesToXMLRecord(descriptor, xmlRow);
}
return objectToXML(object, descriptor, xmlRow, isXMLRoot, docPresPolicy);
}
MarshalRecord marshalRecord = new NodeRecord();
marshalRecord.setMarshaller(this);
marshal(object, marshalRecord, session, descriptor, isXMLRoot);
return marshalRecord.getDocument();
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
domRecord.setDocPresPolicy(getDocumentPreservationPolicy());
Node n = this.marshaller.objectToXML(obj, node, desc, domRecord, isXMLRoot, this.getDocumentPreservationPolicy());
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
domRecord.setDocPresPolicy(getDocumentPreservationPolicy());
Node n = this.marshaller.objectToXML(obj, node, desc, domRecord, isXMLRoot, this.getDocumentPreservationPolicy());
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
domRecord.setDocPresPolicy(getDocumentPreservationPolicy());
Node n = this.marshaller.objectToXML(obj, node, desc, domRecord, isXMLRoot, this.getDocumentPreservationPolicy());
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
xmlRow.setXOPPackage(getAttachmentMarshaller().isXOPPackage());
return objectToXML(object, descriptor, xmlRow, isXMLRoot, docPresPolicy);
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.setIndentString()方法的一些代码示例,展示了XMLMarshaller.setI
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.isWrapperAsCollectionName()方法的一些代码示例,展示了XMLMarsh
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.copyNamespaces()方法的一些代码示例,展示了XMLMarshaller.copyN
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getXmlHeader()方法的一些代码示例,展示了XMLMarshaller.getXmlH
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getJsonTypeConfiguration()方法的一些代码示例,展示了XMLMarsha
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.setNoNamespaceSchemaLocation()方法的一些代码示例,展示了XMLMa
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.setNamespacePrefixMapper()方法的一些代码示例,展示了XMLMarsha
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getProperties()方法的一些代码示例,展示了XMLMarshaller.getPro
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.setErrorHandler()方法的一些代码示例,展示了XMLMarshaller.setE
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getErrorHandler()方法的一些代码示例,展示了XMLMarshaller.getE
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.setNamespaceSeparator()方法的一些代码示例,展示了XMLMarshalle
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getNamespacePrefixMapper()方法的一些代码示例,展示了XMLMarsha
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.objectToXMLNode()方法的一些代码示例,展示了XMLMarshaller.obje
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.setFragment()方法的一些代码示例,展示了XMLMarshaller.setFragm
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.setWrapperAsCollectionName()方法的一些代码示例,展示了XMLMars
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getAttributePrefix()方法的一些代码示例,展示了XMLMarshaller.g
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getContext()方法的一些代码示例,展示了XMLMarshaller.getContex
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getCharacterEscapeHandler()方法的一些代码示例,展示了XMLMarsh
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.setMarshalEmptyCollections()方法的一些代码示例,展示了XMLMars
本文整理了Java中org.eclipse.persistence.oxm.XMLMarshaller.getProperty()方法的一些代码示例,展示了XMLMarshaller.getPrope
我是一名优秀的程序员,十分优秀!