com.sun.org.apache.xerces.internal.util.XMLAttributesImpl Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.util.XMLAttributesImpl. 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 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}
 
Example #2
Source File: XMLStreamReaderImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}
 
Example #3
Source File: XMLStreamReaderImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}
 
Example #4
Source File: XMLStreamReaderImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}
 
Example #5
Source File: XMLStreamReaderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}
 
Example #6
Source File: XMLStreamReaderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}
 
Example #7
Source File: XMLStreamReaderImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if (fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName));
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName);
        }

    } else {
        throw new java.lang.IllegalStateException("Current state is not among the states "
                + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                + getEventTypeString(XMLEvent.ATTRIBUTE)
                + "valid for getAttributeValue()");
    }

}
 
Example #8
Source File: XMLStreamReaderImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if (fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName));
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName);
        }

    } else {
        throw new java.lang.IllegalStateException("Current state is not among the states "
                + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                + getEventTypeString(XMLEvent.ATTRIBUTE)
                + "valid for getAttributeValue()");
    }

}
 
Example #9
Source File: XMLStreamReaderImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}
 
Example #10
Source File: XMLStreamReaderImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}
 
Example #11
Source File: XMLStreamReaderImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param namespaceURI
 * @param localName
 * @return
 */
public String getAttributeValue(String namespaceURI, String localName) {
    //State should be either START_ELEMENT or ATTRIBUTE
    if( fEventType == XMLEvent.START_ELEMENT || fEventType == XMLEvent.ATTRIBUTE) {
        XMLAttributesImpl attributes = fScanner.getAttributeIterator();
        if (namespaceURI == null) { //sjsxp issue 70
            return attributes.getValue(attributes.getIndexByLocalName(localName)) ;
        } else {
            return fScanner.getAttributeIterator().getValue(
                    namespaceURI.length() == 0 ? null : namespaceURI, localName) ;
        }

    } else{
        throw new java.lang.IllegalStateException("Current state is not among the states "
                 + getEventTypeString(XMLEvent.START_ELEMENT) + " , "
                 + getEventTypeString(XMLEvent.ATTRIBUTE)
                 + "valid for getAttributeValue()") ;
    }

}