Java Code Examples for com.sun.org.apache.xerces.internal.util.XMLStringBuffer#toString()
The following examples show how to use
com.sun.org.apache.xerces.internal.util.XMLStringBuffer#toString() .
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 jdk1.8-source-analysis with Apache License 2.0 | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }
Example 2
Source File: XMLStreamReaderImpl.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }
Example 3
Source File: XMLStreamReaderImpl.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }
Example 4
Source File: XMLStreamReaderImpl.java From JDKSourceCode1.8 with MIT License | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }
Example 5
Source File: XMLStreamReaderImpl.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }
Example 6
Source File: XMLStreamReaderImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }
Example 7
Source File: XMLStreamReaderImpl.java From Bytecoder with Apache License 2.0 | 4 votes |
/** * Returns the current value of the parse event as a string, this returns * the string value of a CHARACTERS event, returns the value of a COMMENT, * the replacement value for an ENTITY_REFERENCE, or the String value of the * DTD * * @return the current text or null * @throws java.lang.IllegalStateException if this state is not a valid text * state. */ public String getText() { if (fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE) { //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString(); } else if (fEventType == XMLEvent.ENTITY_REFERENCE) { String name = fScanner.getEntityName(); if (name != null) { if (fScanner.foundBuiltInRefs) { return fScanner.getCharacterData().toString(); } XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if (en == null) { return null; } if (en.isExternal()) { return ((Entity.ExternalEntity) en).entityLocation.getExpandedSystemId(); } else { return ((Entity.InternalEntity) en).text; } } else { return null; } } else if (fEventType == XMLEvent.DTD) { if (fDTDDecl != null) { return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else { throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() "); } }
Example 8
Source File: XMLStreamReaderImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Returns the current value of the parse event as a string, this returns * the string value of a CHARACTERS event, returns the value of a COMMENT, * the replacement value for an ENTITY_REFERENCE, or the String value of the * DTD * * @return the current text or null * @throws java.lang.IllegalStateException if this state is not a valid text * state. */ public String getText() { if (fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE) { //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString(); } else if (fEventType == XMLEvent.ENTITY_REFERENCE) { String name = fScanner.getEntityName(); if (name != null) { if (fScanner.foundBuiltInRefs) { return fScanner.getCharacterData().toString(); } XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if (en == null) { return null; } if (en.isExternal()) { return ((Entity.ExternalEntity) en).entityLocation.getExpandedSystemId(); } else { return ((Entity.InternalEntity) en).text; } } else { return null; } } else if (fEventType == XMLEvent.DTD) { if (fDTDDecl != null) { return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else { throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() "); } }
Example 9
Source File: XMLStreamReaderImpl.java From hottub with GNU General Public License v2.0 | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }
Example 10
Source File: XMLStreamReaderImpl.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }
Example 11
Source File: XMLStreamReaderImpl.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** Returns the current value of the parse event as a string, * this returns the string value of a CHARACTERS event, * returns the value of a COMMENT, the replacement value * for an ENTITY_REFERENCE, * or the String value of the DTD * @return the current text or null * @throws java.lang.IllegalStateException if this state is not * a valid text state. */ public String getText() { if( fEventType == XMLEvent.CHARACTERS || fEventType == XMLEvent.COMMENT || fEventType == XMLEvent.CDATA || fEventType == XMLEvent.SPACE){ //this requires creation of new string //fEventType == XMLEvent.ENTITY_REFERENCE return fScanner.getCharacterData().toString() ; } else if(fEventType == XMLEvent.ENTITY_REFERENCE){ String name = fScanner.getEntityName(); if(name != null){ if(fScanner.foundBuiltInRefs) return fScanner.getCharacterData().toString(); XMLEntityStorage entityStore = fEntityManager.getEntityStore(); Entity en = entityStore.getEntity(name); if(en == null) return null; if(en.isExternal()) return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId(); else return ((Entity.InternalEntity)en).text; }else return null; } else if(fEventType == XMLEvent.DTD){ if(fDTDDecl != null){ return fDTDDecl; } XMLStringBuffer tmpBuffer = fScanner.getDTDDecl(); fDTDDecl = tmpBuffer.toString(); return fDTDDecl; } else{ throw new IllegalStateException("Current state " + getEventTypeString(fEventType) + " is not among the states" + getEventTypeString(XMLEvent.CHARACTERS) + ", " + getEventTypeString(XMLEvent.COMMENT) + ", " + getEventTypeString(XMLEvent.CDATA) + ", " + getEventTypeString(XMLEvent.SPACE) + ", " + getEventTypeString(XMLEvent.ENTITY_REFERENCE) + ", " + getEventTypeString(XMLEvent.DTD) + " valid for getText() " ) ; } }