1 package javolution.xml.pull; 2 3 import j2me.lang.CharSequence; 4 import java.io.IOException; 5 import java.io.InputStream; 6 import java.io.Reader; 7 8 135 public interface XmlPullParser { 136 137 138 String NO_NAMESPACE = ""; 139 140 143 152 int START_DOCUMENT = 0; 153 154 165 int END_DOCUMENT = 1; 166 167 188 int START_TAG = 2; 189 190 204 int END_TAG = 3; 205 206 225 int TEXT = 4; 226 227 230 240 int CDSECT = 5; 241 242 255 int ENTITY_REF = 6; 256 257 277 int IGNORABLE_WHITESPACE = 7; 278 279 287 int PROCESSING_INSTRUCTION = 8; 288 289 299 int COMMENT = 9; 300 301 310 int DOCDECL = 10; 311 312 323 String[] TYPES = { "START_DOCUMENT", "END_DOCUMENT", "START_TAG", 324 "END_TAG", "TEXT", "CDSECT", "ENTITY_REF", "IGNORABLE_WHITESPACE", 325 "PROCESSING_INSTRUCTION", "COMMENT", "DOCDECL" }; 326 327 330 339 String FEATURE_PROCESS_NAMESPACES = "http://xmlpull.org/v1/doc/features.html#process-namespaces"; 340 341 350 String FEATURE_REPORT_NAMESPACE_ATTRIBUTES = "http://xmlpull.org/v1/doc/features.html#report-namespace-prefixes"; 351 352 370 String FEATURE_PROCESS_DOCDECL = "http://xmlpull.org/v1/doc/features.html#process-docdecl"; 371 372 383 String FEATURE_VALIDATION = "http://xmlpull.org/v1/doc/features.html#validation"; 384 385 398 void setFeature(String name, boolean state) throws XmlPullParserException; 399 400 409 410 boolean getFeature(String name); 411 412 420 void setProperty(String name, Object value) throws XmlPullParserException; 421 422 432 Object getProperty(String name); 433 434 443 void setInput(Reader in) throws XmlPullParserException; 444 445 464 void setInput(InputStream inputStream, String inputEncoding) 465 throws XmlPullParserException; 466 467 479 String getInputEncoding(); 480 481 512 void defineEntityReplacementText(CharSequence entityName, CharSequence replacementText) 513 throws XmlPullParserException; 514 515 538 int getNamespaceCount(int depth) throws XmlPullParserException; 539 540 550 CharSequence getNamespacePrefix(int pos) throws XmlPullParserException; 551 552 559 CharSequence getNamespaceUri(int pos) throws XmlPullParserException; 560 561 593 CharSequence getNamespace(CharSequence prefix); 594 595 598 615 int getDepth(); 616 617 624 CharSequence getPositionDescription(); 625 626 633 int getLineNumber(); 634 635 642 int getColumnNumber(); 643 644 647 662 boolean isWhitespace() throws XmlPullParserException; 663 664 682 CharSequence getText(); 683 684 709 char[] getTextCharacters(int[] holderForStartAndLength); 710 711 714 722 CharSequence getNamespace(); 723 724 736 CharSequence getName(); 737 738 745 CharSequence getPrefix(); 746 747 754 boolean isEmptyElementTag() throws XmlPullParserException; 755 756 759 768 int getAttributeCount(); 769 770 793 CharSequence getAttributeNamespace(int index); 794 795 804 CharSequence getAttributeName(int index); 805 806 816 CharSequence getAttributePrefix(int index); 817 818 825 String getAttributeType(int index); 826 827 835 boolean isAttributeDefault(int index); 836 837 852 CharSequence getAttributeValue(int index); 853 854 870 CharSequence getAttributeValue(CharSequence namespace, CharSequence name); 871 872 875 881 int getEventType() throws XmlPullParserException; 882 883 901 902 int next() throws XmlPullParserException, IOException; 903 904 992 int nextToken() throws XmlPullParserException, IOException; 993 994 997 1013 void require(int type, CharSequence namespace, CharSequence name) 1014 throws XmlPullParserException, IOException; 1015 1016 1059 CharSequence nextText() throws XmlPullParserException, IOException; 1060 1061 1078 int nextTag() throws XmlPullParserException, IOException; 1079 1080} 1081 | Popular Tags |