Java源码示例:com.sun.org.apache.xml.internal.res.XMLErrorResources
示例1
/**
* 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.");
}
}
示例2
/** 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");
}
示例3
/**
* 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();
}
示例4
/**
* 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.");
}
}
示例5
/**
* 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;
}
示例6
/**
* 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.");
}
}
示例7
/**
* 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";
}
}
示例8
/**
* 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;
}
示例9
/**
* Return the public identifier of the external subset,
* normalized as described in 4.2.2 External Entities [XML]. If there is
* no external subset or if it has no public identifier, this property
* has no value.
*
* @return the public identifier String object, or null if there is none.
*/
public String getDocumentTypeDeclarationPublicIdentifier()
{
/** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMDefaultBase abstract method */
error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");
return null;
}
示例10
/**
* Given a node handle, return the XPath node name. This should be
* the name as described by the XPath data model, NOT the DOM-style
* name.
*
* @param nodeHandle the id of the node.
* @return String Name of this node, which may be an empty string.
*/
public String getNodeNameX(int nodeHandle)
{
/** @todo: implement this com.sun.org.apache.xml.internal.dtm.DTMDefaultBase abstract method */
error(XMLMessages.createXMLMessage(XMLErrorResources.ER_METHOD_NOT_SUPPORTED, null));//"Not yet supported!");
return null;
}
示例11
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return 0
*/
public short getNodeType()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeType not supported!");
return 0;
}
示例12
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return null
*/
public Node getNextSibling()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNextSibling not supported!");
return null;
}
示例13
/**
* Unimplemented. See org.w3c.dom.NodeList
*
* @param index index of a child of this node in its list of children
*
* @return null
*/
public Node item(int index)
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"item not supported!");
return null;
}
示例14
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return null
*/
public String getTagName()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getTagName not supported!");
return null;
}
示例15
/**
* 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;
}
示例16
/**
* 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;
}
示例17
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return null
*/
public String getNodeName()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeName not supported!");
return null;
}
示例18
/**
* 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;
}
}
示例19
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return false
*/
public boolean hasChildNodes()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasChildNodes not supported!");
return false;
}
示例20
/**
* 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);
}
示例21
/**
* 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;
}
示例22
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return null
*/
public Element getOwnerElement()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getOwnerElement not supported!");
return null;
}
示例23
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return False
*/
public boolean getSpecified()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not supported!");
return false;
}
示例24
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return null
*/
public Document getOwnerDocument()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getOwnerDocument not supported!");
return null;
}
示例25
/** 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;
}
示例26
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return null
*/
public String getNamespaceURI()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNamespaceURI not supported!");
return null;
}
示例27
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return null
*/
public String getPrefix()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getPrefix not supported!");
return null;
}
示例28
/**
* Unimplemented. See org.w3c.dom.Node
*
* @return null
*/
public String getLocalName()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLocalName not supported!");
return null;
}
示例29
/**
* 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;
}
示例30
/**
* Unimplemented. See org.w3c.dom.Document
*
* @return null
*/
public DOMImplementation getImplementation()
{
error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
return null;
}