| java.lang.Object org.xbill.DNS.Tokenizer
Tokenizer | public class Tokenizer (Code) | | Tokenizer is used to parse DNS records and zones from text format,
author: Brian Wellington author: Bob Halley |
Inner Class :public static class Token | |
Method Summary | |
public void | close() Closes any files opened by this tokenizer. | public TextParseException | exception(String s) Creates an exception which includes the current state in the error message
Parameters: s - The error message to include. | protected void | finalize() | public Token | get(boolean wantWhitespace, boolean wantComment) Gets the next token from a tokenizer.
Parameters: wantWhitespace - If true, leading whitespace will be returned as atoken. Parameters: wantComment - If true, comments are returned as tokens. | public Token | get() Gets the next token from a tokenizer, ignoring whitespace and comments. | public InetAddress | getAddress(int family) Gets the next token from a tokenizer and converts it to an IP Address.
Parameters: family - The address family. | public byte[] | getBase64(boolean required) Gets the remaining string tokens until an EOL/EOF is seen, concatenates
them together, and converts the base64 encoded data to a byte array.
Parameters: required - If true, an exception will be thrown if no strings remain;otherwise null be be returned. | public byte[] | getBase64() Gets the remaining string tokens until an EOL/EOF is seen, concatenates
them together, and converts the base64 encoded data to a byte array. | public void | getEOL() Gets the next token from a tokenizer, which must be an EOL or EOF. | public byte[] | getHex(boolean required) Gets the remaining string tokens until an EOL/EOF is seen, concatenates
them together, and converts the hex encoded data to a byte array.
Parameters: required - If true, an exception will be thrown if no strings remain;otherwise null be be returned. | public byte[] | getHex() Gets the remaining string tokens until an EOL/EOF is seen, concatenates
them together, and converts the hex encoded data to a byte array. | public String | getIdentifier() Gets the next token from a tokenizer, ensures it is an unquoted string,
and converts it to a string. | public long | getLong() Gets the next token from a tokenizer and converts it to a long. | public Name | getName(Name origin) Gets the next token from a tokenizer and converts it to a name.
Parameters: origin - The origin to append to relative names. | public String | getString() Gets the next token from a tokenizer and converts it to a string. | public long | getTTL() Gets the next token from a tokenizer and parses it as a TTL. | public long | getTTLLike() Gets the next token from a tokenizer and parses it as if it were a TTL. | public int | getUInt16() Gets the next token from a tokenizer and converts it to an unsigned 16 bit
integer. | public long | getUInt32() Gets the next token from a tokenizer and converts it to an unsigned 32 bit
integer. | public int | getUInt8() Gets the next token from a tokenizer and converts it to an unsigned 8 bit
integer. | public void | unget() Returns a token to the stream, so that it will be returned by the next call
to get(). |
COMMENT | final public static int COMMENT(Code) | | A comment; only returned when wantComment is set
|
EOF | final public static int EOF(Code) | | End of file
|
EOL | final public static int EOL(Code) | | End of line
|
IDENTIFIER | final public static int IDENTIFIER(Code) | | An identifier (unquoted string)
|
QUOTED_STRING | final public static int QUOTED_STRING(Code) | | A quoted string
|
WHITESPACE | final public static int WHITESPACE(Code) | | Whitespace; only returned when wantWhitespace is set
|
Tokenizer | public Tokenizer(InputStream is)(Code) | | Creates a Tokenizer from an arbitrary input stream.
Parameters: is - The InputStream to tokenize. |
Tokenizer | public Tokenizer(String s)(Code) | | Creates a Tokenizer from a string.
Parameters: s - The String to tokenize. |
close | public void close()(Code) | | Closes any files opened by this tokenizer.
|
exception | public TextParseException exception(String s)(Code) | | Creates an exception which includes the current state in the error message
Parameters: s - The error message to include. The exception to be thrown |
finalize | protected void finalize()(Code) | | |
get | public Token get(boolean wantWhitespace, boolean wantComment) throws IOException(Code) | | Gets the next token from a tokenizer.
Parameters: wantWhitespace - If true, leading whitespace will be returned as atoken. Parameters: wantComment - If true, comments are returned as tokens. The next token in the stream. throws: TextParseException - The input was invalid. throws: IOException - An I/O error occurred. |
get | public Token get() throws IOException(Code) | | Gets the next token from a tokenizer, ignoring whitespace and comments.
The next token in the stream. throws: TextParseException - The input was invalid. throws: IOException - An I/O error occurred. |
getAddress | public InetAddress getAddress(int family) throws IOException(Code) | | Gets the next token from a tokenizer and converts it to an IP Address.
Parameters: family - The address family. The next token in the stream, as an InetAddress throws: TextParseException - The input was invalid or not a valid address. throws: IOException - An I/O error occurred. See Also: Address |
getBase64 | public byte[] getBase64(boolean required) throws IOException(Code) | | Gets the remaining string tokens until an EOL/EOF is seen, concatenates
them together, and converts the base64 encoded data to a byte array.
Parameters: required - If true, an exception will be thrown if no strings remain;otherwise null be be returned. The byte array containing the decoded strings, or null if therewere no strings to decode. throws: TextParseException - The input was invalid. throws: IOException - An I/O error occurred. |
getBase64 | public byte[] getBase64() throws IOException(Code) | | Gets the remaining string tokens until an EOL/EOF is seen, concatenates
them together, and converts the base64 encoded data to a byte array.
The byte array containing the decoded strings, or null if therewere no strings to decode. throws: TextParseException - The input was invalid. throws: IOException - An I/O error occurred. |
getEOL | public void getEOL() throws IOException(Code) | | Gets the next token from a tokenizer, which must be an EOL or EOF.
throws: TextParseException - The input was invalid or not an EOL or EOF token. throws: IOException - An I/O error occurred. |
getHex | public byte[] getHex(boolean required) throws IOException(Code) | | Gets the remaining string tokens until an EOL/EOF is seen, concatenates
them together, and converts the hex encoded data to a byte array.
Parameters: required - If true, an exception will be thrown if no strings remain;otherwise null be be returned. The byte array containing the decoded strings, or null if therewere no strings to decode. throws: TextParseException - The input was invalid. throws: IOException - An I/O error occurred. |
getHex | public byte[] getHex() throws IOException(Code) | | Gets the remaining string tokens until an EOL/EOF is seen, concatenates
them together, and converts the hex encoded data to a byte array.
The byte array containing the decoded strings, or null if therewere no strings to decode. throws: TextParseException - The input was invalid. throws: IOException - An I/O error occurred. |
getIdentifier | public String getIdentifier() throws IOException(Code) | | Gets the next token from a tokenizer, ensures it is an unquoted string,
and converts it to a string.
The next token in the stream, as a string. throws: TextParseException - The input was invalid or not an unquoted string. throws: IOException - An I/O error occurred. |
getLong | public long getLong() throws IOException(Code) | | Gets the next token from a tokenizer and converts it to a long.
The next token in the stream, as a long. throws: TextParseException - The input was invalid or not a long. throws: IOException - An I/O error occurred. |
getName | public Name getName(Name origin) throws IOException(Code) | | Gets the next token from a tokenizer and converts it to a name.
Parameters: origin - The origin to append to relative names. The next token in the stream, as a name. throws: TextParseException - The input was invalid or not a valid name. throws: IOException - An I/O error occurred. throws: RelativeNameException - The parsed name was relative, even with theorigin. See Also: Name |
getString | public String getString() throws IOException(Code) | | Gets the next token from a tokenizer and converts it to a string.
The next token in the stream, as a string. throws: TextParseException - The input was invalid or not a string. throws: IOException - An I/O error occurred. |
getTTL | public long getTTL() throws IOException(Code) | | Gets the next token from a tokenizer and parses it as a TTL.
The next token in the stream, as an unsigned 32 bit integer. throws: TextParseException - The input was not valid. throws: IOException - An I/O error occurred. See Also: TTL |
getTTLLike | public long getTTLLike() throws IOException(Code) | | Gets the next token from a tokenizer and parses it as if it were a TTL.
The next token in the stream, as an unsigned 32 bit integer. throws: TextParseException - The input was not valid. throws: IOException - An I/O error occurred. See Also: TTL |
getUInt16 | public int getUInt16() throws IOException(Code) | | Gets the next token from a tokenizer and converts it to an unsigned 16 bit
integer.
The next token in the stream, as an unsigned 16 bit integer. throws: TextParseException - The input was invalid or not an unsigned 16bit integer. throws: IOException - An I/O error occurred. |
getUInt32 | public long getUInt32() throws IOException(Code) | | Gets the next token from a tokenizer and converts it to an unsigned 32 bit
integer.
The next token in the stream, as an unsigned 32 bit integer. throws: TextParseException - The input was invalid or not an unsigned 32bit integer. throws: IOException - An I/O error occurred. |
getUInt8 | public int getUInt8() throws IOException(Code) | | Gets the next token from a tokenizer and converts it to an unsigned 8 bit
integer.
The next token in the stream, as an unsigned 8 bit integer. throws: TextParseException - The input was invalid or not an unsigned 8bit integer. throws: IOException - An I/O error occurred. |
unget | public void unget()(Code) | | Returns a token to the stream, so that it will be returned by the next call
to get().
throws: IllegalStateException - There are already ungotten tokens. |
|
|