public final class SnuggleInput extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SnuggleInput.InputType
Enumerates the various types of inputs we support.
|
| Constructor and Description |
|---|
SnuggleInput(File file) |
SnuggleInput(File file,
String identifier) |
SnuggleInput(File file,
String identifier,
String encoding) |
SnuggleInput(InputStream inputStream) |
SnuggleInput(InputStream inputStream,
String identifier) |
SnuggleInput(InputStream inputStream,
String identifier,
String encoding) |
SnuggleInput(Reader reader) |
SnuggleInput(Reader reader,
String identifier) |
SnuggleInput(String string) |
SnuggleInput(String string,
String identifier) |
| Modifier and Type | Method and Description |
|---|---|
String |
getEncoding() |
File |
getFile()
Returns the
File that provided this input if type is SnuggleInput.InputType.FILE, null
otherwise. |
String |
getIdentifier()
Returns the "identifier" for this input.
|
InputStream |
getInputStream()
Returns the
InputStream that provided this input if type is SnuggleInput.InputType.INPUT_STREAM, null
otherwise. |
Reader |
getReader()
Returns the
Reader that provided this input if type is SnuggleInput.InputType.READER, null
otherwise. |
String |
getString()
Returns the String that provided this input if type is
SnuggleInput.InputType.STRING, null
otherwise. |
SnuggleInput.InputType |
getType()
Returns the "type" of input, represented by an instance of the
SnuggleInput.InputType enumeration. |
URI |
getURI()
Returns an (optional) URI for this input.
|
void |
setEncoding(String encoding) |
void |
setIdentifier(String identifier)
Sets the "identifier" for this input.
|
void |
setURI(URI uri)
Sets a URI for this input.
|
String |
toString() |
public SnuggleInput(String string)
public SnuggleInput(File file)
public SnuggleInput(InputStream inputStream)
public SnuggleInput(InputStream inputStream, String identifier)
public SnuggleInput(InputStream inputStream, String identifier, String encoding)
public SnuggleInput(Reader reader)
public SnuggleInput.InputType getType()
SnuggleInput.InputType enumeration.public String getIdentifier()
public void setIdentifier(String identifier)
identifier - new identifier, which may be null.public URI getURI()
SnuggleInputs.public void setURI(URI uri)
SnuggleInputs.uri - URI for this input, which may be null.public String getEncoding()
public void setEncoding(String encoding)
public String getString()
SnuggleInput.InputType.STRING, null
otherwise.public File getFile()
File that provided this input if type is SnuggleInput.InputType.FILE, null
otherwise.public InputStream getInputStream()
InputStream that provided this input if type is SnuggleInput.InputType.INPUT_STREAM, null
otherwise.public Reader getReader()
Reader that provided this input if type is SnuggleInput.InputType.READER, null
otherwise.Copyright © 2008–2026 The University of Edinburgh. All rights reserved.