gpt4 book ai didi

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

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

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

XMLPlatform.newXMLParser介绍

[英]Return a concrete implementation of the XML parser abstraction that is compatible with the XML Platform.
[中]返回与XML平台兼容的XML解析器抽象的具体实现。

代码示例

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

/**
 * Set the XML from an XML reader.
 */
public void transformFromXML(Reader reader) {
  XMLParser parser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  Document document = parser.parse(reader);
  setDOM(document.getDocumentElement());
}

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

/**
 * Set the XML from an XML reader.
 */
public void transformFromXML(Reader reader) {
  XMLParser parser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  Document document = parser.parse(reader);
  setDOM(document.getDocumentElement());
}

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

public DOMUnmarshaller(XMLUnmarshaller xmlUnmarshaller, Map<String, Boolean> parserFeatures) {
  super();
  if(null == parserFeatures) {
    parser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  } else {
    parser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser(parserFeatures);
  }
  parser.setNamespaceAware(true);
  parser.setValidationMode(XMLParser.NONVALIDATING);
  this.xmlUnmarshaller = xmlUnmarshaller;
}

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

public DOMUnmarshaller(XMLUnmarshaller xmlUnmarshaller, Map<String, Boolean> parserFeatures) {
  super();
  if(null == parserFeatures) {
    parser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  } else {
    parser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser(parserFeatures);
  }
  parser.setNamespaceAware(true);
  parser.setValidationMode(XMLParser.NONVALIDATING);
  this.xmlUnmarshaller = xmlUnmarshaller;
}

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

/**
 * Set the XML from an XML reader.
 */
public void transformFromXML(Reader reader) {
  XMLParser parser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  Document document = parser.parse(reader);
  setDOM(document.getDocumentElement());
}

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

public SAXUnmarshaller(XMLUnmarshaller xmlUnmarshaller, Map<String, Boolean> parserFeatures) throws XMLMarshalException {
  super();
  try {
    saxParserFactory = SAXParserFactory.newInstance();
    saxParserFactory.setNamespaceAware(true);
    saxParserFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
    if(null != parserFeatures) {
      for(Map.Entry<String, Boolean> parserFeature : parserFeatures.entrySet()) {
        try {
          saxParserFactory.setFeature(parserFeature.getKey(), parserFeature.getValue());
        } catch(org.xml.sax.SAXNotRecognizedException ex) {
          //ignore if the parser doesn't recognize or support this feature
        } catch(org.xml.sax.SAXNotSupportedException ex) {
        }
      }
    }
    saxParser = saxParserFactory.newSAXParser();
    xmlReader = new XMLReader(saxParser.getXMLReader());
    xmlReader.setErrorHandler(new DefaultErrorHandler());
    xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
    xmlParser.setNamespaceAware(true);
    xmlParser.setValidationMode(XMLParser.NONVALIDATING);
    this.xmlUnmarshaller = xmlUnmarshaller;
  } catch (Exception e) {
    throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
  }
}

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

XMLParser parser = xmlPlatform.newXMLParser();
if (validate) {
  parser.setValidationMode(XMLParser.SCHEMA_VALIDATION);

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

XMLParser parser = xmlPlatform.newXMLParser();
if (validate) {
  parser.setValidationMode(XMLParser.SCHEMA_VALIDATION);

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

XMLParser parser = xmlPlatform.newXMLParser();
if (validate) {
  parser.setValidationMode(XMLParser.SCHEMA_VALIDATION);

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

public DirectToXMLTypeMapping() {
  super();
  this.xmlTransformer = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer();
  this.xmlTransformer.setFormattedOutput(false);
  this.xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  this.xmlComparer = new XMLComparer();
}

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

public DirectToXMLTypeMapping() {
  super();
  this.xmlTransformer = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer();
  this.xmlTransformer.setFormattedOutput(false);
  this.xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  this.xmlComparer = new XMLComparer();
}

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

public DirectToXMLTypeMapping() {
  super();
  this.xmlTransformer = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLTransformer();
  this.xmlTransformer.setFormattedOutput(false);
  this.xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  this.xmlComparer = new XMLComparer();
}

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

private XMLParser getXMLParser() {
  xmlParser = XMLPlatformFactory.getInstance().getXMLPlatform().newXMLParser();
  xmlParser.setNamespaceAware(true);
  if(null != errorHandler) {
    xmlParser.setErrorHandler(errorHandler);
  }
  if(null != entityResolver) {
    xmlParser.setEntityResolver(entityResolver);
  }
  xmlParser.setValidationMode(validationMode);
  xmlParser.setWhitespacePreserving(isWhitespacePreserving);
  return xmlParser;
}

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

private static XMLParser createXMLParser(XMLPlatform xmlPlatform, boolean namespaceAware, boolean whitespacePreserving, String schema){
  XMLParser parser = xmlPlatform.newXMLParser();
  parser.setNamespaceAware(namespaceAware);
  parser.setWhitespacePreserving(whitespacePreserving);
  if (schema != null) {
    parser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    // Workaround for bug #3503583.
    XMLSchemaResolver xmlSchemaResolver = new XMLSchemaResolver();
    URL eclipselinkSchemaURL = xmlSchemaResolver.resolveURL(schema);
    parser.setEntityResolver(xmlSchemaResolver);
    parser.setXMLSchema(eclipselinkSchemaURL);
  }
  return parser;
}

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

private static XMLParser createXMLParser(XMLPlatform xmlPlatform, boolean namespaceAware, boolean whitespacePreserving, String schema){
  XMLParser parser = xmlPlatform.newXMLParser();
  parser.setNamespaceAware(namespaceAware);
  parser.setWhitespacePreserving(whitespacePreserving);
  if (schema != null) {
    parser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    // Workaround for bug #3503583.
    XMLSchemaResolver xmlSchemaResolver = new XMLSchemaResolver();
    URL eclipselinkSchemaURL = xmlSchemaResolver.resolveURL(schema);
    parser.setEntityResolver(xmlSchemaResolver);
    parser.setXMLSchema(eclipselinkSchemaURL);
  }
  return parser;
}

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

private static XMLParser createXMLParser(XMLPlatform xmlPlatform, boolean namespaceAware, boolean whitespacePreserving, String schema){
  XMLParser parser = xmlPlatform.newXMLParser();
  parser.setNamespaceAware(namespaceAware);
  parser.setWhitespacePreserving(whitespacePreserving);
  if (schema != null) {
    parser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
    // Workaround for bug #3503583.
    XMLSchemaResolver xmlSchemaResolver = new XMLSchemaResolver();
    URL eclipselinkSchemaURL = xmlSchemaResolver.resolveURL(schema);
    parser.setEntityResolver(xmlSchemaResolver);
    parser.setXMLSchema(eclipselinkSchemaURL);
  }
  return parser;
}

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

XMLParser parser = xmlPlatform.newXMLParser();
parser.setNamespaceAware(true);
parser.setWhitespacePreserving(false);

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

private XMLParser getXMLParser() {
  if (xmlParser == null || shouldReset) {
    XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
    xmlPlatform.setDisableSecureProcessing(isSecureProcessingDisabled());
    xmlParser = xmlPlatform.newXMLParser();
    xmlParser.setNamespaceAware(true);
    if (null != errorHandler) {
      xmlParser.setErrorHandler(errorHandler);
    }
    if (null != entityResolver) {
      xmlParser.setEntityResolver(entityResolver);
    }
    xmlParser.setValidationMode(validationMode);
    xmlParser.setWhitespacePreserving(isWhitespacePreserving);
    shouldReset = false;
  }
  return xmlParser;
}

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

XMLParser parser = xmlPlatform.newXMLParser();
parser.setNamespaceAware(true);
parser.setWhitespacePreserving(false);

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

private XMLParser getParser() {
  if (parser == null || shouldReset) {
    XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
    xmlPlatform.setDisableSecureProcessing(isSecureProcessingDisabled());
    parser = xmlPlatform.newXMLParser(parserFeatures);
    parser.setNamespaceAware(true);
    if (errorHandler != null) {
      parser.setErrorHandler(errorHandler);
    }
    if (entityResolver != null) {
      parser.setEntityResolver(entityResolver);
    }
    if (schemas != null) {
      try {
        parser.setXMLSchemas(schemas);
      } catch (XMLPlatformException e) {
        throw XMLMarshalException.errorSettingSchemas(e, schemas);
      }
    }
    if (schema != null) {
      parser.setXMLSchema(schema);
    }
    parser.setValidationMode(validationMode);
    parser.setWhitespacePreserving(isWhitespacePreserving);
    shouldReset = false;
  }
  return parser;
}

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