com.sun.xml.internal.stream.XMLEntityStorage Java Examples

The following examples show how to use com.sun.xml.internal.stream.XMLEntityStorage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XMLStreamReaderImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return true if the current event has text, false otherwise The following
 * events have text: CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if (DEBUG) {
        pr("XMLReaderImpl#EVENT TYPE = " + fEventType);
    }
    if (fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT
            || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0;
    } else if (fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if (name != null) {
            if (fScanner.foundBuiltInRefs) {
                return true;
            }

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if (en == null) {
                return false;
            }
            if (en.isExternal()) {
                return ((Entity.ExternalEntity) en).entityLocation.getExpandedSystemId() != null;
            } else {
                return ((Entity.InternalEntity) en).text != null;
            }
        } else {
            return false;
        }
    } else if (fEventType == XMLEvent.DTD) {
        return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #2
Source File: XMLStreamReaderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null;
            } else{
                return ((Entity.InternalEntity)en).text != null ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #3
Source File: XMLEntityManager.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If this constructor is used to create the object, reset() should be invoked on this object
 */
public XMLEntityManager() {
    //for entity managers not created by parsers
    fSecurityManager = new XMLSecurityManager(true);
    fEntityStorage = new XMLEntityStorage(this) ;
    setScannerVersion(Constants.XML_VERSION_1_0);
}
 
Example #4
Source File: XMLEntityManager.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #5
Source File: XMLStreamReaderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null;
            } else{
                return ((Entity.InternalEntity)en).text != null ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #6
Source File: XMLEntityManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If this constructor is used to create the object, reset() should be invoked on this object
 */
public XMLEntityManager() {
    //for entity managers not created by parsers
    fSecurityManager = new XMLSecurityManager(true);
    fEntityStorage = new XMLEntityStorage(this) ;
    setScannerVersion(Constants.XML_VERSION_1_0);
}
 
Example #7
Source File: XMLEntityManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #8
Source File: XMLStreamReaderImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Return true if the current event has text, false otherwise The following
 * events have text: CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if (DEBUG) {
        pr("XMLReaderImpl#EVENT TYPE = " + fEventType);
    }
    if (fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT
            || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0;
    } else if (fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if (name != null) {
            if (fScanner.foundBuiltInRefs) {
                return true;
            }

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if (en == null) {
                return false;
            }
            if (en.isExternal()) {
                return ((Entity.ExternalEntity) en).entityLocation.getExpandedSystemId() != null;
            } else {
                return ((Entity.InternalEntity) en).text != null;
            }
        } else {
            return false;
        }
    } else if (fEventType == XMLEvent.DTD) {
        return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #9
Source File: XMLEntityManager.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * If this constructor is used to create the object, reset() should be invoked on this object
 */
public XMLEntityManager() {
    //for entity managers not created by parsers
    fSecurityManager = new XMLSecurityManager(true);
    fEntityStorage = new XMLEntityStorage(this) ;
    setScannerVersion(Constants.XML_VERSION_1_0);
}
 
Example #10
Source File: XMLEntityManager.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #11
Source File: XMLStreamReaderImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null;
            } else{
                return ((Entity.InternalEntity)en).text != null ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #12
Source File: XMLEntityManager.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If this constructor is used to create the object, reset() should be invoked on this object
 */
public XMLEntityManager() {
    //for entity managers not created by parsers
    fSecurityManager = new XMLSecurityManager(true);
    fEntityStorage = new XMLEntityStorage(this) ;
    setScannerVersion(Constants.XML_VERSION_1_0);
}
 
Example #13
Source File: XMLEntityManager.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #14
Source File: XMLStreamReaderImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null;
            } else{
                return ((Entity.InternalEntity)en).text != null ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #15
Source File: XMLEntityManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If this constructor is used to create the object, reset() should be invoked on this object
 */
public XMLEntityManager() {
    //for entity managers not created by parsers
    fSecurityManager = new XMLSecurityManager(true);
    fEntityStorage = new XMLEntityStorage(this) ;
    setScannerVersion(Constants.XML_VERSION_1_0);
}
 
Example #16
Source File: XMLEntityManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #17
Source File: XMLStreamReaderImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0 ? true : false;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null ? true : false;
            } else{
                return ((Entity.InternalEntity)en).text != null ? true : false ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #18
Source File: XMLEntityManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #19
Source File: XMLStreamReaderImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0 ? true : false;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null ? true : false;
            } else{
                return ((Entity.InternalEntity)en).text != null ? true : false ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #20
Source File: XMLEntityManager.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #21
Source File: XMLEntityManager.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #22
Source File: XMLEntityManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If this constructor is used to create the object, reset() should be invoked on this object
 */
public XMLEntityManager() {
    //for entity managers not created by parsers
    fSecurityManager = new XMLSecurityManager(true);
    fEntityStorage = new XMLEntityStorage(this) ;
    setScannerVersion(Constants.XML_VERSION_1_0);
}
 
Example #23
Source File: XMLStreamReaderImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null;
            } else{
                return ((Entity.InternalEntity)en).text != null ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #24
Source File: XMLEntityManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #25
Source File: XMLStreamReaderImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0 ? true : false;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null ? true : false;
            } else{
                return ((Entity.InternalEntity)en).text != null ? true : false ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #26
Source File: XMLEntityManager.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}
 
Example #27
Source File: XMLEntityManager.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * If this constructor is used to create the object, reset() should be invoked on this object
 */
public XMLEntityManager() {
    //for entity managers not created by parsers
    fSecurityManager = new XMLSecurityManager(true);
    fEntityStorage = new XMLEntityStorage(this) ;
    setScannerVersion(Constants.XML_VERSION_1_0);
}
 
Example #28
Source File: XMLStreamReaderImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Return true if the current event has text, false otherwise
 * The following events have text:
 * CHARACTERS,DTD ,ENTITY_REFERENCE, COMMENT
 */
public boolean hasText() {
    if(DEBUG) pr("XMLReaderImpl#EVENT TYPE = " + fEventType ) ;
    if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA) {
        return fScanner.getCharacterData().length > 0;
    } else if(fEventType == XMLEvent.ENTITY_REFERENCE) {
        String name = fScanner.getEntityName();
        if(name != null){
            if(fScanner.foundBuiltInRefs)
                return true;

            XMLEntityStorage entityStore = fEntityManager.getEntityStore();
            Entity en = entityStore.getEntity(name);
            if(en == null)
                return false;
            if(en.isExternal()){
                return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId() != null;
            } else{
                return ((Entity.InternalEntity)en).text != null ;
            }
        }else
            return false;
    } else {
        if(fEventType == XMLEvent.DTD)
            return fScanner.fSeenDoctypeDecl;
    }
    return false;
}
 
Example #29
Source File: XMLEntityManager.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * If this constructor is used to create the object, reset() should be invoked on this object
 */
public XMLEntityManager() {
    //for entity managers not created by parsers
    fSecurityManager = new XMLSecurityManager(true);
    fEntityStorage = new XMLEntityStorage(this) ;
    setScannerVersion(Constants.XML_VERSION_1_0);
}
 
Example #30
Source File: XMLEntityManager.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Default constructor. */
public XMLEntityManager(PropertyManager propertyManager) {
    fPropertyManager = propertyManager ;
    //pass a reference to current entity being scanned
    //fEntityStorage = new XMLEntityStorage(fCurrentEntity) ;
    fEntityStorage = new XMLEntityStorage(this) ;
    fEntityScanner = new XMLEntityScanner(propertyManager, this) ;
    reset(propertyManager);
}