gpt4 book ai didi

org.apache.openjpa.lib.meta.XMLMetaDataParser类的使用及代码示例

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

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

XMLMetaDataParser介绍

[英]Custom SAX parser used by the system to quickly parse metadata files. Subclasses should handle the processing of the content.
[中]系统用于快速解析元数据文件的自定义SAX解析器。子类应该处理内容的处理。

代码示例

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

@Override
public void parse(URL url)
  throws IOException {
  _source = url;
  super.parse(url);
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Override this method to clear any state and ready the parser for
 * a new document. Subclasses should call
 * <code>super.reset()</code> to clear superclass state.
 */
protected void reset() {
  super.reset();
  _package = null;
  _class = null;
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Whether parsed resource names are cached to avoid duplicate parsing.
 */
public void setCaching(boolean caching) {
  _caching = caching;
  if (!caching)
    clear();
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Returns a SAXException with the source file name and the given error
 * message.
 */
protected SAXException getException(String msg) {
  return new SAXException(getSourceName() + currentLocation() +
    ": " + msg);
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

Object schemaSource = getSchemaSource();
if (schemaSource != null && _schemaBug) {
  if (_log != null && _log.isTraceEnabled())
  schemaSource = null;
boolean validating = _validating && (getDocType() != null 
  || schemaSource != null);
  if (validating) {
    schema = schemaSource;
    if (schema == null && getDocType() != null)
      xml = new DocTypeReader(xml, getDocType());
    is.setSystemId(sourceName);
  parser.parse(is, this);
  finish();
} catch (SAXException se) {
  IOException ioe = new IOException(se.toString());
  throw ioe;
} finally {
  reset();

代码示例来源:origin: org.apache.openejb.patch/openjpa-jdbc

/**
 * Parse the schema relating to the given class. The schemas will
 * be added to the current schema group.
 */
protected void finish() {
  // now resolve pk, idx, fk info
  super.finish();
  if (!_delay)
    resolveConstraints();
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

public void error(SAXParseException se) throws SAXException {
  throw getException(se.toString());
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

/**
 * Add current comments to the given entity. By default, assumes entity
 * is {@link Commentable}.
 */
protected void addComments(Object obj) {
  String[] comments = currentComments();
  if (comments.length > 0 && obj instanceof Commentable)
    ((Commentable) obj).setComments(comments);
}

代码示例来源:origin: org.apache.openjpa/com.springsource.org.apache.openjpa

public void endElement(String uri, String name, String qName)
  throws SAXException {
  if (_depth < _ignore)
    endElement(qName);
  _text = null;
  if (_comments != null)
    _comments.clear();
  if (_depth == _ignore)
    _ignore = Integer.MAX_VALUE;
  _depth--;
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

/**
 * Return true if the given source is parsed. Otherwise, record that
 * it will be parsed.
 */
protected boolean parsed(String src) {
  if (!_caching)
    return false;
  if (_parsed == null)
    _parsed = new HashMap<ClassLoader, Set<String>>();
  ClassLoader loader = currentClassLoader();
  Set<String> set = _parsed.get(loader);
  if (set == null) {
    set = new HashSet<String>();
    _parsed.put(loader, set);
  }
  boolean added = set.add(src);
  if (!added && _log != null && _log.isTraceEnabled())
    _log.trace(_loc.get("already-parsed", src));
  return !added;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

Object schemaSource = getSchemaSource();
if (schemaSource != null && _schemaBug) {
  if (_log != null && _log.isTraceEnabled())
  schemaSource = null;
boolean validating = _validating && (getDocType() != null 
  || schemaSource != null);
  setParsing(true);
  _sourceName = sourceName;
    if (validating) {
      schema = schemaSource;
      if (schema == null && getDocType() != null)
        xml = new DocTypeReader(xml, getDocType());
      is.setSystemId(sourceName);
    parser.parse(is, this);
    finish();
  } catch (SAXException se) {
    IOException ioe = new IOException(se.toString());
  reset();

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Returns a SAXException with the source file name and the given error
 * message.
 */
protected SAXException getException(String msg) {
  return new SAXException(getSourceName() + currentLocation() +
    ": " + msg);
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Parse the schema relating to the given class. The schemas will
 * be added to the current schema group.
 */
protected void finish() {
  // now resolve pk, idx, fk info
  super.finish();
  if (!_delay)
    resolveConstraints();
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

public void fatalError(SAXParseException se) throws SAXException {
  throw getException(se.toString());
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Add current comments to the given entity. By default, assumes entity
 * is {@link Commentable}.
 */
protected void addComments(Object obj) {
  String[] comments = currentComments();
  if (comments.length > 0 && obj instanceof Commentable)
    ((Commentable) obj).setComments(comments);
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

public void endElement(String uri, String name, String qName)
  throws SAXException {
  if (_depth < _ignore) {
    endElement(qName);
    _extendedNamespace = (_extendedNamespace > 0) ? _extendedNamespace - 1 : 0;
    _openjpaNamespace = (_openjpaNamespace > 0) ? _openjpaNamespace - 1 : 0;
  }
  else if (_depth ==_ignore) {
    _extendedNamespace = (_extendedNamespace > 0) ? _extendedNamespace - 1 : 0;
    _openjpaNamespace = (_openjpaNamespace > 0) ? _openjpaNamespace - 1 : 0;
  }
  
  _text = null;
  if (_comments != null)
    _comments.clear();
  if (_depth == _ignore)
    _ignore = Integer.MAX_VALUE;
  _depth--;
}

代码示例来源:origin: org.apache.openejb.patch/openjpa

/**
 * Return true if the given source is parsed. Otherwise, record that
 * it will be parsed.
 */
protected boolean parsed(String src) {
  if (!_caching)
    return false;
  if (_parsed == null)
    _parsed = new HashMap<ClassLoader, Set<String>>();
  ClassLoader loader = currentClassLoader();
  Set<String> set = _parsed.get(loader);
  if (set == null) {
    set = new HashSet<String>();
    _parsed.put(loader, set);
  }
  boolean added = set.add(src);
  if (!added && _log != null && _log.isTraceEnabled())
    _log.trace(_loc.get("already-parsed", src));
  return !added;
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

Object schemaSource = getSchemaSource();
if (schemaSource != null && _schemaBug) {
  if (_log != null && _log.isTraceEnabled())
  schemaSource = null;
boolean validating = _validating && (getDocType() != null 
  || schemaSource != null);
  setParsing(true);
  _sourceName = sourceName;
    if (validating) {
      schema = schemaSource;
      if (schema == null && getDocType() != null)
        xml = new DocTypeReader(xml, getDocType());
      is.setSystemId(sourceName);
    parser.parse(is, this);
    finish();
  } catch (SAXException se) {
    IOException ioe = new IOException(se.toString());
  reset();

代码示例来源:origin: org.apache.openjpa/openjpa-all

public void parse(MetaDataIterator itr) throws IOException {
  parse(itr, false);
}

代码示例来源:origin: org.apache.openjpa/openjpa-lib

/**
 * Returns a SAXException with the source file name and the given error
 * message.
 */
protected SAXException getException(String msg) {
  return new SAXException(getSourceName() + currentLocation() +
    ": " + msg);
}

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