1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Sat Jan 02 02:58:02 GMT 1999 -->
<title>
Class com.jclark.xml.tok.Encoding
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-com.jclark.xml.tok.html">This Package</a> <a href="com.jclark.xml.tok.ContentToken.html#_top_">Previous</a> <a href="com.jclark.xml.tok.Position.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
Class com.jclark.xml.tok.Encoding
</h1>
<pre>
java.lang.Object
|
+----com.jclark.xml.tok.Encoding
</pre>
<hr>
<dl>
<dt> public abstract class <b>Encoding</b>
<dt> extends Object
</dl>
An <code>Encoding</code> object corresponds to a possible
encoding (a mapping from characters to sequences of bytes).
It provides operations on byte arrays
that represent all or part of a parsed XML entity in that encoding.
<p>
The set of ASCII characters excluding <code>$@\^`{}~</code>
have a special status; these are called <i>XML significant</i>
characters.
<p>
This class imposes certain restrictions on an encoding:
<ul>
<li>the encoding must be stateless;
<li>a single byte must not encode more than one character;
<li>all XML significant characters must be encoded by the same number
of bytes, and no character may be encoded by fewer bytes.
</ul>
<p>
Several methods operate on byte subarrays. The subarray is specified
by a byte array <code>buf</code> and two integers,
<code>off</code> and <code>end</code>; <code>off</code>
gives the index in <code>buf</code> of the first byte of the subarray
and <code>end</code> gives the
index in <code>buf</code> of the byte immediately after the last byte.
<p>
Use the <code>getInitialEncoding</code> method to get an
<code>Encoding</code> object to use to start parsing an entity.
<p>
The main operations provided by <code>Encoding</code> are
<code>tokenizeProlog</code>, <code>tokenizeContent</code> and
<code>tokenizeCdataSection</code>;
these are used to divide up an XML entity into tokens.
<code>tokenizeProlog</code> is used for the prolog of an XML document
as well as for the external subset and parameter entities (except
when referenced in an <code>EntityValue</code>);
it can also be used for parsing the <code>Misc</code>* that follows
the document element.
<code>tokenizeContent</code> is used for the document element and for
parsed general entities that are referenced in <code>content</code>
except for CDATA sections.
<code>tokenizeCdataSection</code> is used for CDATA sections, following
the <code><![CDATA[</code> up to and including the <code>]]></code>.
<p>
<code>tokenizeAttributeValue</code> and <code>tokenizeEntityValue</code>
are used to further divide up tokens returned by <code>tokenizeProlog</code>
and <code>tokenizeContent</code>; they are also used to divide up entities
referenced in attribute values or entity values.
<p>
<hr>
<a name="index"></a>
<h2>
<img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_ATTRIBUTE_VALUE_S"><b>TOK_ATTRIBUTE_VALUE_S</b></a>
<dd> Represents a white space character in an attribute value,
excluding white space characters that are part of line boundaries.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CDATA_SECT_CLOSE"><b>TOK_CDATA_SECT_CLOSE</b></a>
<dd> Represents the end of a CDATA section <code>]]></code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CDATA_SECT_OPEN"><b>TOK_CDATA_SECT_OPEN</b></a>
<dd> Represents the start of a CDATA section <code><![CDATA[</code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CHAR_PAIR_REF"><b>TOK_CHAR_PAIR_REF</b></a>
<dd> Represents a numeric character reference (decimal or hexadecimal),
when the referenced character is greater than 0xFFFF and so is
represented by a pair of chars.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CHAR_REF"><b>TOK_CHAR_REF</b></a>
<dd> Represents a numeric character reference (decimal or hexadecimal),
when the referenced character is less than or equal to 0xFFFF
and so is represented by a single char.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CLOSE_BRACKET"><b>TOK_CLOSE_BRACKET</b></a>
<dd> Represents <code>]</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CLOSE_PAREN"><b>TOK_CLOSE_PAREN</b></a>
<dd> Represents a <code>)</code> in the prolog that is not
followed immediately by any of
<code>*</code>, <code>+</code> or <code>?</code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CLOSE_PAREN_ASTERISK"><b>TOK_CLOSE_PAREN_ASTERISK</b></a>
<dd> Represents <code>)*</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CLOSE_PAREN_PLUS"><b>TOK_CLOSE_PAREN_PLUS</b></a>
<dd> Represents <code>)+</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_CLOSE_PAREN_QUESTION"><b>TOK_CLOSE_PAREN_QUESTION</b></a>
<dd> Represents <code>)?</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_COMMA"><b>TOK_COMMA</b></a>
<dd> Represents <code>,</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_COMMENT"><b>TOK_COMMENT</b></a>
<dd> Represents a comment <code><!-- comment --></code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_COND_SECT_CLOSE"><b>TOK_COND_SECT_CLOSE</b></a>
<dd> Represents <code>]]></code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_COND_SECT_OPEN"><b>TOK_COND_SECT_OPEN</b></a>
<dd> Represents <code><![</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_DATA_CHARS"><b>TOK_DATA_CHARS</b></a>
<dd> Represents one or more characters of data.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_DATA_NEWLINE"><b>TOK_DATA_NEWLINE</b></a>
<dd> Represents a newline (CR, LF or CR followed by LF) in data.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_DECL_CLOSE"><b>TOK_DECL_CLOSE</b></a>
<dd> Represents <code>></code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_DECL_OPEN"><b>TOK_DECL_OPEN</b></a>
<dd> Represents <code><!NAME</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_EMPTY_ELEMENT_NO_ATTS"><b>TOK_EMPTY_ELEMENT_NO_ATTS</b></a>
<dd> Represents an empty element tag <code><name/></code>,
that doesn't have any attribute specifications.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_EMPTY_ELEMENT_WITH_ATTS"><b>TOK_EMPTY_ELEMENT_WITH_ATTS</b></a>
<dd> Represents an empty element tag <code><name att="val"/></code>,
that contains one or more attribute specifications.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_END_TAG"><b>TOK_END_TAG</b></a>
<dd> Represents a complete end-tag <code></name></code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_ENTITY_REF"><b>TOK_ENTITY_REF</b></a>
<dd> Represents a general entity reference.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_LITERAL"><b>TOK_LITERAL</b></a>
<dd> Represents a literal (EntityValue, AttValue, SystemLiteral or
PubidLiteral).
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_MAGIC_ENTITY_REF"><b>TOK_MAGIC_ENTITY_REF</b></a>
<dd> Represents a general entity reference to a one of the 5 predefined
entities <code>amp</code>, <code>lt</code>, <code>gt</code>,
<code>quot</code>, <code>apos</code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_NAME"><b>TOK_NAME</b></a>
<dd> Represents a name in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_NAME_ASTERISK"><b>TOK_NAME_ASTERISK</b></a>
<dd> Represents a name followed immediately by <code>*</code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_NAME_PLUS"><b>TOK_NAME_PLUS</b></a>
<dd> Represents a name followed immediately by <code>+</code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_NAME_QUESTION"><b>TOK_NAME_QUESTION</b></a>
<dd> Represents a name followed immediately by <code>?</code>.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_NMTOKEN"><b>TOK_NMTOKEN</b></a>
<dd> Represents a name token in the prolog that is not a name.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_OPEN_BRACKET"><b>TOK_OPEN_BRACKET</b></a>
<dd> Represents <code>[</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_OPEN_PAREN"><b>TOK_OPEN_PAREN</b></a>
<dd> Represents a <code>(</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_OR"><b>TOK_OR</b></a>
<dd> Represents <code>|</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_PARAM_ENTITY_REF"><b>TOK_PARAM_ENTITY_REF</b></a>
<dd> Represents a parameter entity reference in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_PERCENT"><b>TOK_PERCENT</b></a>
<dd> Represents a <code>%</code> in the prolog that does not start
a parameter entity reference.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_PI"><b>TOK_PI</b></a>
<dd> Represents a processing instruction.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_POUND_NAME"><b>TOK_POUND_NAME</b></a>
<dd> Represents <code>#NAME</code> in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_PROLOG_S"><b>TOK_PROLOG_S</b></a>
<dd> Represents whitespace in the prolog.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_START_TAG_NO_ATTS"><b>TOK_START_TAG_NO_ATTS</b></a>
<dd> Represents a complete start-tag <code><name></code>,
that doesn't have any attribute specifications.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_START_TAG_WITH_ATTS"><b>TOK_START_TAG_WITH_ATTS</b></a>
<dd> Represents a complete start-tag <code><name att="val"></code>,
that contains one or more attribute specifications.
<dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#TOK_XML_DECL"><b>TOK_XML_DECL</b></a>
<dd> Represents an XML declaration or text declaration (a processing
instruction whose target is <code>xml</code>).
</dl>
<h2>
<img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#convert(byte[], int, int, char[], int)"><b>convert</b></a>(byte[], int, int, char[], int)
<dd> Convert bytes to characters.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getEncoding(java.lang.String)"><b>getEncoding</b></a>(String)
<dd> Returns an <code>Encoding</code> corresponding to
the specified IANA character set name.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getFixedBytesPerChar()"><b>getFixedBytesPerChar</b></a>()
<dd> Returns the number of bytes required to represent each <code>char</code>,
or zero if different <code>char</code>s are represented by different
numbers of bytes.
<dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getInitialEncoding(byte[], int, int, com.jclark.xml.tok.Token)"><b>getInitialEncoding</b></a>(byte[], int, int, Token)
<dd> Returns an encoding object to be used to start parsing an external entity.
<dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getInternalEncoding()"><b>getInternalEncoding</b></a>()
<dd> Returns an <code>Encoding</code> object for use with internal entities.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getMinBytesPerChar()"><b>getMinBytesPerChar</b></a>()
<dd> Returns the minimum number of bytes required to represent a single
character in this encoding.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getPublicId(byte[], int, int)"><b>getPublicId</b></a>(byte[], int, int)
<dd> Checks that a literal contained in the specified byte subarray
is a legal public identifier and returns a string with
the normalized content of the public id.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#getSingleByteEncoding(java.lang.String)"><b>getSingleByteEncoding</b></a>(String)
<dd> Returns an <code>Encoding</code> for entities encoded with
a single-byte encoding (an encoding in which each byte represents
exactly one character).
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#matchesXMLString(byte[], int, int, java.lang.String)"><b>matchesXMLString</b></a>(byte[], int, int, String)
<dd> Returns true if the specified byte subarray is equal to the string.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#movePosition(byte[], int, int, com.jclark.xml.tok.Position)"><b>movePosition</b></a>(byte[], int, int, Position)
<dd> Moves a position forward.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#skipIgnoreSect(byte[], int, int)"><b>skipIgnoreSect</b></a>(byte[], int, int)
<dd> Skips over an ignored conditional section.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#skipS(byte[], int, int)"><b>skipS</b></a>(byte[], int, int)
<dd> Skips over XML whitespace characters at the start of the specified
subarray.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#tokenizeAttributeValue(byte[], int, int, com.jclark.xml.tok.Token)"><b>tokenizeAttributeValue</b></a>(byte[], int, int, Token)
<dd> Scans the first token of a byte subarrary that contains part of
literal attribute value.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#tokenizeCdataSection(byte[], int, int, com.jclark.xml.tok.Token)"><b>tokenizeCdataSection</b></a>(byte[], int, int, Token)
<dd> Scans the first token of a byte subarrary that starts with the
content of a CDATA section.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#tokenizeContent(byte[], int, int, com.jclark.xml.tok.ContentToken)"><b>tokenizeContent</b></a>(byte[], int, int, ContentToken)
<dd> Scans the first token of a byte subarrary that contains content.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#tokenizeEntityValue(byte[], int, int, com.jclark.xml.tok.Token)"><b>tokenizeEntityValue</b></a>(byte[], int, int, Token)
<dd> Scans the first token of a byte subarrary that contains part of
literal entity value.
<dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
<a href="#tokenizeProlog(byte[], int, int, com.jclark.xml.tok.Token)"><b>tokenizeProlog</b></a>(byte[], int, int, Token)
<dd> Scans the first token of a byte subarray that contains part of a
prolog.
</dl>
<a name="variables"></a>
<h2>
<img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="TOK_DATA_CHARS"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_DATA_CHARS</b>
<pre>
public static final int TOK_DATA_CHARS
</pre>
<dl>
<dd> Represents one or more characters of data.<p>
</dl>
<a name="TOK_DATA_NEWLINE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_DATA_NEWLINE</b>
<pre>
public static final int TOK_DATA_NEWLINE
</pre>
<dl>
<dd> Represents a newline (CR, LF or CR followed by LF) in data.<p>
</dl>
<a name="TOK_START_TAG_NO_ATTS"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_START_TAG_NO_ATTS</b>
<pre>
public static final int TOK_START_TAG_NO_ATTS
</pre>
<dl>
<dd> Represents a complete start-tag <code><name></code>,
that doesn't have any attribute specifications.<p>
</dl>
<a name="TOK_START_TAG_WITH_ATTS"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_START_TAG_WITH_ATTS</b>
<pre>
public static final int TOK_START_TAG_WITH_ATTS
</pre>
<dl>
<dd> Represents a complete start-tag <code><name att="val"></code>,
that contains one or more attribute specifications.<p>
</dl>
<a name="TOK_EMPTY_ELEMENT_NO_ATTS"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_EMPTY_ELEMENT_NO_ATTS</b>
<pre>
public static final int TOK_EMPTY_ELEMENT_NO_ATTS
</pre>
<dl>
<dd> Represents an empty element tag <code><name/></code>,
that doesn't have any attribute specifications.<p>
</dl>
<a name="TOK_EMPTY_ELEMENT_WITH_ATTS"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_EMPTY_ELEMENT_WITH_ATTS</b>
<pre>
public static final int TOK_EMPTY_ELEMENT_WITH_ATTS
</pre>
<dl>
<dd> Represents an empty element tag <code><name att="val"/></code>,
that contains one or more attribute specifications.<p>
</dl>
<a name="TOK_END_TAG"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_END_TAG</b>
<pre>
public static final int TOK_END_TAG
</pre>
<dl>
<dd> Represents a complete end-tag <code></name></code>.<p>
</dl>
<a name="TOK_CDATA_SECT_OPEN"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CDATA_SECT_OPEN</b>
<pre>
public static final int TOK_CDATA_SECT_OPEN
</pre>
<dl>
<dd> Represents the start of a CDATA section <code><![CDATA[</code>.<p>
</dl>
<a name="TOK_CDATA_SECT_CLOSE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CDATA_SECT_CLOSE</b>
<pre>
public static final int TOK_CDATA_SECT_CLOSE
</pre>
<dl>
<dd> Represents the end of a CDATA section <code>]]></code>.<p>
</dl>
<a name="TOK_ENTITY_REF"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_ENTITY_REF</b>
<pre>
public static final int TOK_ENTITY_REF
</pre>
<dl>
<dd> Represents a general entity reference.<p>
</dl>
<a name="TOK_MAGIC_ENTITY_REF"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_MAGIC_ENTITY_REF</b>
<pre>
public static final int TOK_MAGIC_ENTITY_REF
</pre>
<dl>
<dd> Represents a general entity reference to a one of the 5 predefined
entities <code>amp</code>, <code>lt</code>, <code>gt</code>,
<code>quot</code>, <code>apos</code>.<p>
</dl>
<a name="TOK_CHAR_REF"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CHAR_REF</b>
<pre>
public static final int TOK_CHAR_REF
</pre>
<dl>
<dd> Represents a numeric character reference (decimal or hexadecimal),
when the referenced character is less than or equal to 0xFFFF
and so is represented by a single char.<p>
</dl>
<a name="TOK_CHAR_PAIR_REF"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CHAR_PAIR_REF</b>
<pre>
public static final int TOK_CHAR_PAIR_REF
</pre>
<dl>
<dd> Represents a numeric character reference (decimal or hexadecimal),
when the referenced character is greater than 0xFFFF and so is
represented by a pair of chars.<p>
</dl>
<a name="TOK_PI"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_PI</b>
<pre>
public static final int TOK_PI
</pre>
<dl>
<dd> Represents a processing instruction.<p>
</dl>
<a name="TOK_XML_DECL"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_XML_DECL</b>
<pre>
public static final int TOK_XML_DECL
</pre>
<dl>
<dd> Represents an XML declaration or text declaration (a processing
instruction whose target is <code>xml</code>).<p>
</dl>
<a name="TOK_COMMENT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_COMMENT</b>
<pre>
public static final int TOK_COMMENT
</pre>
<dl>
<dd> Represents a comment <code><!-- comment --></code>.
This can occur both in the prolog and in content.<p>
</dl>
<a name="TOK_ATTRIBUTE_VALUE_S"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_ATTRIBUTE_VALUE_S</b>
<pre>
public static final int TOK_ATTRIBUTE_VALUE_S
</pre>
<dl>
<dd> Represents a white space character in an attribute value,
excluding white space characters that are part of line boundaries.<p>
</dl>
<a name="TOK_PARAM_ENTITY_REF"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_PARAM_ENTITY_REF</b>
<pre>
public static final int TOK_PARAM_ENTITY_REF
</pre>
<dl>
<dd> Represents a parameter entity reference in the prolog.<p>
</dl>
<a name="TOK_PROLOG_S"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_PROLOG_S</b>
<pre>
public static final int TOK_PROLOG_S
</pre>
<dl>
<dd> Represents whitespace in the prolog.
The token contains one or more whitespace characters.<p>
</dl>
<a name="TOK_DECL_OPEN"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_DECL_OPEN</b>
<pre>
public static final int TOK_DECL_OPEN
</pre>
<dl>
<dd> Represents <code><!NAME</code> in the prolog.<p>
</dl>
<a name="TOK_DECL_CLOSE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_DECL_CLOSE</b>
<pre>
public static final int TOK_DECL_CLOSE
</pre>
<dl>
<dd> Represents <code>></code> in the prolog.<p>
</dl>
<a name="TOK_NAME"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_NAME</b>
<pre>
public static final int TOK_NAME
</pre>
<dl>
<dd> Represents a name in the prolog.<p>
</dl>
<a name="TOK_NMTOKEN"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_NMTOKEN</b>
<pre>
public static final int TOK_NMTOKEN
</pre>
<dl>
<dd> Represents a name token in the prolog that is not a name.<p>
</dl>
<a name="TOK_POUND_NAME"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_POUND_NAME</b>
<pre>
public static final int TOK_POUND_NAME
</pre>
<dl>
<dd> Represents <code>#NAME</code> in the prolog.<p>
</dl>
<a name="TOK_OR"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_OR</b>
<pre>
public static final int TOK_OR
</pre>
<dl>
<dd> Represents <code>|</code> in the prolog.<p>
</dl>
<a name="TOK_PERCENT"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_PERCENT</b>
<pre>
public static final int TOK_PERCENT
</pre>
<dl>
<dd> Represents a <code>%</code> in the prolog that does not start
a parameter entity reference.
This can occur in an entity declaration.<p>
</dl>
<a name="TOK_OPEN_PAREN"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_OPEN_PAREN</b>
<pre>
public static final int TOK_OPEN_PAREN
</pre>
<dl>
<dd> Represents a <code>(</code> in the prolog.<p>
</dl>
<a name="TOK_CLOSE_PAREN"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CLOSE_PAREN</b>
<pre>
public static final int TOK_CLOSE_PAREN
</pre>
<dl>
<dd> Represents a <code>)</code> in the prolog that is not
followed immediately by any of
<code>*</code>, <code>+</code> or <code>?</code>.<p>
</dl>
<a name="TOK_OPEN_BRACKET"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_OPEN_BRACKET</b>
<pre>
public static final int TOK_OPEN_BRACKET
</pre>
<dl>
<dd> Represents <code>[</code> in the prolog.<p>
</dl>
<a name="TOK_CLOSE_BRACKET"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CLOSE_BRACKET</b>
<pre>
public static final int TOK_CLOSE_BRACKET
</pre>
<dl>
<dd> Represents <code>]</code> in the prolog.<p>
</dl>
<a name="TOK_LITERAL"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_LITERAL</b>
<pre>
public static final int TOK_LITERAL
</pre>
<dl>
<dd> Represents a literal (EntityValue, AttValue, SystemLiteral or
PubidLiteral).<p>
</dl>
<a name="TOK_NAME_QUESTION"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_NAME_QUESTION</b>
<pre>
public static final int TOK_NAME_QUESTION
</pre>
<dl>
<dd> Represents a name followed immediately by <code>?</code>.<p>
</dl>
<a name="TOK_NAME_ASTERISK"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_NAME_ASTERISK</b>
<pre>
public static final int TOK_NAME_ASTERISK
</pre>
<dl>
<dd> Represents a name followed immediately by <code>*</code>.<p>
</dl>
<a name="TOK_NAME_PLUS"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_NAME_PLUS</b>
<pre>
public static final int TOK_NAME_PLUS
</pre>
<dl>
<dd> Represents a name followed immediately by <code>+</code>.<p>
</dl>
<a name="TOK_COND_SECT_OPEN"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_COND_SECT_OPEN</b>
<pre>
public static final int TOK_COND_SECT_OPEN
</pre>
<dl>
<dd> Represents <code><![</code> in the prolog.<p>
</dl>
<a name="TOK_COND_SECT_CLOSE"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_COND_SECT_CLOSE</b>
<pre>
public static final int TOK_COND_SECT_CLOSE
</pre>
<dl>
<dd> Represents <code>]]></code> in the prolog.<p>
</dl>
<a name="TOK_CLOSE_PAREN_QUESTION"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CLOSE_PAREN_QUESTION</b>
<pre>
public static final int TOK_CLOSE_PAREN_QUESTION
</pre>
<dl>
<dd> Represents <code>)?</code> in the prolog.<p>
</dl>
<a name="TOK_CLOSE_PAREN_ASTERISK"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CLOSE_PAREN_ASTERISK</b>
<pre>
public static final int TOK_CLOSE_PAREN_ASTERISK
</pre>
<dl>
<dd> Represents <code>)*</code> in the prolog.<p>
</dl>
<a name="TOK_CLOSE_PAREN_PLUS"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_CLOSE_PAREN_PLUS</b>
<pre>
public static final int TOK_CLOSE_PAREN_PLUS
</pre>
<dl>
<dd> Represents <code>)+</code> in the prolog.<p>
</dl>
<a name="TOK_COMMA"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
<b>TOK_COMMA</b>
<pre>
public static final int TOK_COMMA
</pre>
<dl>
<dd> Represents <code>,</code> in the prolog.<p>
</dl>
<a name="methods"></a>
<h2>
<img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="convert(byte[], int, int, char[], int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="convert"><b>convert</b></a>
<pre>
public abstract int convert(byte sourceBuf[],
int sourceStart,
int sourceEnd,
char targetBuf[],
int targetStart)
</pre>
<dl>
<dd> Convert bytes to characters.
The bytes on <code>sourceBuf</code> between <code>sourceStart</code>
and <code>sourceEnd</code> are converted to characters and stored
in <code>targetBuf</code> starting at <code>targetStart</code>.
<code>(targetBuf.length - targetStart) * getMinBytesPerChar()</code>
must be at greater than or equal to
<code>sourceEnd - sourceStart</code>.
If <code>getFixedBytesPerChar</code> returns a value greater than 0,
then the return value will be equal to
<code>(sourceEnd - sourceStart)/getFixedBytesPerChar()</code>.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> the number of characters stored into <code>targetBuf</code>
<dt> <b>See Also:</b>
<dd> <a href="#getFixedBytesPerChar">getFixedBytesPerChar</a>
</dl></dd>
</dl>
<a name="getFixedBytesPerChar()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getFixedBytesPerChar"><b>getFixedBytesPerChar</b></a>
<pre>
public abstract int getFixedBytesPerChar()
</pre>
<dl>
<dd> Returns the number of bytes required to represent each <code>char</code>,
or zero if different <code>char</code>s are represented by different
numbers of bytes. The value returned will 0, 1, 2, or 4.
<p>
</dl>
<a name="movePosition(byte[], int, int, com.jclark.xml.tok.Position)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="movePosition"><b>movePosition</b></a>
<pre>
public abstract void movePosition(byte buf[],
int off,
int end,
<a href="com.jclark.xml.tok.Position.html#_top_">Position</a> pos)
</pre>
<dl>
<dd> Moves a position forward.
On entry, <code>pos</code> gives the position of the byte at index
<code>off</code> in <code>buf</code>.
On exit, it <code>pos</code> will give the position of the byte at index
<code>end</code>, which must be greater than or equal to <code>off</code>.
The bytes between <code>off</code> and <code>end</code> must encode
one or more complete characters.
A carriage return followed by a line feed will be treated as a single
line delimiter provided that they are given to <code>movePosition</code>
together.
<p>
</dl>
<a name="tokenizeCdataSection(byte[], int, int, com.jclark.xml.tok.Token)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="tokenizeCdataSection"><b>tokenizeCdataSection</b></a>
<pre>
public final int tokenizeCdataSection(byte buf[],
int off,
int end,
<a href="com.jclark.xml.tok.Token.html#_top_">Token</a> token) throws <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
</pre>
<dl>
<dd> Scans the first token of a byte subarrary that starts with the
content of a CDATA section.
Returns one of the following integers according to the type of token
that the subarray starts with:
<ul>
<li><code>TOK_DATA_CHARS</code>
<li><code>TOK_DATA_NEWLINE</code>
<li><code>TOK_CDATA_SECT_CLOSE</code>
</ul>
<p>
Information about the token is stored in <code>token</code>.
<p>
After <code>TOK_CDATA_SECT_CLOSE</code> is returned, the application
should use <code>tokenizeContent</code>.
<p>
<dd><dl>
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>
<dd> if the subarray is empty
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>
<dd> if the subarray contains only part of
a legal token
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
<dd> if the subarrary does not start
with a legal token or part of one
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
<dd> if the subarray encodes just a carriage
return ('\r')
<dt> <b>See Also:</b>
<dd> <a href="#TOK_DATA_CHARS">TOK_DATA_CHARS</a>, <a href="#TOK_DATA_NEWLINE">TOK_DATA_NEWLINE</a>, <a href="#TOK_CDATA_SECT_CLOSE">TOK_CDATA_SECT_CLOSE</a>, <a href="com.jclark.xml.tok.Token.html#_top_">Token</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>, <a href="#tokenizeContent">tokenizeContent</a>
</dl></dd>
</dl>
<a name="tokenizeContent(byte[], int, int, com.jclark.xml.tok.ContentToken)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="tokenizeContent"><b>tokenizeContent</b></a>
<pre>
public final int tokenizeContent(byte buf[],
int off,
int end,
<a href="com.jclark.xml.tok.ContentToken.html#_top_">ContentToken</a> token) throws <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
</pre>
<dl>
<dd> Scans the first token of a byte subarrary that contains content.
Returns one of the following integers according to the type of token
that the subarray starts with:
<ul>
<li><code>TOK_START_TAG_NO_ATTS</code>
<li><code>TOK_START_TAG_WITH_ATTS</code>
<li><code>TOK_EMPTY_ELEMENT_NO_ATTS</code>
<li><code>TOK_EMPTY_ELEMENT_WITH_ATTS</code>
<li><code>TOK_END_TAG</code>
<li><code>TOK_DATA_CHARS</code>
<li><code>TOK_DATA_NEWLINE</code>
<li><code>TOK_CDATA_SECT_OPEN</code>
<li><code>TOK_ENTITY_REF</code>
<li><code>TOK_MAGIC_ENTITY_REF</code>
<li><code>TOK_CHAR_REF</code>
<li><code>TOK_CHAR_PAIR_REF</code>
<li><code>TOK_PI</code>
<li><code>TOK_XML_DECL</code>
<li><code>TOK_COMMENT</code>
</ul>
<p>
Information about the token is stored in <code>token</code>.
<p>
When <code>TOK_CDATA_SECT_OPEN</code> is returned,
<code>tokenizeCdataSection</code> should be called until
it returns <code>TOK_CDATA_SECT</code>.
<p>
<dd><dl>
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>
<dd> if the subarray is empty
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>
<dd> if the subarray contains only part of
a legal token
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
<dd> if the subarrary does not start
with a legal token or part of one
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
<dd> if the subarray encodes just a carriage
return ('\r')
<dt> <b>See Also:</b>
<dd> <a href="#TOK_START_TAG_NO_ATTS">TOK_START_TAG_NO_ATTS</a>, <a href="#TOK_START_TAG_WITH_ATTS">TOK_START_TAG_WITH_ATTS</a>, <a href="#TOK_EMPTY_ELEMENT_NO_ATTS">TOK_EMPTY_ELEMENT_NO_ATTS</a>, <a href="#TOK_EMPTY_ELEMENT_WITH_ATTS">TOK_EMPTY_ELEMENT_WITH_ATTS</a>, <a href="#TOK_END_TAG">TOK_END_TAG</a>, <a href="#TOK_DATA_CHARS">TOK_DATA_CHARS</a>, <a href="#TOK_DATA_NEWLINE">TOK_DATA_NEWLINE</a>, <a href="#TOK_CDATA_SECT_OPEN">TOK_CDATA_SECT_OPEN</a>, <a href="#TOK_ENTITY_REF">TOK_ENTITY_REF</a>, <a href="#TOK_MAGIC_ENTITY_REF">TOK_MAGIC_ENTITY_REF</a>, <a href="#TOK_CHAR_REF">TOK_CHAR_REF</a>, <a href="#TOK_CHAR_PAIR_REF">TOK_CHAR_PAIR_REF</a>, <a href="#TOK_PI">TOK_PI</a>, <a href="#TOK_XML_DECL">TOK_XML_DECL</a>, <a href="#TOK_COMMENT">TOK_COMMENT</a>, <a href="com.jclark.xml.tok.ContentToken.html#_top_">ContentToken</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>, <a href="#tokenizeCdataSection">tokenizeCdataSection</a>
</dl></dd>
</dl>
<a name="getInitialEncoding(byte[], int, int, com.jclark.xml.tok.Token)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getInitialEncoding"><b>getInitialEncoding</b></a>
<pre>
public static final <a href="#_top_">Encoding</a> getInitialEncoding(byte buf[],
int off,
int end,
<a href="com.jclark.xml.tok.Token.html#_top_">Token</a> token)
</pre>
<dl>
<dd> Returns an encoding object to be used to start parsing an external entity.
The encoding is chosen based on the initial 4 bytes of the entity.
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> buf - the byte array containing the initial bytes of the entity
<dd> off - the index in <code>buf</code> of the first byte of the entity
<dd> end - the index in <code>buf</code> following the last available
byte of the entity; <code>end - off</code> must be greater than or equal
to 4 unless the entity has fewer that 4 bytes, in which case it must
be equal to the length of the entity
<dd> token - receives information about the presence of a byte order
mark; if the entity starts with a byte order mark
then <code>token.getTokenEnd()</code>
will return <code>off + 2</code>, otherwise it will return
<code>off</code>
<dt> <b>See Also:</b>
<dd> <a href="com.jclark.xml.tok.TextDecl.html#_top_">TextDecl</a>, <a href="com.jclark.xml.tok.XmlDecl.html#_top_">XmlDecl</a>, <a href="#TOK_XML_DECL">TOK_XML_DECL</a>, <a href="#getEncoding">getEncoding</a>, <a href="#getInternalEncoding">getInternalEncoding</a>
</dl></dd>
</dl>
<a name="getEncoding(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getEncoding"><b>getEncoding</b></a>
<pre>
public final <a href="#_top_">Encoding</a> getEncoding(String name)
</pre>
<dl>
<dd> Returns an <code>Encoding</code> corresponding to
the specified IANA character set name.
Returns this <code>Encoding</code> if the name is null.
Returns null if the specified encoding is not supported.
Note that there are two distinct <code>Encoding</code> objects
associated with the name <code>UTF-16</code>, one for
each possible byte order; if this <code>Encoding</code>
is UTF-16 with little-endian byte ordering, then
<code>getEncoding("UTF-16")</code> will return this,
otherwise it will return an <code>Encoding</code> for
UTF-16 with big-endian byte ordering.
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> name - a string specifying the IANA name of the encoding; this is
case insensitive
</dl></dd>
</dl>
<a name="getSingleByteEncoding(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getSingleByteEncoding"><b>getSingleByteEncoding</b></a>
<pre>
public final <a href="#_top_">Encoding</a> getSingleByteEncoding(String map)
</pre>
<dl>
<dd> Returns an <code>Encoding</code> for entities encoded with
a single-byte encoding (an encoding in which each byte represents
exactly one character).
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> map - a string specifying the character represented by each byte;
the string must have a length of 256; <code>map.charAt(b)</code>
specifies the character encoded by byte <code>b</code>; bytes that do
not represent any character should be mapped to <code>?</code>
</dl></dd>
</dl>
<a name="getInternalEncoding()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getInternalEncoding"><b>getInternalEncoding</b></a>
<pre>
public static final <a href="#_top_">Encoding</a> getInternalEncoding()
</pre>
<dl>
<dd> Returns an <code>Encoding</code> object for use with internal entities.
This is a UTF-16 big endian encoding, except that newlines
are assumed to have been normalized into line feed,
so carriage return is treated like a space.
<p>
</dl>
<a name="tokenizeProlog(byte[], int, int, com.jclark.xml.tok.Token)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="tokenizeProlog"><b>tokenizeProlog</b></a>
<pre>
public final int tokenizeProlog(byte buf[],
int off,
int end,
<a href="com.jclark.xml.tok.Token.html#_top_">Token</a> token) throws <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>, <a href="com.jclark.xml.tok.EndOfPrologException.html#_top_">EndOfPrologException</a>
</pre>
<dl>
<dd> Scans the first token of a byte subarray that contains part of a
prolog.
Returns one of the following integers according to the type of token
that the subarray starts with:
<ul>
<li><code>TOK_PI</code>
<li><code>TOK_XML_DECL</code>
<li><code>TOK_COMMENT</code>
<li><code>TOK_PARAM_ENTITY_REF</code>
<li><code>TOK_PROLOG_S</code>
<li><code>TOK_DECL_OPEN</code>
<li><code>TOK_DECL_CLOSE</code>
<li><code>TOK_NAME</code>
<li><code>TOK_NMTOKEN</code>
<li><code>TOK_POUND_NAME</code>
<li><code>TOK_OR</code>
<li><code>TOK_PERCENT</code>
<li><code>TOK_OPEN_PAREN</code>
<li><code>TOK_CLOSE_PAREN</code>
<li><code>TOK_OPEN_BRACKET</code>
<li><code>TOK_CLOSE_BRACKET</code>
<li><code>TOK_LITERAL</code>
<li><code>TOK_NAME_QUESTION</code>
<li><code>TOK_NAME_ASTERISK</code>
<li><code>TOK_NAME_PLUS</code>
<li><code>TOK_COND_SECT_OPEN</code>
<li><code>TOK_COND_SECT_CLOSE</code>
<li><code>TOK_CLOSE_PAREN_QUESTION</code>
<li><code>TOK_CLOSE_PAREN_ASTERISK</code>
<li><code>TOK_CLOSE_PAREN_PLUS</code>
<li><code>TOK_COMMA</code>
</ul>
<p>
<dd><dl>
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>
<dd> if the subarray is empty
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>
<dd> if the subarray contains only part of
a legal token
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
<dd> if the subarrary does not start
with a legal token or part of one
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.EndOfPrologException.html#_top_">EndOfPrologException</a>
<dd> if the subarray starts with the document
element; <code>tokenizeContent</code> should be used on the remainder
of the entity
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
<dd> if the subarray is a legal token
but subsequent bytes in the same entity could be part of the token
<dt> <b>See Also:</b>
<dd> <a href="#TOK_PI">TOK_PI</a>, <a href="#TOK_XML_DECL">TOK_XML_DECL</a>, <a href="#TOK_COMMENT">TOK_COMMENT</a>, <a href="#TOK_PARAM_ENTITY_REF">TOK_PARAM_ENTITY_REF</a>, <a href="#TOK_PROLOG_S">TOK_PROLOG_S</a>, <a href="#TOK_DECL_OPEN">TOK_DECL_OPEN</a>, <a href="#TOK_DECL_CLOSE">TOK_DECL_CLOSE</a>, <a href="#TOK_NAME">TOK_NAME</a>, <a href="#TOK_NMTOKEN">TOK_NMTOKEN</a>, <a href="#TOK_POUND_NAME">TOK_POUND_NAME</a>, <a href="#TOK_OR">TOK_OR</a>, <a href="#TOK_PERCENT">TOK_PERCENT</a>, <a href="#TOK_OPEN_PAREN">TOK_OPEN_PAREN</a>, <a href="#TOK_CLOSE_PAREN">TOK_CLOSE_PAREN</a>, <a href="#TOK_OPEN_BRACKET">TOK_OPEN_BRACKET</a>, <a href="#TOK_CLOSE_BRACKET">TOK_CLOSE_BRACKET</a>, <a href="#TOK_LITERAL">TOK_LITERAL</a>, <a href="#TOK_NAME_QUESTION">TOK_NAME_QUESTION</a>, <a href="#TOK_NAME_ASTERISK">TOK_NAME_ASTERISK</a>, <a href="#TOK_NAME_PLUS">TOK_NAME_PLUS</a>, <a href="#TOK_COND_SECT_OPEN">TOK_COND_SECT_OPEN</a>, <a href="#TOK_COND_SECT_CLOSE">TOK_COND_SECT_CLOSE</a>, <a href="#TOK_CLOSE_PAREN_QUESTION">TOK_CLOSE_PAREN_QUESTION</a>, <a href="#TOK_CLOSE_PAREN_ASTERISK">TOK_CLOSE_PAREN_ASTERISK</a>, <a href="#TOK_CLOSE_PAREN_PLUS">TOK_CLOSE_PAREN_PLUS</a>, <a href="#TOK_COMMA">TOK_COMMA</a>, <a href="com.jclark.xml.tok.ContentToken.html#_top_">ContentToken</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>, <a href="com.jclark.xml.tok.EndOfPrologException.html#_top_">EndOfPrologException</a>
</dl></dd>
</dl>
<a name="tokenizeAttributeValue(byte[], int, int, com.jclark.xml.tok.Token)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="tokenizeAttributeValue"><b>tokenizeAttributeValue</b></a>
<pre>
public final int tokenizeAttributeValue(byte buf[],
int off,
int end,
<a href="com.jclark.xml.tok.Token.html#_top_">Token</a> token) throws <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
</pre>
<dl>
<dd> Scans the first token of a byte subarrary that contains part of
literal attribute value. The opening and closing delimiters
are not included in the subarrary.
Returns one of the following integers according to the type of
token that the subarray starts with:
<ul>
<li><code>TOK_DATA_CHARS</code>
<li><code>TOK_DATA_NEWLINE</code>
<li><code>TOK_ATTRIBUTE_VALUE_S</code>
<li><code>TOK_MAGIC_ENTITY_REF</code>
<li><code>TOK_ENTITY_REF</code>
<li><code>TOK_CHAR_REF</code>
<li><code>TOK_CHAR_PAIR_REF</code>
</ul>
<p>
<dd><dl>
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>
<dd> if the subarray is empty
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>
<dd> if the subarray contains only part of
a legal token
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
<dd> if the subarrary does not start
with a legal token or part of one
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
<dd> if the subarray encodes just a carriage
return ('\r')
<dt> <b>See Also:</b>
<dd> <a href="#TOK_DATA_CHARS">TOK_DATA_CHARS</a>, <a href="#TOK_DATA_NEWLINE">TOK_DATA_NEWLINE</a>, <a href="#TOK_ATTRIBUTE_VALUE_S">TOK_ATTRIBUTE_VALUE_S</a>, <a href="#TOK_MAGIC_ENTITY_REF">TOK_MAGIC_ENTITY_REF</a>, <a href="#TOK_ENTITY_REF">TOK_ENTITY_REF</a>, <a href="#TOK_CHAR_REF">TOK_CHAR_REF</a>, <a href="#TOK_CHAR_PAIR_REF">TOK_CHAR_PAIR_REF</a>, <a href="com.jclark.xml.tok.Token.html#_top_">Token</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
</dl></dd>
</dl>
<a name="tokenizeEntityValue(byte[], int, int, com.jclark.xml.tok.Token)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="tokenizeEntityValue"><b>tokenizeEntityValue</b></a>
<pre>
public final int tokenizeEntityValue(byte buf[],
int off,
int end,
<a href="com.jclark.xml.tok.Token.html#_top_">Token</a> token) throws <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
</pre>
<dl>
<dd> Scans the first token of a byte subarrary that contains part of
literal entity value. The opening and closing delimiters
are not included in the subarrary.
Returns one of the following integers according to the type of
token that the subarray starts with:
<ul>
<li><code>TOK_DATA_CHARS</code>
<li><code>TOK_DATA_NEWLINE</code>
<li><code>TOK_PARAM_ENTITY_REF</code>
<li><code>TOK_MAGIC_ENTITY_REF</code>
<li><code>TOK_ENTITY_REF</code>
<li><code>TOK_CHAR_REF</code>
<li><code>TOK_CHAR_PAIR_REF</code>
</ul>
<p>
<dd><dl>
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>
<dd> if the subarray is empty
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>
<dd> if the subarray contains only part of
a legal token
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
<dd> if the subarrary does not start
with a legal token or part of one
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
<dd> if the subarray encodes just a carriage
return ('\r')
<dt> <b>See Also:</b>
<dd> <a href="#TOK_DATA_CHARS">TOK_DATA_CHARS</a>, <a href="#TOK_DATA_NEWLINE">TOK_DATA_NEWLINE</a>, <a href="#TOK_MAGIC_ENTITY_REF">TOK_MAGIC_ENTITY_REF</a>, <a href="#TOK_ENTITY_REF">TOK_ENTITY_REF</a>, <a href="#TOK_PARAM_ENTITY_REF">TOK_PARAM_ENTITY_REF</a>, <a href="#TOK_CHAR_REF">TOK_CHAR_REF</a>, <a href="#TOK_CHAR_PAIR_REF">TOK_CHAR_PAIR_REF</a>, <a href="com.jclark.xml.tok.Token.html#_top_">Token</a>, <a href="com.jclark.xml.tok.EmptyTokenException.html#_top_">EmptyTokenException</a>, <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>, <a href="com.jclark.xml.tok.ExtensibleTokenException.html#_top_">ExtensibleTokenException</a>
</dl></dd>
</dl>
<a name="skipIgnoreSect(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="skipIgnoreSect"><b>skipIgnoreSect</b></a>
<pre>
public final int skipIgnoreSect(byte buf[],
int off,
int end) throws <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>, <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
</pre>
<dl>
<dd> Skips over an ignored conditional section.
The subarray starts following the <code><![ IGNORE [</code>.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> the index of the character following the closing
<code>]]></code>
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.PartialTokenException.html#_top_">PartialTokenException</a>
<dd> if the subarray does not contain the
complete ignored conditional section
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
<dd> if the ignored conditional section
contains illegal characters
</dl></dd>
</dl>
<a name="getPublicId(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getPublicId"><b>getPublicId</b></a>
<pre>
public final String getPublicId(byte buf[],
int off,
int end) throws <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
</pre>
<dl>
<dd> Checks that a literal contained in the specified byte subarray
is a legal public identifier and returns a string with
the normalized content of the public id.
The subarray includes the opening and closing quotes.
<p>
<dd><dl>
<dt> <b>Throws:</b> <a href="com.jclark.xml.tok.InvalidTokenException.html#_top_">InvalidTokenException</a>
<dd> if it is not a legal public identifier
</dl></dd>
</dl>
<a name="matchesXMLString(byte[], int, int, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="matchesXMLString"><b>matchesXMLString</b></a>
<pre>
public final boolean matchesXMLString(byte buf[],
int off,
int end,
String str)
</pre>
<dl>
<dd> Returns true if the specified byte subarray is equal to the string.
The string must contain only XML significant characters.
<p>
</dl>
<a name="skipS(byte[], int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="skipS"><b>skipS</b></a>
<pre>
public final int skipS(byte buf[],
int off,
int end)
</pre>
<dl>
<dd> Skips over XML whitespace characters at the start of the specified
subarray.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> the index of the first non-whitespace character,
<code>end</code> if there is the subarray is all whitespace
</dl></dd>
</dl>
<a name="getMinBytesPerChar()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getMinBytesPerChar"><b>getMinBytesPerChar</b></a>
<pre>
public final int getMinBytesPerChar()
</pre>
<dl>
<dd> Returns the minimum number of bytes required to represent a single
character in this encoding. The value will be 1, 2 or 4.
<p>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-com.jclark.xml.tok.html">This Package</a> <a href="com.jclark.xml.tok.ContentToken.html#_top_">Previous</a> <a href="com.jclark.xml.tok.Position.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre>
</body>
</html>
|