public class Master
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
private int |
currentDClass |
private long |
currentTTL |
private int |
currentType |
private long |
defaultTTL |
private java.io.File |
file |
private Generator |
generator |
private java.util.List<Generator> |
generators |
private Master |
included |
private boolean |
includeThrowsException |
private Record |
last |
private boolean |
needSOATTL |
private boolean |
noExpandGenerate |
private boolean |
noExpandIncludes |
private Name |
origin |
private Tokenizer |
st |
Constructor and Description |
---|
Master(java.io.File file,
Name origin,
long initialTTL) |
Master(java.io.InputStream in)
Initializes the master file reader.
|
Master(java.io.InputStream in,
Name origin)
Initializes the master file reader.
|
Master(java.io.InputStream in,
Name origin,
long ttl)
Initializes the master file reader.
|
Master(java.lang.String filename)
Initializes the master file reader and opens the specified master file.
|
Master(java.lang.String filename,
Name origin)
Initializes the master file reader and opens the specified master file.
|
Master(java.lang.String filename,
Name origin,
long ttl)
Initializes the master file reader and opens the specified master file.
|
Modifier and Type | Method and Description |
---|---|
private Record |
_nextRecord()
Returns the next record in the master file.
|
void |
close() |
void |
disableIncludes()
Disable processing of $INCLUDE directives.
|
void |
disableIncludes(boolean strict)
Disable processing of $INCLUDE directives.
|
private void |
endGenerate() |
void |
expandGenerate(boolean wantExpand)
Specifies whether $GENERATE statements should be expanded.
|
java.util.Iterator<Generator> |
generators()
Returns an iterator over the generators specified in the master file; that is, the parsed
contents of $GENERATE statements.
|
private Record |
nextGenerated() |
Record |
nextRecord()
Returns the next record in the master file.
|
private Name |
parseName(java.lang.String s,
Name origin) |
private void |
parseTTLClassAndType() |
private long |
parseUInt32(java.lang.String s) |
private void |
startGenerate() |
private Name origin
private java.io.File file
private Record last
private long defaultTTL
private Master included
private final Tokenizer st
private int currentType
private int currentDClass
private long currentTTL
private boolean needSOATTL
private Generator generator
private java.util.List<Generator> generators
private boolean noExpandGenerate
private boolean noExpandIncludes
private boolean includeThrowsException
Master(java.io.File file, Name origin, long initialTTL) throws java.io.IOException
java.io.IOException
public Master(java.lang.String filename, Name origin, long ttl) throws java.io.IOException
filename
- The master file.origin
- The initial origin to append to relative names.ttl
- The initial default TTL.java.io.IOException
- The master file could not be opened.public Master(java.lang.String filename, Name origin) throws java.io.IOException
filename
- The master file.origin
- The initial origin to append to relative names.java.io.IOException
- The master file could not be opened.public Master(java.lang.String filename) throws java.io.IOException
filename
- The master file.java.io.IOException
- The master file could not be opened.public Master(java.io.InputStream in, Name origin, long ttl)
in
- The input stream containing a master file.origin
- The initial origin to append to relative names.ttl
- The initial default TTL.public Master(java.io.InputStream in, Name origin)
in
- The input stream containing a master file.origin
- The initial origin to append to relative names.public Master(java.io.InputStream in)
in
- The input stream containing a master file.private Name parseName(java.lang.String s, Name origin) throws TextParseException
TextParseException
private void parseTTLClassAndType() throws java.io.IOException
java.io.IOException
private long parseUInt32(java.lang.String s)
private void startGenerate() throws java.io.IOException
java.io.IOException
private void endGenerate() throws java.io.IOException
java.io.IOException
private Record nextGenerated() throws java.io.IOException
java.io.IOException
private Record _nextRecord() throws java.io.IOException
java.io.IOException
- The master file could not be read, or was syntactically invalid.public Record nextRecord() throws java.io.IOException
java.io.IOException
- The master file could not be read, or was syntactically invalid.public void disableIncludes()
public void disableIncludes(boolean strict)
strict
- If true, an exception will be thrown if $INCLUDE is encountered.public void expandGenerate(boolean wantExpand)
generators
. This must be
called before a $GENERATE statement is seen during iteration to have an effect.public java.util.Iterator<Generator> generators()
Generator
public void close()
close
in interface java.lang.AutoCloseable