当前位置: 首页>>代码示例>>Java>>正文


Java XMLErrorResources类代码示例

本文整理汇总了Java中com.sun.org.apache.xml.internal.res.XMLErrorResources的典型用法代码示例。如果您正苦于以下问题:Java XMLErrorResources类的具体用法?Java XMLErrorResources怎么用?Java XMLErrorResources使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


XMLErrorResources类属于com.sun.org.apache.xml.internal.res包,在下文中一共展示了XMLErrorResources类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: cloneIterator

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Returns a deep copy of this iterator.  The cloned iterator is not reset.
 *
 * @return a deep copy of this iterator.
 */
public DTMAxisIterator cloneIterator()
{
  _isRestartable = false;  // must set to false for any clone

  try
  {
    final AncestorIterator clone = (AncestorIterator) super.clone();

    clone._startNode = _startNode;

    // return clone.reset();
    return clone;
  }
  catch (CloneNotSupportedException e)
  {
    throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported.");
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:DTMDefaultBaseIterators.java

示例2: QName

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Constructs a new QName with the specified namespace URI and
 * local name.
 *
 * @param namespaceURI The namespace URI if known, or null
 * @param localName The local name
 * @param validate If true the new QName will be validated and an IllegalArgumentException will
 *                 be thrown if it is invalid.
 */
public QName(String namespaceURI, String localName, boolean validate)
{

  // This check was already here.  So, for now, I will not add it to the validation
  // that is done when the validate parameter is true.
  if (localName == null)
    throw new IllegalArgumentException(XMLMessages.createXMLMessage(
          XMLErrorResources.ER_ARG_LOCALNAME_NULL, null)); //"Argument 'localName' is null");

  if (validate)
  {
      if (!XML11Char.isXML11ValidNCName(localName))
      {
          throw new IllegalArgumentException(XMLMessages.createXMLMessage(
          XMLErrorResources.ER_ARG_LOCALNAME_INVALID,null )); //"Argument 'localName' not a valid NCName");
      }
  }

  _namespaceURI = namespaceURI;
  _localName = localName;
  m_hashCode = toString().hashCode();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:QName.java

示例3: cloneIterator

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Returns a deep copy of this iterator.   The cloned iterator is not reset.
 *
 * @return a deep copy of this iterator.
 */
public DTMAxisIterator cloneIterator()
{
  _isRestartable = false;

  try
  {
    final PrecedingIterator clone = (PrecedingIterator) super.clone();
    final int[] stackCopy = new int[_stack.length];
    System.arraycopy(_stack, 0, stackCopy, 0, _stack.length);

    clone._stack = stackCopy;

    // return clone.reset();
    return clone;
  }
  catch (CloneNotSupportedException e)
  {
    throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_ITERATOR_CLONE_NOT_SUPPORTED, null)); //"Iterator clone not supported.");
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:DTMDefaultBaseIterators.java

示例4: setPort

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Set the port for this URI. -1 is used to indicate that the port is
 * not specified, otherwise valid port numbers are  between 0 and 65535.
 * If a valid port number is passed in and the host field is null,
 * an exception is thrown.
 *
 * @param p_port the port number for this URI
 *
 * @throws MalformedURIException if p_port is not -1 and not a
 *                                  valid port number
 */
public void setPort(int p_port) throws MalformedURIException
{

  if (p_port >= 0 && p_port <= 65535)
  {
    if (m_host == null)
    {
      throw new MalformedURIException(
        XMLMessages.createXMLMessage(XMLErrorResources.ER_PORT_WHEN_HOST_NULL, null)); //"Port cannot be set when host is null!");
    }
  }
  else if (p_port != -1)
  {
    throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_INVALID_PORT, null)); //"Invalid port number!");
  }

  m_port = p_port;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:URI.java

示例5: addNewDTMID

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Get a new DTM ID beginning at the specified node index.
 * @param  nodeIndex The node identity at which the new DTM ID will begin
 * addressing.
 */
protected void addNewDTMID(int nodeIndex) {
  try
  {
    if(m_mgr==null)
      throw new ClassCastException();

                            // Handle as Extended Addressing
    DTMManagerDefault mgrD=(DTMManagerDefault)m_mgr;
    int id=mgrD.getFirstFreeDTMID();
    mgrD.addDTM(this,id,nodeIndex);
    m_dtmIdent.addElement(id<<DTMManager.IDENT_DTM_NODE_BITS);
  }
  catch(ClassCastException e)
  {
    // %REVIEW% Wrong error message, but I've been told we're trying
    // not to add messages right not for I18N reasons.
    // %REVIEW% Should this be a Fatal Error?
    error(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_DTMIDS_AVAIL, null));//"No more DTM IDs are available";
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:SAX2DTM.java

示例6: startParse

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/** startParse() is a simple API which tells the IncrementalSAXSource
 * to begin reading a document.
 *
 * @throws SAXException is parse thread is already in progress
 * or parsing can not be started.
 * */
public void startParse(InputSource source) throws SAXException
{
  if (fIncrementalParser==null)
    throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_NEEDS_SAXPARSER, null)); //"startParse needs a non-null SAXParser.");
  if (fParseInProgress)
    throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_STARTPARSE_WHILE_PARSING, null)); //"startParse may not be called while parsing.");

  boolean ok=false;

  try
  {
    ok = parseSomeSetup(source);
  }
  catch(Exception ex)
  {
    throw new SAXException(ex);
  }

  if(!ok)
    throw new SAXException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COULD_NOT_INIT_PARSER, null)); //"could not initialize parser with");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:IncrementalSAXSource_Xerces.java

示例7: setScheme

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Set the scheme for this URI. The scheme is converted to lowercase
 * before it is set.
 *
 * @param p_scheme the scheme for this URI (cannot be null)
 *
 * @throws MalformedURIException if p_scheme is not a conformant
 *                                  scheme name
 */
public void setScheme(String p_scheme) throws MalformedURIException
{

  if (p_scheme == null)
  {
    throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_FROM_NULL_STRING, null)); //"Cannot set scheme from null string!");
  }

  if (!isConformantSchemeName(p_scheme))
  {
    throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_SCHEME_NOT_CONFORMANT, null)); //"The scheme is not conformant.");
  }

  m_scheme = p_scheme.toLowerCase();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:URI.java

示例8: readEntry

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Retrieve an integer from the CIA by record number and column within
 * the record, both 0-based (though position 0 is reserved for special
 * purposes).
 * @param position int Record number
 * @param slotpos int Column number
 */
int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException
{
  /*
  try
  {
    return fastArray[(position*slotsize)+offset];
  }
  catch(ArrayIndexOutOfBoundsException aioobe)
  */
  {
    // System.out.println("Using slow read (1)");
    if (offset>=slotsize)
      throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot");
    position*=slotsize;
    int chunkpos = position >> lowbits;
    int slotpos = position & lowmask;
    int[] chunk = chunks.elementAt(chunkpos);
    return chunk[slotpos + offset];
  }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:ChunkedIntArray.java

示例9: writeEntry

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Overwrite the integer found at a specific record and column.
 * Used to back-patch existing records, most often changing their
 * "next sibling" reference from 0 (unknown) to something meaningful
 * @param position int Record number
 * @param offset int Column number
 * @param value int New contents
 */
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException
{
  /*
  try
  {
    fastArray[( position*slotsize)+offset] = value;
  }
  catch(ArrayIndexOutOfBoundsException aioobe)
  */
  {
    if (offset >= slotsize)
      throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_OFFSET_BIGGER_THAN_SLOT, null)); //"Offset bigger than slot");
    position*=slotsize;
    int chunkpos = position >> lowbits;
    int slotpos = position & lowmask;
    int[] chunk = chunks.elementAt(chunkpos);
    chunk[slotpos + offset] = value; // ATOMIC!
  }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:ChunkedIntArray.java

示例10: QName

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Constructs a new QName with the specified namespace URI, prefix
 * and local name.
 *
 * @param namespaceURI The namespace URI if known, or null
 * @param prefix The namespace prefix is known, or null
 * @param localName The local name
 * @param validate If true the new QName will be validated and an IllegalArgumentException will
 *                 be thrown if it is invalid.
 */
public QName(String namespaceURI, String prefix, String localName, boolean validate)
{

  // This check was already here.  So, for now, I will not add it to the validation
  // that is done when the validate parameter is true.
  if (localName == null)
    throw new IllegalArgumentException(XMLMessages.createXMLMessage(
          XMLErrorResources.ER_ARG_LOCALNAME_NULL, null)); //"Argument 'localName' is null");

  if (validate)
  {
      if (!XML11Char.isXML11ValidNCName(localName))
      {
          throw new IllegalArgumentException(XMLMessages.createXMLMessage(
          XMLErrorResources.ER_ARG_LOCALNAME_INVALID,null )); //"Argument 'localName' not a valid NCName");
      }

      if ((null != prefix) && (!XML11Char.isXML11ValidNCName(prefix)))
      {
          throw new IllegalArgumentException(XMLMessages.createXMLMessage(
          XMLErrorResources.ER_ARG_PREFIX_INVALID,null )); //"Argument 'prefix' not a valid NCName");
      }

  }
  _namespaceURI = namespaceURI;
  _prefix = prefix;
  _localName = localName;
  m_hashCode = toString().hashCode();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:QName.java

示例11: ChunkedIntArray

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Create a new CIA with specified record size. Currently record size MUST
 * be a power of two... and in fact is hardcoded to 4.
 */
ChunkedIntArray(int slotsize)
{
  if(this.slotsize<slotsize)
    throw new ArrayIndexOutOfBoundsException(XMLMessages.createXMLMessage(XMLErrorResources.ER_CHUNKEDINTARRAY_NOT_SUPPORTED, new Object[]{Integer.toString(slotsize)})); //"ChunkedIntArray("+slotsize+") not currently supported");
  else if (this.slotsize>slotsize)
    System.out.println("*****WARNING: ChunkedIntArray("+slotsize+") wasting "+(this.slotsize-slotsize)+" words per slot");
  chunks.addElement(fastArray);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:ChunkedIntArray.java

示例12: co_exit_to

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/** Make the ID available for reuse and terminate this coroutine,
 * transferring control to the specified coroutine. Note that this
 * returns immediately rather than waiting for any further coroutine
 * traffic, so the thread can proceed with other shutdown activities.
 *
 * @param arg_object    A value to be passed to the other coroutine.
 * @param thisCoroutine Integer identifier for the coroutine leaving the set.
 * @param toCoroutine   Integer identifier for the coroutine we wish to
 * invoke.
 * @exception java.lang.NoSuchMethodException if toCoroutine isn't a
 * registered member of this group. %REVIEW% whether this is the best choice.
 * */
public synchronized void co_exit_to(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
{
  if(!m_activeIDs.get(toCoroutine))
    throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);

  // We expect these values to be overwritten during the notify()/wait()
  // periods, as other coroutines in this set get their opportunity to run.
  m_yield=arg_object;
  m_nextCoroutine=toCoroutine;

  m_activeIDs.clear(thisCoroutine);

  notify();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:CoroutineManager.java

示例13: init

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
public void init( CoroutineManager co, int controllerCoroutineID,
                  int sourceCoroutineID)
{
  if(co==null)
    co = new CoroutineManager();
  fCoroutineManager = co;
  fControllerCoroutineID = co.co_joinCoroutineSet(controllerCoroutineID);
  fSourceCoroutineID = co.co_joinCoroutineSet(sourceCoroutineID);
  if (fControllerCoroutineID == -1 || fSourceCoroutineID == -1)
    throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COJOINROUTINESET_FAILED, null)); //"co_joinCoroutineSet() failed");

  fNoMoreEvents=false;
  eventcounter=frequency;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:IncrementalSAXSource_Filter.java

示例14: hasChildNodes

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return false
 */
public boolean hasChildNodes()
{

  error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"hasChildNodes not supported!");

  return false;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:UnImplNode.java

示例15: getChildNodes

import com.sun.org.apache.xml.internal.res.XMLErrorResources; //导入依赖的package包/类
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public NodeList getChildNodes()
{

  error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"getChildNodes not supported!");

  return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:UnImplNode.java


注:本文中的com.sun.org.apache.xml.internal.res.XMLErrorResources类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。