本文整理汇总了Java中com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier类的典型用法代码示例。如果您正苦于以下问题:Java XMLResourceIdentifier类的具体用法?Java XMLResourceIdentifier怎么用?Java XMLResourceIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XMLResourceIdentifier类属于com.sun.org.apache.xerces.internal.xni包,在下文中一共展示了XMLResourceIdentifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startParameterEntity
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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 ());
}
示例2: notationDecl
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
}
}
示例3: startGeneralEntity
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
}
}
示例4: startParameterEntity
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
}
}
示例5: externalEntityDecl
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
}
}
示例6: unparsedEntityDecl
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
}
}
示例7: notationDecl
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
}
}
示例8: startGeneralEntity
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的package包/类
@Override
public void startGeneralEntity(
String name,
XMLResourceIdentifier resId,
String encoding,
Augmentations augs)
throws XNIException {
if (getState() == STATE_NORMAL_PROCESSING) {
if (fResultDepth == 0) {
if (augs != null && Boolean.TRUE.equals(augs.getItem(Constants.ENTITY_SKIPPED))) {
reportFatalError("UnexpandedEntityReferenceIllegal");
}
}
else if (fDocumentHandler != null) {
fDocumentHandler.startGeneralEntity(name, resId, encoding, augs);
}
}
}
示例9: startEntity
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
//register current document scanner as a listener for XMLEntityScanner
fEntityScanner.registerListener(this);
// prepare to look for a TextDecl if external general entity
if (!name.equals("[xml]") && fEntityScanner.isExternal()) {
// Don't do this if we're skipping the entity!
if (augs == null || !((Boolean) augs.getItem(Constants.ENTITY_SKIPPED)).booleanValue()) {
setScannerState(SCANNER_STATE_TEXT_DECL);
}
}
// call handler
/** comment this part.. LOCATOR problem.. */
if (fDocumentHandler != null && name.equals("[xml]")) {
fDocumentHandler.startDocument(fEntityScanner, encoding, fNamespaceContext, null);
}
}
示例10: startGeneralEntity
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
}
}
示例11: unparsedEntityDecl
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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);
}
}
示例12: startParameterEntity
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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 (fPerformValidation && fDTDGrammar != null &&
fGrammarBucket.getStandalone()) {
checkStandaloneEntityRef(name, fDTDGrammar, fEntityDecl, fErrorReporter);
}
// call handlers
if(fDTDGrammar != null )
fDTDGrammar.startParameterEntity(name, identifier, encoding, augs);
if (fDTDHandler != null) {
fDTDHandler.startParameterEntity(name, identifier, encoding, augs);
}
}
示例13: externalEntityDecl
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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 external 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 {
DTDGrammar grammar = (fDTDGrammar != null? fDTDGrammar: fGrammarBucket.getActiveGrammar());
int index = grammar.getEntityDeclIndex(name) ;
//If the same entity is declared more than once, the first declaration
//encountered is binding, SAX requires only effective(first) declaration
//to be reported to the application
//REVISIT: Does it make sense to pass duplicate entity information across
//the pipeline -- nb?
//its a new entity and hasn't been declared.
if(index == -1){
//store external entity declaration in grammar
if(fDTDGrammar != null)
fDTDGrammar.externalEntityDecl(name, identifier, augs);
// call handlers
if (fDTDHandler != null) {
fDTDHandler.externalEntityDecl(name, identifier, augs);
}
}
}
示例14: unparsedEntityDecl
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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 {
// VC: Notation declared, in the production of NDataDecl
if (fValidation) {
fNDataDeclNotations.put(name, notation);
}
// call handlers
if(fDTDGrammar != null)
fDTDGrammar.unparsedEntityDecl(name, identifier, notation, augs);
if (fDTDHandler != null) {
fDTDHandler.unparsedEntityDecl(name, identifier, notation, augs);
}
}
示例15: externalEntityDecl
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; //导入依赖的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 external entity declaration.
* @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 {
int entityIndex = getEntityDeclIndex(name);
if( entityIndex == -1){
entityIndex = createEntityDecl();
boolean isPE = name.startsWith("%");
boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);
XMLEntityDecl entityDecl = new XMLEntityDecl();
entityDecl.setValues(name, identifier.getPublicId(), identifier.getLiteralSystemId(),
identifier.getBaseSystemId(),
null, null, isPE, inExternal);
setEntityDecl(entityIndex, entityDecl);
}
}