本文整理汇总了Java中com.sun.org.apache.xml.internal.res.XMLMessages类的典型用法代码示例。如果您正苦于以下问题:Java XMLMessages类的具体用法?Java XMLMessages怎么用?Java XMLMessages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLMessages类属于com.sun.org.apache.xml.internal.res包,在下文中一共展示了XMLMessages类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: QName
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:QName.java
示例2: setScheme
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的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
示例3: setHost
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的package包/类
/**
* Set the host for this URI. If null is passed in, the userinfo
* field is also set to null and the port is set to -1.
*
* @param p_host the host for this URI
*
* @throws MalformedURIException if p_host is not a valid IP
* address or DNS hostname.
*/
public void setHost(String p_host) throws MalformedURIException
{
if (p_host == null || p_host.trim().length() == 0)
{
m_host = p_host;
m_userinfo = null;
m_port = -1;
}
else if (!isWellFormedAddress(p_host))
{
throw new MalformedURIException(XMLMessages.createXMLMessage(XMLErrorResources.ER_HOST_ADDRESS_NOT_WELLFORMED, null)); //"Host is not a well formed address!");
}
m_host = p_host;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:URI.java
示例4: setPort
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:URI.java
示例5: readEntry
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:ChunkedIntArray.java
示例6: writeEntry
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的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
示例7: addNewDTMID
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:SAX2DTM.java
示例8: cloneIterator
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的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:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:SAX2DTM2.java
示例9: startParse
import com.sun.org.apache.xml.internal.res.XMLMessages; //导入依赖的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
注:本文中的com.sun.org.apache.xml.internal.res.XMLMessages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论