- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.eclipse.persistence.oxm.XMLRoot.getSchemaType()
方法的一些代码示例,展示了XMLRoot.getSchemaType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLRoot.getSchemaType()
方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.XMLRoot
类名称:XMLRoot
方法名:getSchemaType
暂无
代码示例来源: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/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: 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 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/com.springsource.org.eclipse.persistence
private void marshalSimpleValue(XPathFragment xmlRootFragment, MarshalRecord marshalRecord, Object originalValue, Object object, Object value, AbstractSession session, NamespaceResolver namespaceResolver) {
if (xmlRootFragment != null) {
QName qname = ((XMLRoot) originalValue).getSchemaType();
value = getValueToWrite(qname, value, (XMLConversionManager) session.getDatasourcePlatform().getConversionManager(), namespaceResolver);
Namespace generatedNamespace = setupFragment((XMLRoot) originalValue, xmlRootFragment, marshalRecord);
getXPathNode().startElement(marshalRecord, xmlRootFragment, object, session, namespaceResolver, null, null);
if (generatedNamespace != null) {
marshalRecord.attribute(XMLConstants.XMLNS_URL, generatedNamespace.getPrefix(), XMLConstants.XMLNS + XMLConstants.COLON + generatedNamespace.getPrefix(), generatedNamespace.getNamespaceURI());
}
updateNamespaces(qname, marshalRecord, null);
}
marshalRecord.characters((String) value);
if (xmlRootFragment != null) {
marshalRecord.endElement(xmlRootFragment, namespaceResolver);
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
private void marshalSimpleValue(XPathFragment xmlRootFragment, MarshalRecord marshalRecord, Object originalValue, Object object, Object value, AbstractSession session, NamespaceResolver namespaceResolver) {
if (xmlRootFragment != null) {
QName qname = ((XMLRoot) originalValue).getSchemaType();
value = getValueToWrite(qname, value, (XMLConversionManager) session.getDatasourcePlatform().getConversionManager(), namespaceResolver);
Namespace generatedNamespace = setupFragment(((XMLRoot) originalValue), xmlRootFragment, marshalRecord);
getXPathNode().startElement(marshalRecord, xmlRootFragment, object, session, namespaceResolver, null, null);
if (generatedNamespace != null) {
marshalRecord.attribute(XMLConstants.XMLNS_URL, generatedNamespace.getPrefix(), XMLConstants.XMLNS + XMLConstants.COLON + generatedNamespace.getPrefix(), generatedNamespace.getNamespaceURI());
}
updateNamespaces(qname, marshalRecord, null);
}
if (value instanceof String) {
marshalRecord.characters((String) value);
} else {
marshalRecord.node((org.w3c.dom.Node) value, marshalRecord.getNamespaceResolver());
}
if (xmlRootFragment != null) {
marshalRecord.endElement(xmlRootFragment, namespaceResolver);
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
noNsSchemaLocation = root.getNoNamespaceSchemaLocation();
marshalRecord.setLeafElementType(root.getSchemaType());
String value = (String) XMLConversionManager.getDefaultXMLManager().convertObject(object, String.class, root.getSchemaType());
marshalRecord.characters(value);
本文整理了Java中org.codehaus.stax2.validation.XMLValidationSchema.getSchemaType()方法的一些代码示例,展示了XMLValidatio
本文整理了Java中net.sf.saxon.style.XSLDocument.getSchemaType()方法的一些代码示例,展示了XSLDocument.getSchemaType()的具体用
本文整理了Java中org.eclipse.persistence.oxm.XMLRoot.getSchemaType()方法的一些代码示例,展示了XMLRoot.getSchemaType()的具体
本文整理了Java中org.eclipse.persistence.oxm.mappings.XMLObjectReferenceMapping.getSchemaType()方法的一些代码示例,展示
本文整理了Java中com.sun.xml.bind.v2.runtime.XMLSerializer.getSchemaType()方法的一些代码示例,展示了XMLSerializer.getSch
我是一名优秀的程序员,十分优秀!