本文整理汇总了Java中com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter类的典型用法代码示例。如果您正苦于以下问题:Java XMLMessageFormatter类的具体用法?Java XMLMessageFormatter怎么用?Java XMLMessageFormatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLMessageFormatter类属于com.sun.org.apache.xerces.internal.impl.msg包,在下文中一共展示了XMLMessageFormatter类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startPE
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* start a parameter entity dealing with the textdecl if there is any
*
* @param name The name of the parameter entity to start (without the '%')
* @param literal Whether this is happening within a literal
*/
protected void startPE(String name, boolean literal)
throws IOException, XNIException {
int depth = fPEDepth;
String pName = "%"+name;
if (fValidation && !fEntityStore.isDeclaredEntity(pName)) {
fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,"EntityNotDeclared",
new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR);
}
fEntityManager.startEntity(fSymbolTable.addSymbol(pName),
literal);
// if we actually got a new entity and it's external
// parse text decl if there is any
if (depth != fPEDepth && fEntityScanner.isExternal()) {
scanTextDecl();
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:XMLDTDScannerImpl.java
示例2: elementDecl
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* An element declaration.
*
* @param name The name of the element.
* @param contentModel The element content model.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void elementDecl(String name, String contentModel, Augmentations augs)
throws XNIException {
//check VC: Unique Element Declaration
if (fValidation) {
if (fDTDElementDecls.contains(name)) {
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"MSG_ELEMENT_ALREADY_DECLARED",
new Object[]{ name},
XMLErrorReporter.SEVERITY_ERROR);
}
else {
fDTDElementDecls.add(name);
}
}
// call handlers
if(fDTDGrammar != null )
fDTDGrammar.elementDecl(name, contentModel, augs);
if (fDTDHandler != null) {
fDTDHandler.elementDecl(name, contentModel, augs);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:35,代码来源:XMLDTDProcessor.java
示例3: notationDecl
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* A notation declaration
*
* @param name The name of the notation.
* @param identifier An object containing all location information
* pertinent to this notation.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void notationDecl(String name, XMLResourceIdentifier identifier,
Augmentations augs) throws XNIException {
// VC: Unique Notation Name
if (fValidation) {
DTDGrammar grammar = (fDTDGrammar != null ? fDTDGrammar : fGrammarBucket.getActiveGrammar());
if (grammar.getNotationDeclIndex(name) != -1) {
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"UniqueNotationName",
new Object[]{name},
XMLErrorReporter.SEVERITY_ERROR);
}
}
// call handlers
if(fDTDGrammar != null)
fDTDGrammar.notationDecl(name, identifier, augs);
if (fDTDHandler != null) {
fDTDHandler.notationDecl(name, identifier, augs);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:XMLDTDProcessor.java
示例4: element
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* A referenced element in a mixed or children content model.
*
* @param elementName The name of the referenced element.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void element(String elementName, Augmentations augs) throws XNIException {
// check VC: No duplicate Types, in a single mixed-content declaration
if (fMixed && fValidation) {
if (fMixedElementTypes.contains(elementName)) {
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"DuplicateTypeInMixedContent",
new Object[]{fDTDElementDeclName, elementName},
XMLErrorReporter.SEVERITY_ERROR);
}
else {
fMixedElementTypes.add(elementName);
}
}
// call handlers
if(fDTDGrammar != null)
fDTDGrammar.element(elementName, augs);
if (fDTDContentModelHandler != null) {
fDTDContentModelHandler.element(elementName, augs);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:XMLDTDProcessor.java
示例5: comment
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* A comment.
*
* @param text The text in the comment.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by application to signal an error.
*/
public void comment(XMLString text, Augmentations augs) throws XNIException {
// fixes E15.1
if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"MSG_CONTENT_INVALID_SPECIFIED",
new Object[]{ fCurrentElement.rawname,
"EMPTY",
"comment"},
XMLErrorReporter.SEVERITY_ERROR);
}
}
// call handlers
if (fDocumentHandler != null) {
fDocumentHandler.comment(text, augs);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:XMLDTDValidator.java
示例6: processingInstruction
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* A processing instruction. Processing instructions consist of a
* target name and, optionally, text data. The data is only meaningful
* to the application.
* <p>
* Typically, a processing instruction's data will contain a series
* of pseudo-attributes. These pseudo-attributes follow the form of
* element attributes but are <strong>not</strong> parsed or presented
* to the application as anything other than text. The application is
* responsible for parsing the data.
*
* @param target The target.
* @param data The data or null if none specified.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void processingInstruction(String target, XMLString data, Augmentations augs)
throws XNIException {
// fixes E15.1
if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"MSG_CONTENT_INVALID_SPECIFIED",
new Object[]{ fCurrentElement.rawname,
"EMPTY",
"processing instruction"},
XMLErrorReporter.SEVERITY_ERROR);
}
}
// call handlers
if (fDocumentHandler != null) {
fDocumentHandler.processingInstruction(target, data, augs);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:XMLDTDValidator.java
示例7: startGeneralEntity
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* This method notifies the start of a general entity.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
* @param name The name of the general entity.
* @param identifier The resource identifier.
* @param encoding The auto-detected IANA encoding name of the entity
* stream. This value will be null in those situations
* where the entity encoding is not auto-detected (e.g.
* internal entities or a document entity that is
* parsed from a java.io.Reader).
* @param augs Additional information that may include infoset augmentations
*
* @exception XNIException Thrown by handler to signal an error.
*/
public void startGeneralEntity(String name,
XMLResourceIdentifier identifier,
String encoding,
Augmentations augs) throws XNIException {
if (fPerformValidation && fElementDepth >= 0 && fDTDGrammar != null) {
fDTDGrammar.getElementDecl(fCurrentElementIndex, fTempElementDecl);
// fixes E15.1
if (fTempElementDecl.type == XMLElementDecl.TYPE_EMPTY) {
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"MSG_CONTENT_INVALID_SPECIFIED",
new Object[]{ fCurrentElement.rawname,
"EMPTY", "ENTITY"},
XMLErrorReporter.SEVERITY_ERROR);
}
if (fGrammarBucket.getStandalone()) {
XMLDTDLoader.checkStandaloneEntityRef(name, fDTDGrammar, fEntityDecl, fErrorReporter);
}
}
if (fDocumentHandler != null) {
fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:XMLDTDValidator.java
示例8: addUnparsedEntity
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* Adds an unparsed entity declaration.
* <p>
* <strong>Note:</strong> This method ignores subsequent entity
* declarations.
* <p>
* <strong>Note:</strong> The name should be a unique symbol. The
* SymbolTable can be used for this purpose.
*
* @param name The name of the entity.
* @param publicId The public identifier of the entity.
* @param systemId The system identifier of the entity.
* @param notation The name of the notation.
*
* @see SymbolTable
*/
public void addUnparsedEntity(String name,
String publicId, String systemId,
String baseSystemId, String notation) {
if (!fEntities.containsKey(name)) {
Entity.ExternalEntity entity = new Entity.ExternalEntity(name,
new XMLEntityDescriptionImpl(name, publicId, systemId, baseSystemId, null),
notation, fInExternalSubset);
fEntities.put(name, entity);
} else{
if(fWarnDuplicateEntityDef){
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"MSG_DUPLICATE_ENTITY_DEFINITION",
new Object[]{ name },
XMLErrorReporter.SEVERITY_WARNING );
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:XMLEntityManager.java
示例9: read
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* Read characters into a portion of an array. This method will block
* until some input is available, an I/O error occurs, or the end of the
* stream is reached.
*
* @param ch Destination buffer
* @param offset Offset at which to start storing characters
* @param length Maximum number of characters to read
*
* @return The number of characters read, or -1 if the end of the
* stream has been reached
*
* @exception IOException If an I/O error occurs
*/
public int read(char ch[], int offset, int length) throws IOException {
if (length > fBuffer.length) {
length = fBuffer.length;
}
int count = fInputStream.read(fBuffer, 0, length);
for (int i = 0; i < count; i++) {
int b0 = fBuffer[i];
if (b0 < 0) {
throw new MalformedByteSequenceException(fFormatter,
fLocale, XMLMessageFormatter.XML_DOMAIN,
"InvalidASCII", new Object [] {Integer.toString(b0 & 0x0FF)});
}
ch[offset + i] = (char)b0;
}
return count;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:ASCIIReader.java
示例10: addUnparsedEntity
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* Adds an unparsed entity declaration.
* <p>
* <strong>Note:</strong> This method ignores subsequent entity
* declarations.
* <p>
* <strong>Note:</strong> The name should be a unique symbol. The
* SymbolTable can be used for this purpose.
*
* @param name The name of the entity.
* @param publicId The public identifier of the entity.
* @param systemId The system identifier of the entity.
* @param notation The name of the notation.
*
* @see SymbolTable
*/
public void addUnparsedEntity(String name,
String publicId, String systemId,
String baseSystemId, String notation) {
fCurrentEntity = fEntityManager.getCurrentEntity();
if (!fEntities.containsKey(name)) {
Entity entity = new Entity.ExternalEntity(name, new XMLResourceIdentifierImpl(publicId, systemId, baseSystemId, null), notation, fInExternalSubset);
// (fCurrentEntity == null) ? fasle : fCurrentEntity.isEntityDeclInExternalSubset());
// fCurrentEntity.isEntityDeclInExternalSubset());
fEntities.put(name, entity);
}
else{
if(fWarnDuplicateEntityDef){
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"MSG_DUPLICATE_ENTITY_DEFINITION",
new Object[]{ name },
XMLErrorReporter.SEVERITY_WARNING );
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:XMLEntityStorage.java
示例11: startPE
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* start a parameter entity dealing with the textdecl if there is any
*
* @param name The name of the parameter entity to start (without the '%')
* @param literal Whether this is happening within a literal
*/
protected void startPE(String name, boolean literal)
throws IOException, XNIException {
int depth = fPEDepth;
String pName = "%"+name;
if (fValidation && !fEntityStore.isDeclaredEntity(pName)) {
fErrorReporter.reportError( XMLMessageFormatter.XML_DOMAIN,"EntityNotDeclared",
new Object[]{name}, XMLErrorReporter.SEVERITY_ERROR);
}
fEntityManager.startEntity(false, fSymbolTable.addSymbol(pName),
literal);
// if we actually got a new entity and it's external
// parse text decl if there is any
if (depth != fPEDepth && fEntityScanner.isExternal()) {
scanTextDecl();
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:XMLDTDScannerImpl.java
示例12: checkLimit
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* Checks whether the value of the specified Limit exceeds its limit
*
* @param limit The Limit to be checked
* @param entity The current entity
* @param offset The index of the first byte
* @param length The length of the entity scanned
*/
protected void checkLimit(Limit limit, ScannedEntity entity, int offset, int length) {
fLimitAnalyzer.addValue(limit, entity.name, length);
if (fSecurityManager.isOverLimit(limit, fLimitAnalyzer)) {
fSecurityManager.debugPrint(fLimitAnalyzer);
Object[] e = (limit == Limit.ENTITY_REPLACEMENT_LIMIT) ?
new Object[]{fLimitAnalyzer.getValue(limit),
fSecurityManager.getLimit(limit), fSecurityManager.getStateLiteral(limit)} :
new Object[]{entity.name, fLimitAnalyzer.getValue(limit),
fSecurityManager.getLimit(limit), fSecurityManager.getStateLiteral(limit)};
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, limit.key(),
e, XMLErrorReporter.SEVERITY_FATAL_ERROR);
}
if (fSecurityManager.isOverLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT, fLimitAnalyzer)) {
fSecurityManager.debugPrint(fLimitAnalyzer);
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "TotalEntitySizeLimit",
new Object[]{fLimitAnalyzer.getTotalValue(Limit.TOTAL_ENTITY_SIZE_LIMIT),
fSecurityManager.getLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT),
fSecurityManager.getStateLiteral(Limit.TOTAL_ENTITY_SIZE_LIMIT)},
XMLErrorReporter.SEVERITY_FATAL_ERROR);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:XMLEntityScanner.java
示例13: addUnparsedEntity
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; //导入依赖的package包/类
/**
* Adds an unparsed entity declaration.
* <p>
* <strong>Note:</strong> This method ignores subsequent entity
* declarations.
* <p>
* <strong>Note:</strong> The name should be a unique symbol. The
* SymbolTable can be used for this purpose.
*
* @param name The name of the entity.
* @param publicId The public identifier of the entity.
* @param systemId The system identifier of the entity.
* @param notation The name of the notation.
*
* @see SymbolTable
*/
public void addUnparsedEntity(String name,
String publicId, String systemId,
String baseSystemId, String notation) {
fCurrentEntity = fEntityManager.getCurrentEntity();
if (!fEntities.containsKey(name)) {
Entity entity = new Entity.ExternalEntity(name,
new XMLResourceIdentifierImpl(publicId, systemId, baseSystemId, null),
notation, fInExternalSubset);
fEntities.put(name, entity);
}
else{
if(fWarnDuplicateEntityDef){
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"MSG_DUPLICATE_ENTITY_DEFINITION",
new Object[]{ name },
XMLErrorReporter.SEVERITY_WARNING );
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:37,代码来源:XMLEntityStorage.java
注:本文中的com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论