本文整理汇总了Java中com.sun.org.apache.xerces.internal.xni.XNIException类的典型用法代码示例。如果您正苦于以下问题:Java XNIException类的具体用法?Java XNIException怎么用?Java XNIException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XNIException类属于com.sun.org.apache.xerces.internal.xni包,在下文中一共展示了XNIException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: textDecl
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
* Notifies of the presence of a TextDecl line in an entity. If present,
* this method will be called immediately following the startEntity call.
* <p>
* <strong>Note:</strong> This method will never be called for the
* document entity; it is only called for external general entities
* referenced in document content.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
* @param version The XML version, or null if not specified.
* @param encoding The IANA encoding name of the entity.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void textDecl (String version, String encoding, Augmentations augs) throws XNIException {
if (fInDTD){
return;
}
if (!fDeferNodeExpansion) {
if (fCurrentEntityDecl != null && !fFilterReject) {
fCurrentEntityDecl.setXmlEncoding (encoding);
if (version != null)
fCurrentEntityDecl.setXmlVersion (version);
}
}
else {
if (fDeferredEntityDecl !=-1) {
fDeferredDocumentImpl.setEntityInfo (fDeferredEntityDecl, version, encoding);
}
}
}
示例2: endDTD
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
* The end of the DTD.
*
* @param augs Additional information that may include infoset
* augmentations.
* @throws XNIException Thrown by handler to signal an error.
*/
public void endDTD(Augmentations augs) throws XNIException {
fIsImmutable = true;
// make sure our description contains useful stuff...
if (fGrammarDescription.getRootName() == null) {
// we don't know what the root is; so use possibleRoots...
int chunk, index = 0;
String currName = null;
final int size = fElementDeclCount;
ArrayList elements = new ArrayList(size);
for (int i = 0; i < size; ++i) {
chunk = i >> CHUNK_SHIFT;
index = i & CHUNK_MASK;
currName = fElementDeclName[chunk][index].rawname;
elements.add(currName);
}
fGrammarDescription.setPossibleRoots(elements);
}
}
示例3: startPE
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的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();
}
}
示例4: startDTD
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
* The start of the DTD.
*
* @param locator The document locator, or null if the document
* location cannot be reported during the parsing of
* the document DTD. However, it is <em>strongly</em>
* recommended that a locator be supplied that can
* at least report the base system identifier of the
* DTD.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void startDTD (XMLLocator locator, Augmentations augs) throws XNIException {
if (DEBUG_EVENTS) {
System.out.println ("==>startDTD");
if (DEBUG_BASEURI) {
System.out.println (" expandedSystemId: "+locator.getExpandedSystemId ());
System.out.println (" baseURI:"+ locator.getBaseSystemId ());
}
}
fInDTD = true;
if (locator != null) {
fBaseURIStack.push (locator.getBaseSystemId ());
}
if (fDeferNodeExpansion || fDocumentImpl != null) {
fInternalSubset = new StringBuilder (1024);
}
}
示例5: startElement
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
* The start of an element.
*
* @param element The name of the element.
* @param attributes The element attributes.
* @param augs Additional information that may include infoset augmentations
*
* @exception XNIException
* Thrown by handler to signal an error.
*/
public void startElement(QName element, XMLAttributes attributes,
Augmentations augs) throws XNIException {
if (!resolveXPointer(element, attributes, augs,
XPointerPart.EVENT_ELEMENT_START)) {
// xml:base and xml:lang processing
if (fFixupBase) {
processXMLBaseAttributes(attributes);
}
if (fFixupLang) {
processXMLLangAttributes(attributes);
}
// set the context invalid if the element till an element from the result infoset is included
fNamespaceContext.setContextInvalid();
return;
}
super.startElement(element, attributes, augs);
}
示例6: endNamespaceScope
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/** Handles end element. */
protected void endNamespaceScope(QName element, Augmentations augs, boolean isEmpty)
throws XNIException {
// bind element
String eprefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING;
element.uri = fNamespaceContext.getURI(eprefix);
if (element.uri != null) {
element.prefix = eprefix;
}
// call handlers
if (fDocumentHandler != null) {
if (!isEmpty) {
fDocumentHandler.endElement(element, augs);
}
}
// pop context
fNamespaceContext.popContext();
}
示例7: startDocument
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
public void startDocument(XMLLocator locator, String encoding,
NamespaceContext namespaceContext, Augmentations augs)
throws XNIException {
fErrorReporter = (XMLErrorReporter)config.getProperty(ERROR_REPORTER);
fGenerateSyntheticAnnotation = config.getFeature(GENERATE_SYNTHETIC_ANNOTATION);
fHasNonSchemaAttributes.clear();
fSawAnnotation.clear();
schemaDOM = new SchemaDOM();
fCurrentAnnotationElement = null;
fAnnotationDepth = -1;
fInnerAnnotationDepth = -1;
fDepth = -1;
fLocator = locator;
fNamespaceContext = namespaceContext;
schemaDOM.setDocumentURI(locator.getExpandedSystemId());
}
示例8: startParameterEntity
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
* This method notifies of the start of a parameter entity. The parameter
* entity name start with a '%' character.
*
* @param name The name of the parameter 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 parameter entities).
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void startParameterEntity (String name,
XMLResourceIdentifier identifier,
String encoding,
Augmentations augs) throws XNIException {
if (DEBUG_EVENTS) {
System.out.println ("==>startParameterEntity: "+name);
if (DEBUG_BASEURI) {
System.out.println (" expandedSystemId: "+identifier.getExpandedSystemId ());
System.out.println (" baseURI:"+ identifier.getBaseSystemId ());
}
}
if (augs != null && fInternalSubset != null &&
!fInDTDExternalSubset &&
Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
fInternalSubset.append(name).append(";\n");
}
fBaseURIStack.push (identifier.getExpandedSystemId ());
}
示例9: unparsedEntityDecl
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
@Override
public void unparsedEntityDecl(
String name,
XMLResourceIdentifier identifier,
String notation,
Augmentations augmentations)
throws XNIException {
this.addUnparsedEntity(name, identifier, notation, augmentations);
if (fDTDHandler != null) {
fDTDHandler.unparsedEntityDecl(
name,
identifier,
notation,
augmentations);
}
}
示例10: unparsedEntityDecl
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
* An unparsed entity declaration.
*
* @param name The name of the entity.
* @param identifier An object containing all location information
* pertinent to this entity.
* @param notation The name of the notation.
*
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier,
String notation,
Augmentations augs) throws XNIException {
try {
// SAX2 extension
if (fDTDHandler != null) {
String publicId = identifier.getPublicId();
String systemId = fResolveDTDURIs ?
identifier.getExpandedSystemId() : identifier.getLiteralSystemId();
fDTDHandler.unparsedEntityDecl(name, publicId, systemId, notation);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
}
示例11: reset
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
* Reset all components before parsing.
*
* @throws XNIException Thrown if an error occurs during initialization.
*/
protected void reset() throws XNIException {
if (fValidationManager != null)
fValidationManager.reset();
// configure the pipeline and initialize the components
configurePipeline();
super.reset();
}
示例12: ignorableWhitespace
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
public void ignorableWhitespace(char[] ch, int start, int len) throws SAXException {
try {
handler().ignorableWhitespace(new XMLString(ch,start,len),aug());
} catch( XNIException e ) {
throw toSAXException(e);
}
}
示例13: endParameterEntity
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
@Override
public void endParameterEntity(String name, Augmentations augmentations)
throws XNIException {
if (fDTDHandler != null) {
fDTDHandler.endParameterEntity(name, augmentations);
}
}
示例14: convertToSAXException
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
static void convertToSAXException(XNIException e) throws SAXException {
Exception ex = e.getException();
if (ex == null) {
throw new SAXException(e.getMessage());
}
if (ex instanceof SAXException) {
throw (SAXException) ex;
}
throw new SAXException(ex);
}
示例15: endGroup
import com.sun.org.apache.xerces.internal.xni.XNIException; //导入依赖的package包/类
/**
* The end of a group for mixed or children content models.
*
* @param augs Additional information that may include infoset
* augmentations.
* @throws XNIException Thrown by handler to signal an error.
*/
public void endGroup(Augmentations augs) throws XNIException {
if (!fMixed) {
if (fPrevNodeIndexStack[fDepth] != -1) {
fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
}
int nodeIndex = fNodeIndexStack[fDepth--];
fNodeIndexStack[fDepth] = nodeIndex;
}
}