/** * @param i * @return Returns boolean. * @see javax.xml.stream.XMLStreamReader#isAttributeSpecified */ public boolean isAttributeSpecified(int i) { boolean returnValue = false; if (parser != null) { returnValue = parser.isAttributeSpecified(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { // theres nothing to be returned here } else { throw new IllegalStateException( "attribute type accessed in illegal event!"); } } return returnValue; }
/** * Method getNamespaceURI. * * @param s * @return Returns String. */ public String getNamespaceURI(String s) { String returnString = null; if (parser != null) { returnString = parser.getNamespaceURI(s); } else { if (isStartElement() || isEndElement() || (currentEvent == NAMESPACE)) { // Nothing to do here! How to get the namespacace references } } return returnString; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributeType */ public String getAttributeType(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributeType(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { // todo implement this } else { throw new IllegalStateException( "attribute type accessed in illegal event!"); } } return returnString; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributeValue */ public String getAttributeValue(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributeValue(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMAttribute attrib = getAttribute((OMElement) lastNode, i); if (attrib != null) { returnString = attrib.getAttributeValue(); } } else { throw new IllegalStateException( "attribute type accessed in illegal event!"); } } return returnString; }
/** * Method getAttributeValue. * * @param s * @param s1 * @return Returns String. */ public String getAttributeValue(String s, String s1) { String returnString = null; if (parser != null) { returnString = parser.getAttributeValue(s, s1); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { QName qname = new QName(s, s1); OMAttribute attrib = ((OMElement) lastNode).getAttribute(qname); if (attrib != null) { returnString = attrib.getAttributeValue(); } } else { throw new IllegalStateException( "attribute type accessed in illegal event!"); } } return returnString; }
/** * @return Returns int. * @see javax.xml.stream.XMLStreamReader#getAttributeCount */ public int getAttributeCount() { int returnCount = 0; if (parser != null) { returnCount = parser.getAttributeCount(); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMElement elt = (OMElement) lastNode; returnCount = getCount(elt.getAllAttributes()); } else { throw new IllegalStateException( "attribute count accessed in illegal event (" + currentEvent + ")!"); } } return returnCount; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributeNamespace */ public String getAttributeNamespace(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributeNamespace(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMAttribute attrib = getAttribute((OMElement) lastNode, i); if (attrib != null) { OMNamespace nameSpace = attrib.getNamespace(); if (nameSpace != null) { returnString = nameSpace.getNamespaceURI(); } } } else { throw new IllegalStateException( "attribute nameSpace accessed in illegal event!"); } } return returnString; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getNamespaceURI */ public String getNamespaceURI(int i) { String returnString = null; if (parser != null) { returnString = parser.getNamespaceURI(i); } else { if (isStartElement() || isEndElement() || (currentEvent == NAMESPACE)) { OMNamespace ns = (OMNamespace) getItemFromIterator( ((OMElement) lastNode).getAllDeclaredNamespaces(), i); returnString = (ns == null) ? null : ns.getNamespaceURI(); } } return returnString; }
/** * @param i * @return Returns QName. * @see javax.xml.stream.XMLStreamReader#getAttributeName */ public QName getAttributeName(int i) { QName returnQName = null; if (parser != null) { returnQName = parser.getAttributeName(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { returnQName = getAttribute((OMElement) lastNode, i).getQName(); } else { throw new IllegalStateException( "attribute count accessed in illegal event!"); } } return returnQName; }
/** * @return Returns int. * @see javax.xml.stream.XMLStreamReader#getNamespaceCount() */ public int getNamespaceCount() { int returnCount = 0; if (parser != null) { returnCount = parser.getNamespaceCount(); } else { if (isStartElement() || isEndElement() || (currentEvent == NAMESPACE)) { returnCount = getCount(((OMElement) lastNode) .getAllDeclaredNamespaces()); } } return returnCount; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributeLocalName */ public String getAttributeLocalName(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributeLocalName(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMAttribute attrib = getAttribute((OMElement) lastNode, i); if (attrib != null) { if (attrib.getNamespace() != null) { returnString = attrib.getLocalName(); } else { returnString = ((Attr) attrib).getNodeName(); } } } else { throw new IllegalStateException( "attribute localName accessed in illegal event!"); } } return returnString; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getNamespacePrefix */ public String getNamespacePrefix(int i) { String returnString = null; if (parser != null) { returnString = parser.getNamespacePrefix(i); } else { if (isStartElement() || isEndElement() || (currentEvent == NAMESPACE)) { OMNamespace ns = (OMNamespace) getItemFromIterator( ((OMElement) lastNode).getAllDeclaredNamespaces(), i); returnString = (ns == null) ? null : ns.getPrefix(); } } return returnString; }
/** * @param i * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getAttributePrefix */ public String getAttributePrefix(int i) { String returnString = null; if (parser != null) { returnString = parser.getAttributePrefix(i); } else { if (isStartElement() || (currentEvent == ATTRIBUTE)) { OMAttribute attrib = getAttribute((OMElement) lastNode, i); if (attrib != null) { OMNamespace nameSpace = attrib.getNamespace(); if (nameSpace != null) { returnString = nameSpace.getPrefix(); } } } else { throw new IllegalStateException( "attribute prefix accessed in illegal event!"); } } return returnString; }