gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-20 02:15:40 28 4
gpt4 key购买 nike

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

XMLMarshaller.getSchemaLocation介绍

[英]Get the schema location set on this XMLMarshaller
[中]获取在此XMLMarshaller上设置的架构位置

代码示例

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

public Object getProperty(String propName) throws PropertyException {
  if (null == propName) {
    throw new IllegalArgumentException();
  }
  if (propName.equals(Marshaller.JAXB_ENCODING)) {
    return this.xmlBinder.getMarshaller().getEncoding();
  }
  if (propName.equals(Marshaller.JAXB_FORMATTED_OUTPUT)) {
    return this.xmlBinder.getMarshaller().isFormattedOutput();
  }
  if (propName.equals(Marshaller.JAXB_FRAGMENT)) {
    return this.xmlBinder.getMarshaller().isFragment();
  }
  if (propName.equals(Marshaller.JAXB_SCHEMA_LOCATION)) {
    return this.xmlBinder.getMarshaller().getSchemaLocation();
  }
  if (propName.equals(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION)) {
    return this.xmlBinder.getMarshaller().getNoNamespaceSchemaLocation();
  }
  throw new PropertyException(propName);
}

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

@Override
public Object getProperty(String propName) throws PropertyException {
  if (null == propName) {
    throw new IllegalArgumentException();
  }
  if (propName.equals(Marshaller.JAXB_ENCODING)) {
    return this.xmlBinder.getMarshaller().getEncoding();
  }
  if (propName.equals(Marshaller.JAXB_FORMATTED_OUTPUT)) {
    return this.xmlBinder.getMarshaller().isFormattedOutput();
  }
  if (propName.equals(Marshaller.JAXB_FRAGMENT)) {
    return this.xmlBinder.getMarshaller().isFragment();
  }
  if (propName.equals(Marshaller.JAXB_SCHEMA_LOCATION)) {
    return this.xmlBinder.getMarshaller().getSchemaLocation();
  }
  if (propName.equals(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION)) {
    return this.xmlBinder.getMarshaller().getNoNamespaceSchemaLocation();
  }
  throw new PropertyException(propName);
}

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

return xmlMarshaller.getEncoding();
} else if (JAXB_SCHEMA_LOCATION.equals(key)) {
  return xmlMarshaller.getSchemaLocation();
} else if (JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(key)) {
  return xmlMarshaller.getNoNamespaceSchemaLocation();

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

return xmlMarshaller.getEncoding();
} else if (JAXB_SCHEMA_LOCATION.equals(key)) {
  return xmlMarshaller.getSchemaLocation();
} else if (JAXB_NO_NAMESPACE_SCHEMA_LOCATION.equals(key)) {
  return xmlMarshaller.getNoNamespaceSchemaLocation();

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

private void addSchemaLocations(Document document, AbstractSession session) {
  Element docElement = document.getDocumentElement();
  NamespaceResolver resolver = new NamespaceResolver();
  resolver.put(javax.xml.XMLConstants.XMLNS_ATTRIBUTE, javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
  resolver.put(XMLConstants.SCHEMA_INSTANCE_PREFIX, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
  if ((getSchemaLocation() != null) || (getNoNamespaceSchemaLocation() != null)) {
    XMLField field = new XMLField("@xmlns:xsi");
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, session);
  }
  if (getSchemaLocation() != null) {
    XMLField field = new XMLField("@xsi:" + XMLConstants.SCHEMA_LOCATION);
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, getSchemaLocation(), session);
  }
  if (getNoNamespaceSchemaLocation() != null) {
    XMLField field = new XMLField("@xsi:" + XMLConstants.NO_NS_SCHEMA_LOCATION);
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, getNoNamespaceSchemaLocation(), session);
  }
}

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

private void addSchemaLocations(Document document, AbstractSession session) {
  Element docElement = document.getDocumentElement();
  NamespaceResolver resolver = new NamespaceResolver();
  resolver.put(javax.xml.XMLConstants.XMLNS_ATTRIBUTE, javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI);
  resolver.put(XMLConstants.SCHEMA_INSTANCE_PREFIX, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
  if ((getSchemaLocation() != null) || (getNoNamespaceSchemaLocation() != null)) {
    XMLField field = new XMLField("@xmlns:xsi");
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, session);
  }
  if (getSchemaLocation() != null) {
    XMLField field = new XMLField("@xsi:" + XMLConstants.SCHEMA_LOCATION);
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, getSchemaLocation(), session);
  }
  if (getNoNamespaceSchemaLocation() != null) {
    XMLField field = new XMLField("@xsi:" + XMLConstants.NO_NS_SCHEMA_LOCATION);
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, getNoNamespaceSchemaLocation(), session);
  }
}

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

private void addSchemaLocations(Document document, AbstractSession session) {
  Element docElement = document.getDocumentElement();
  NamespaceResolver resolver = new NamespaceResolver();
  resolver.put(XMLConstants.XMLNS, XMLConstants.XMLNS_URL);
  resolver.put(XMLConstants.SCHEMA_INSTANCE_PREFIX, XMLConstants.SCHEMA_INSTANCE_URL);
  if ((getSchemaLocation() != null) || (getNoNamespaceSchemaLocation() != null)) {
    XMLField field = new XMLField("@xmlns:xsi");
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, XMLConstants.SCHEMA_INSTANCE_URL, session);
  }
  if (getSchemaLocation() != null) {
    XMLField field = new XMLField("@xsi:" + XMLConstants.SCHEMA_LOCATION);
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, getSchemaLocation(), session);
  }
  if (getNoNamespaceSchemaLocation() != null) {
    XMLField field = new XMLField("@xsi:" + XMLConstants.NO_NS_SCHEMA_LOCATION);
    field.setNamespaceResolver(resolver);
    XPathEngine.getInstance().create(field, docElement, getNoNamespaceSchemaLocation(), session);
  }
}

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

String schemaLocation = getSchemaLocation();
String noNsSchemaLocation = getNoNamespaceSchemaLocation();
if (isXMLRoot) {
if ((null != getSchemaLocation()) || (null != getNoNamespaceSchemaLocation()) || shouldWriteTypeAttribute) {
  xsiPrefix = nr.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
  if (null == xsiPrefix) {

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