gpt4 book ai didi

org.codehaus.stax2.validation.XMLValidationException类的使用及代码示例

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

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

XMLValidationException介绍

[英]Specialized sub-class of XMLStreamException, to be used for indicating fatal validation problems (when in mode in which exceptions are to be thrown).

Note: constructors are protected, since direct instantiation should be done using factory methods. Reason for this is that the base XMLStreamException has less than robust handling of optional arguments, and thus factory methods of this class can take care to choose appropriate constructors to call, to make sure super-class does not barf (NPE or such).
[中]XMLStreamException的专门子类,用于指示致命的验证问题(在抛出异常的模式下)。
注意:构造函数是受保护的,因为直接实例化应该使用工厂方法来完成。原因是基本XMLStreamException对可选参数的处理不够健壮,因此该类的工厂方法可以小心地选择适当的构造函数来调用,以确保超类不会barf(NPE或诸如此类)。

代码示例

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

/**
 * Method is overridden for two main reasons: first, default method
 * does not display public/system id information, even if it exists, and
 * second, default implementation can not handle nested Location
 * information.
 */
public String getMessage()
{
  String locMsg = getLocationDesc();
  /* Better not use super's message if we do have location information,
   * since parent's message contains (part of) Location
   * info; something we can regenerate better...
   */
  if (locMsg == null) {
    return super.getMessage();
  }
  String msg = getValidationProblem().getMessage();
  StringBuffer sb = new StringBuffer(msg.length() + locMsg.length() + 20);
  sb.append(msg);
  StringUtil.appendLF(sb);
  sb.append(" at ");
  sb.append(locMsg);
  return sb.toString();
}

代码示例来源:origin: Nextdoor/bender

protected XMLValidationException(XMLValidationProblem cause)
{
  super();
  if (cause == null) {
    throwMissing();
  }
  mCause = cause;
}

代码示例来源:origin: Nextdoor/bender

/**
 * Convenience method for constructing a {@link XMLValidationException}
 * to throw based on information contained in this object.
 * Base implementation is equivalent to:
 *<pre>
 *  return XMLValidationException.createException(this);
 *</pre>
 *
 * @since 3.0
 */
public XMLValidationException toException()
{
  return XMLValidationException.createException(this);
}

代码示例来源:origin: Nextdoor/bender

public static XMLValidationException createException(XMLValidationProblem cause)
{
  String msg = cause.getMessage();
  if (msg == null) {
    return new XMLValidationException(cause);
  }
  Location loc = cause.getLocation();
  if (loc == null) {
    return new XMLValidationException(cause, msg);
  }
  return new XMLValidationException(cause, msg, loc);
}

代码示例来源:origin: woodstox/wstx-asl

public static XMLValidationException createException(XMLValidationProblem cause)
{
  String msg = cause.getMessage();
  if (msg == null) {
    return new XMLValidationException(cause);
  }
  Location loc = cause.getLocation();
  if (loc == null) {
    return new XMLValidationException(cause, msg);
  }
  return new XMLValidationException(cause, msg, loc);
}

代码示例来源:origin: com.fasterxml/aalto-xml

/**
 * Method is overridden for two main reasons: first, default method
 * does not display public/system id information, even if it exists, and
 * second, default implementation can not handle nested Location
 * information.
 */
@Override
public String getMessage()
{
  String locMsg = getLocationDesc();
  /* Better not use super's message if we do have location information,
   * since parent's message contains (part of) Location
   * info; something we can regenerate better...
   */
  if (locMsg == null) {
    return super.getMessage();
  }
  String msg = getValidationProblem().getMessage();
  StringBuilder sb = new StringBuilder(msg.length() + locMsg.length() + 20);
  sb.append(msg);
  sb.append('\n');
  sb.append(" at ");
  sb.append(locMsg);
  return sb.toString();
}

代码示例来源:origin: woodstox/wstx-lgpl

protected XMLValidationException(XMLValidationProblem cause, String msg)
{
  super(msg);
  if (cause == null) {
    throwMissing();
  }
  mCause = cause;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox

public static XMLValidationException createException(XMLValidationProblem cause)
{
  String msg = cause.getMessage();
  if (msg == null) {
    return new XMLValidationException(cause);
  }
  Location loc = cause.getLocation();
  if (loc == null) {
    return new XMLValidationException(cause, msg);
  }
  return new XMLValidationException(cause, msg, loc);
}

代码示例来源:origin: FasterXML/aalto-xml

/**
 * Method is overridden for two main reasons: first, default method
 * does not display public/system id information, even if it exists, and
 * second, default implementation can not handle nested Location
 * information.
 */
@Override
public String getMessage()
{
  String locMsg = getLocationDesc();
  /* Better not use super's message if we do have location information,
   * since parent's message contains (part of) Location
   * info; something we can regenerate better...
   */
  if (locMsg == null) {
    return super.getMessage();
  }
  String msg = getValidationProblem().getMessage();
  StringBuilder sb = new StringBuilder(msg.length() + locMsg.length() + 20);
  sb.append(msg);
  sb.append('\n');
  sb.append(" at ");
  sb.append(locMsg);
  return sb.toString();
}

代码示例来源:origin: woodstox/wstx-asl

protected XMLValidationException(XMLValidationProblem cause, String msg,
                 Location loc)
{
  super(msg, loc);
  if (cause == null) {
    throwMissing();
  }
  mCause = cause;
}

代码示例来源:origin: woodstox/wstx-lgpl

public static XMLValidationException createException(XMLValidationProblem cause)
{
  String msg = cause.getMessage();
  if (msg == null) {
    return new XMLValidationException(cause);
  }
  Location loc = cause.getLocation();
  if (loc == null) {
    return new XMLValidationException(cause, msg);
  }
  return new XMLValidationException(cause, msg, loc);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox

/**
 * Method is overridden for two main reasons: first, default method
 * does not display public/system id information, even if it exists, and
 * second, default implementation can not handle nested Location
 * information.
 */
public String getMessage()
{
  String locMsg = getLocationDesc();
  /* Better not use super's message if we do have location information,
   * since parent's message contains (part of) Location
   * info; something we can regenerate better...
   */
  if (locMsg == null) {
    return super.getMessage();
  }
  String msg = getValidationProblem().getMessage();
  StringBuffer sb = new StringBuffer(msg.length() + locMsg.length() + 20);
  sb.append(msg);
  StringUtil.appendLF(sb);
  sb.append(" at ");
  sb.append(locMsg);
  return sb.toString();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox

protected XMLValidationException(XMLValidationProblem cause)
{
  super();
  if (cause == null) {
    throwMissing();
  }
  mCause = cause;
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

/**
 * Method is overridden for two main reasons: first, default method
 * does not display public/system id information, even if it exists, and
 * second, default implementation can not handle nested Location
 * information.
 */
public String getMessage()
{
  String locMsg = getLocationDesc();
  /* Better not use super's message if we do have location information,
   * since parent's message contains (part of) Location
   * info; something we can regenerate better...
   */
  if (locMsg == null) {
    return super.getMessage();
  }
  String msg = getValidationProblem().getMessage();
  StringBuffer sb = new StringBuffer(msg.length() + locMsg.length() + 20);
  sb.append(msg);
  StringUtil.appendLF(sb);
  sb.append(" at ");
  sb.append(locMsg);
  return sb.toString();
}

代码示例来源:origin: woodstox/wstx-lgpl

protected XMLValidationException(XMLValidationProblem cause)
{
  super();
  if (cause == null) {
    throwMissing();
  }
  mCause = cause;
}

代码示例来源:origin: woodstox/wstx-asl

/**
 * Method is overridden for two main reasons: first, default method
 * does not display public/system id information, even if it exists, and
 * second, default implementation can not handle nested Location
 * information.
 */
public String getMessage()
{
  String locMsg = getLocationDesc();
  /* Better not use super's message if we do have location information,
   * since parent's message contains (part of) Location
   * info; something we can regenerate better...
   */
  if (locMsg == null) {
    return super.getMessage();
  }
  String msg = getValidationProblem().getMessage();
  StringBuffer sb = new StringBuffer(msg.length() + locMsg.length() + 20);
  sb.append(msg);
  StringUtil.appendLF(sb);
  sb.append(" at ");
  sb.append(locMsg);
  return sb.toString();
}

代码示例来源:origin: woodstox/wstx-lgpl

protected XMLValidationException(XMLValidationProblem cause, String msg,
                 Location loc)
{
  super(msg, loc);
  if (cause == null) {
    throwMissing();
  }
  mCause = cause;
}

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

/**
 * Method is overridden for two main reasons: first, default method
 * does not display public/system id information, even if it exists, and
 * second, default implementation can not handle nested Location
 * information.
 */
@Override
public String getMessage()
{
  String locMsg = getLocationDesc();
  /* Better not use super's message if we do have location information,
   * since parent's message contains (part of) Location
   * info; something we can regenerate better...
   */
  if (locMsg == null) {
    return super.getMessage();
  }
  String msg = getValidationProblem().getMessage();
  StringBuilder sb = new StringBuilder(msg.length() + locMsg.length() + 20);
  sb.append(msg);
  StringUtil.appendLF(sb);
  sb.append(" at ");
  sb.append(locMsg);
  return sb.toString();
}

代码示例来源:origin: woodstox/wstx-asl

protected XMLValidationException(XMLValidationProblem cause)
{
  super();
  if (cause == null) {
    throwMissing();
  }
  mCause = cause;
}

代码示例来源:origin: woodstox/wstx-lgpl

/**
 * Method is overridden for two main reasons: first, default method
 * does not display public/system id information, even if it exists, and
 * second, default implementation can not handle nested Location
 * information.
 */
public String getMessage()
{
  String locMsg = getLocationDesc();
  /* Better not use super's message if we do have location information,
   * since parent's message contains (part of) Location
   * info; something we can regenerate better...
   */
  if (locMsg == null) {
    return super.getMessage();
  }
  String msg = getValidationProblem().getMessage();
  StringBuffer sb = new StringBuffer(msg.length() + locMsg.length() + 20);
  sb.append(msg);
  StringUtil.appendLF(sb);
  sb.append(" at ");
  sb.append(locMsg);
  return sb.toString();
}

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