com.sun.org.apache.xml.internal.res.XMLErrorResources Java Examples

The following examples show how to use com.sun.org.apache.xml.internal.res.XMLErrorResources. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DTMDefaultBaseIterators.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * 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.");
  }
}
 
Example #2
Source File: URI.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #3
Source File: SAX2DTM.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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";
  }
}
 
Example #4
Source File: DTMDefaultBaseIterators.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * 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.");
  }
}
 
Example #5
Source File: URI.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
}
 
Example #6
Source File: DTMDefaultBaseIterators.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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.");
  }
}
 
Example #7
Source File: IncrementalSAXSource_Xerces.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/** 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");
}
 
Example #8
Source File: UnImplNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public Element getOwnerElement()
{

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

  return null;
}
 
Example #9
Source File: UnImplNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Element
 *
 * @param name Name of the element
 *
 * @return null
 */
public NodeList getElementsByTagName(String name)
{

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

  return null;
}
 
Example #10
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return 0
 */
public short getNodeType()
{

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

  return 0;
}
 
Example #11
Source File: CoroutineManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** 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();
}
 
Example #12
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public Node getNextSibling()
{

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

  return null;
}
 
Example #13
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public String getNamespaceURI()
{

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

  return null;
}
 
Example #14
Source File: URI.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Initialize the scheme for this URI from a URI string spec.
 *
 * @param p_uriSpec the URI specification (cannot be null)
 *
 * @throws MalformedURIException if URI does not have a conformant
 *                                  scheme
 */
private void initializeScheme(String p_uriSpec) throws MalformedURIException
{

  int uriSpecLen = p_uriSpec.length();
  int index = 0;
  String scheme = null;
  char testChar = '\0';

  while (index < uriSpecLen)
  {
    testChar = p_uriSpec.charAt(index);

    if (testChar == ':' || testChar == '/' || testChar == '?'
            || testChar == '#')
    {
      break;
    }

    index++;
  }

  scheme = p_uriSpec.substring(0, index);

  if (scheme.length() == 0)
  {
    throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_NO_SCHEME_INURI, null)); //"No scheme found in URI.");
  }
  else
  {
    setScheme(scheme);
  }
}
 
Example #15
Source File: UnImplNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public String getNodeName()
{

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

  return null;
}
 
Example #16
Source File: URI.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Set the fragment for this URI. A non-null value is valid only
 * if this is a URI conforming to the generic URI syntax and
 * the path value is not null.
 *
 * @param p_fragment the fragment for this URI
 *
 * @throws MalformedURIException if p_fragment is not null and this
 *                                  URI does not conform to the generic
 *                                  URI syntax or if the path is null
 */
public void setFragment(String p_fragment) throws MalformedURIException
{

  if (p_fragment == null)
  {
    m_fragment = null;
  }
  else if (!isGenericURI())
  {
    throw new MalformedURIException(
      XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_FOR_GENERIC_URI, null)); //"Fragment can only be set for a generic URI!");
  }
  else if (getPath() == null)
  {
    throw new MalformedURIException(
      XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_WHEN_PATH_NULL, null)); //"Fragment cannot be set when path is null!");
  }
  else if (!isURIString(p_fragment))
  {
    throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_FRAG_INVALID_CHAR, null)); //"Fragment contains invalid character!");
  }
  else
  {
    m_fragment = p_fragment;
  }
}
 
Example #17
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public String getPrefix()
{

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

  return null;
}
 
Example #18
Source File: UnImplNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return false
 */
public boolean hasChildNodes()
{

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

  return false;
}
 
Example #19
Source File: IncrementalSAXSource_Filter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example #20
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public Element getOwnerElement()
{

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

  return null;
}
 
Example #21
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Document
 *
 * @return null
 */
public DocumentFragment createDocumentFragment()
{

  error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);

  return null;
}
 
Example #22
Source File: ChunkedIntArray.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #23
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public String getLocalName()
{

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

  return null;
}
 
Example #24
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Document
 *
 * @return null
 */
public Element getDocumentElement()
{

  error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);

  return null;
}
 
Example #25
Source File: CoroutineManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Transfer control to another coroutine which has already been started and
 * is waiting on this CoroutineManager. We won't return from this call
 * until that routine has relinquished control.
 *
 * %TBD% What should we do if toCoroutine isn't registered? Exception?
 *
 * @param arg_object A value to be passed to the other coroutine.
 * @param thisCoroutine Integer identifier for this coroutine. This is the
 * ID we watch for to see if we're the ones being resumed.
 * @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 Object co_resume(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;

  notify();
  while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY)
    {
      try
        {
          // System.out.println("waiting...");
          wait();
        }
      catch(java.lang.InterruptedException e)
        {
          // %TBD% -- Declare? Encapsulate? Ignore? Or
          // dance deasil about the program counter?
        }
    }

  if(m_nextCoroutine==NOBODY)
    {
      // Pass it along
      co_exit(thisCoroutine);
      // And inform this coroutine that its partners are Going Away
      // %REVIEW% Should this throw/return something more useful?
      throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request");
    }

  return m_yield;
}
 
Example #26
Source File: UnImplNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 */
public Document getOwnerDocument()
{

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

  return null;
}
 
Example #27
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return null
 *
 * @throws DOMException
 */
public String getNodeValue() throws DOMException
{

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

  return null;
}
 
Example #28
Source File: UnImplNode.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Document
 *
 * @return null
 */
public DOMImplementation getImplementation()
{

  error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);

  return null;
}
 
Example #29
Source File: UnImplNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Node
 *
 * @return False
 */
public boolean getSpecified()
{

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

  return false;
}
 
Example #30
Source File: UnImplNode.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Unimplemented. See org.w3c.dom.Document
 *
 * @param data Data for text node
 *
 * @return null
 */
public Text createTextNode(String data)
{

  error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);

  return null;
}