本文整理汇总了Java中org.apache.xerces.xni.Augmentations类的典型用法代码示例。如果您正苦于以下问题:Java Augmentations类的具体用法?Java Augmentations怎么用?Java Augmentations使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Augmentations类属于org.apache.xerces.xni包,在下文中一共展示了Augmentations类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doctypeDecl
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/** Doctype declaration. */
public void doctypeDecl(String rootElementName, String publicId, String systemId,
Augmentations augs) throws XNIException {
fSeenAnything = true;
if (fReportErrors) {
if (fSeenRootElement) {
fErrorReporter.reportError("HTML2010", null);
}
else if (fSeenDoctype) {
fErrorReporter.reportError("HTML2011", null);
}
}
if (!fSeenRootElement && !fSeenDoctype) {
fSeenDoctype = true;
if (fDocumentHandler != null) {
fDocumentHandler.doctypeDecl(rootElementName, publicId, systemId, augs);
}
}
}
示例2: textDecl
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/** Text declaration. */
public void textDecl(String version, String encoding, Augmentations augs)
throws XNIException {
fSeenAnything = true;
// check for end of document
if (fSeenRootElementEnd) {
return;
}
// call handler
if (fDocumentHandler != null) {
fDocumentHandler.textDecl(version, encoding, augs);
}
}
示例3: startCDATA
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/** Start CDATA section. */
public void startCDATA(Augmentations augs) throws XNIException {
fSeenAnything = true;
consumeEarlyTextIfNeeded();
// check for end of document
if (fSeenRootElementEnd) {
return;
}
// call handler
if (fDocumentHandler != null) {
fDocumentHandler.startCDATA(augs);
}
}
示例4: doctypeDecl
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/**
* Notifies of the presence of the DOCTYPE line in the document.
*
* @param rootElement The name of the root element.
* @param publicId The public identifier if an external DTD or null
* if the external DTD is specified using SYSTEM.
* @param systemId The system identifier if an external DTD, null
* otherwise.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void doctypeDecl(String rootElement,
String publicId, String systemId, Augmentations augs)
throws XNIException {
fInDTD = true;
try {
// SAX2 extension
if (fLexicalHandler != null) {
fLexicalHandler.startDTD(rootElement, publicId, systemId);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
// is there a DeclHandler?
if(fDeclHandler != null) {
fDeclaredAttrs = new SymbolHash();
}
}
示例5: startGeneralEntity
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/**
* This method notifies of the start of an entity. The DTD has the
* pseudo-name of "[dtd]" parameter entity names start with '%'; and
* general entity names are just the entity name.
* <p>
* <strong>Note:</strong> Since the document is an entity, the handler
* will be notified of the start of the document entity by calling the
* startEntity method with the entity name "[xml]" <em>before</em> calling
* the startDocument method. When exposing entity boundaries through the
* SAX API, the document entity is never reported, however.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
* @param name The name of the 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 startGeneralEntity(String name, XMLResourceIdentifier identifier,
String encoding, Augmentations augs)
throws XNIException {
try {
// Only report startEntity if this entity was actually read.
if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
// report skipped entity to content handler
if (fContentHandler != null) {
fContentHandler.skippedEntity(name);
}
}
else {
// SAX2 extension
if (fLexicalHandler != null) {
fLexicalHandler.startEntity(name);
}
}
}
catch (SAXException e) {
throw new XNIException(e);
}
}
示例6: ignorableWhitespace
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/**
* Ignorable whitespace. For this method to be called, the document
* source must have some way of determining that the text containing
* only whitespace characters should be considered ignorable. For
* example, the validator can determine if a length of whitespace
* characters in the document are ignorable based on the element
* content model.
*
* @param text The ignorable whitespace.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
try {
// SAX1
if (fDocumentHandler != null) {
fDocumentHandler.ignorableWhitespace(text.ch, text.offset, text.length);
}
// SAX2
if (fContentHandler != null) {
fContentHandler.ignorableWhitespace(text.ch, text.offset, text.length);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
}
示例7: endDocument
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/**
* The end of the document.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void endDocument(Augmentations augs) throws XNIException {
try {
// SAX1
if (fDocumentHandler != null) {
fDocumentHandler.endDocument();
}
// SAX2
if (fContentHandler != null) {
fContentHandler.endDocument();
}
}
catch (SAXException e) {
throw new XNIException(e);
}
}
示例8: startParameterEntity
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/**
* This method notifies of the start of parameter entity. The DTD has the
* pseudo-name of "[dtd]" parameter entity names start with '%'; and
* general entity names are just the entity name.
* <p>
* <strong>Note:</strong> Since the document is an entity, the handler
* will be notified of the start of the document entity by calling the
* startEntity method with the entity name "[xml]" <em>before</em> calling
* the startDocument method. When exposing entity boundaries through the
* SAX API, the document entity is never reported, however.
* <p>
* <strong>Note:</strong> This method is not called for entity references
* appearing as part of attribute values.
*
* @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 {
try {
// Only report startEntity if this entity was actually read.
if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
// report skipped entity to content handler
if (fContentHandler != null) {
fContentHandler.skippedEntity(name);
}
}
else {
// SAX2 extension
if (fLexicalHandler != null && fLexicalHandlerParameterEntities) {
fLexicalHandler.startEntity(name);
}
}
}
catch (SAXException e) {
throw new XNIException(e);
}
}
示例9: externalEntityDecl
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/**
* An external entity declaration.
*
* @param name The name of the entity. Parameter entity names start
* with '%', whereas the name of a general entity is just
* the entity name.
* @param identifier An object containing all location information
* pertinent to this entity.
* @param augs Additional information that may include infoset
* augmentations.
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void externalEntityDecl(String name, XMLResourceIdentifier identifier,
Augmentations augs) throws XNIException {
try {
// SAX2 extension
if (fDeclHandler != null) {
String publicId = identifier.getPublicId();
String systemId = fResolveDTDURIs ?
identifier.getExpandedSystemId() : identifier.getLiteralSystemId();
fDeclHandler.externalEntityDecl(name, publicId, systemId);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
}
示例10: unparsedEntityDecl
import org.apache.xerces.xni.Augmentations; //导入依赖的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: notationDecl
import org.apache.xerces.xni.Augmentations; //导入依赖的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 {
try {
// SAX1 and SAX2
if (fDTDHandler != null) {
String publicId = identifier.getPublicId();
String systemId = fResolveDTDURIs ?
identifier.getExpandedSystemId() : identifier.getLiteralSystemId();
fDTDHandler.notationDecl(name, publicId, systemId);
}
}
catch (SAXException e) {
throw new XNIException(e);
}
}
示例12: endDTD
import org.apache.xerces.xni.Augmentations; //导入依赖的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 {
fInDTD = false;
try {
// SAX2 extension
if (fLexicalHandler != null) {
fLexicalHandler.endDTD();
}
}
catch (SAXException e) {
throw new XNIException(e);
}
if(fDeclaredAttrs != null) {
// help out the GC
fDeclaredAttrs.clear();
}
}
示例13: startEntity
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/**
* This method notifies of the start of an entity. The DTD has the
* pseudo-name of "[dtd]" parameter entity names start with '%'; and
* general entities are just specified by their name.
*
* @param name The name of the 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).
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void startEntity(String name,
XMLResourceIdentifier identifier,
String encoding, Augmentations augs) throws XNIException {
super.startEntity(name, identifier, encoding, augs);
// prepare to look for a TextDecl if external general entity
if (!name.equals("[xml]") && fEntityScanner.isExternal()) {
setScannerState(SCANNER_STATE_TEXT_DECL);
}
// call handler
if (fDocumentHandler != null && name.equals("[xml]")) {
fDocumentHandler.startDocument(fEntityScanner, encoding, fNamespaceContext, null);
}
}
示例14: endEntity
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/**
* This method notifies the end of an entity. The DTD has the pseudo-name
* of "[dtd]" parameter entity names start with '%'; and general entities
* are just specified by their name.
*
* @param name The name of the entity.
* @param augs Additional information that may include infoset augmentations
*
* @throws XNIException Thrown by handler to signal an error.
*/
public void endEntity(String name, Augmentations augs) throws XNIException {
// flush possible pending output buffer - see scanContent
if (fInScanContent && fStringBuffer.length != 0
&& fDocumentHandler != null) {
fDocumentHandler.characters(fStringBuffer, null);
fStringBuffer.length = 0; // make sure we know it's been flushed
}
super.endEntity(name, augs);
// make sure markup is properly balanced
if (fMarkupDepth != fEntityStack[fEntityDepth]) {
reportFatalError("MarkupEntityMismatch", null);
}
// call handler
if (fDocumentHandler != null && !fScanningAttribute) {
if (!name.equals("[xml]")) {
fDocumentHandler.endGeneralEntity(name, augs);
}
}
}
示例15: xmlDecl
import org.apache.xerces.xni.Augmentations; //导入依赖的package包/类
/** XML Declaration. */
public void xmlDecl(String version, String encoding,
String standalone, Augmentations augs) throws XNIException {
printIndent();
fOut.print("xmlDecl(");
fOut.print("version=");
printQuotedString(version);
fOut.print(',');
fOut.print("encoding=");
printQuotedString(encoding);
fOut.print(',');
fOut.print("standalone=");
printQuotedString(standalone);
if (augs != null) {
fOut.print(',');
printAugmentations(augs);
}
fOut.println(')');
}