📄 xmlpullreaderfactory.java
字号:
/* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#buildPositionString() */ public String buildPositionString() { String base = "(line " + m_parser.getLineNumber() + ", col " + m_parser.getColumnNumber(); if (m_docName != null) { base += ", in " + m_docName; } return base + ')'; } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#nextToken() */ public int nextToken() throws JiBXException { try { return m_parser.nextToken(); } catch (IOException e) { throw new JiBXException("Error accessing document", e); } catch (XmlPullParserException e) { throw new JiBXException ("Error parsing document " + buildPositionString(), e); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#next() */ public int next() throws JiBXException { try { return m_parser.next(); } catch (IOException e) { throw new JiBXException("Error accessing document", e); } catch (XmlPullParserException e) { throw new JiBXException ("Error parsing document " + buildPositionString(), e); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getEventType() */ public int getEventType() throws JiBXException { try { return m_parser.getEventType(); } catch (XmlPullParserException e) { throw new JiBXException ("Error parsing document " + buildPositionString(), e); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getName() */ public String getName() { String name = m_parser.getName(); if (name == null) { throw new IllegalStateException ("Internal state error: not at start or end tag"); } else { return name; } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getNamespace() */ public String getNamespace() { String uri = m_parser.getNamespace(); if (uri == null) { throw new IllegalStateException ("Internal state error: not at start or end tag"); } else { return uri; } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getPrefix() */ public String getPrefix() { return m_parser.getPrefix(); } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getAttributeCount() */ public int getAttributeCount() { int count = m_parser.getAttributeCount(); if (count < 0) { throw new IllegalStateException ("Internal state error: not at start tag"); } else { return count; } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getAttributeName(int) */ public String getAttributeName(int index) { try { return m_parser.getAttributeName(index); } catch (ArrayIndexOutOfBoundsException e) { throw new IllegalStateException(describeException(e)); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getAttributeNamespace(int) */ public String getAttributeNamespace(int index) { try { return m_parser.getAttributeNamespace(index); } catch (ArrayIndexOutOfBoundsException e) { throw new IllegalStateException(describeException(e)); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getAttributePrefix(int) */ public String getAttributePrefix(int index) { try { return m_parser.getAttributePrefix(index); } catch (ArrayIndexOutOfBoundsException e) { throw new IllegalStateException(describeException(e)); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getAttributeValue(int) */ public String getAttributeValue(int index) { try { return m_parser.getAttributeValue(index); } catch (ArrayIndexOutOfBoundsException e) { throw new IllegalStateException(describeException(e)); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getAttributeValue(java.lang.String, java.lang.String) */ public String getAttributeValue(String ns, String name) { try { return m_parser.getAttributeValue(ns, name); } catch (ArrayIndexOutOfBoundsException e) { throw new IllegalStateException(describeException(e)); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getText() */ public String getText() { return m_parser.getText(); } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getNestingDepth() */ public int getNestingDepth() { return m_parser.getDepth(); } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getNamespaceCount(int) */ public int getNamespaceCount(int depth) { try { return m_parser.getNamespaceCount(depth); } catch (XmlPullParserException e) { throw new IllegalArgumentException(describeException(e)); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getNamespaceUri(int) */ public String getNamespaceUri(int index) { try { return m_parser.getNamespaceUri(index); } catch (XmlPullParserException e) { throw new IllegalArgumentException(describeException(e)); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getNamespacePrefix(int) */ public String getNamespacePrefix(int index) { try { return m_parser.getNamespacePrefix(index); } catch (XmlPullParserException e) { throw new IllegalArgumentException(describeException(e)); } } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getDocumentName() */ public String getDocumentName() { return m_docName; } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getLineNumber() */ public int getLineNumber() { return m_parser.getLineNumber(); } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getColumnNumber() */ public int getColumnNumber() { return m_parser.getColumnNumber(); } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getNamespace(java.lang.String) */ public String getNamespace(String prefix) { return m_parser.getNamespace(prefix); } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#getInputEncoding() */ public String getInputEncoding() { return m_encoding; } /* (non-Javadoc) * @see org.jibx.runtime.IXMLReader#isNamespaceAware() */ public boolean isNamespaceAware() { return m_parser.getFeature (XmlPullParser.FEATURE_PROCESS_NAMESPACES); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -