|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ckkloverdos.source.SourceSkeleton
public abstract class SourceSkeleton
Basic, InputStream
- based implementation of ISource
,
intended to be subclassed.
Field Summary | |
---|---|
protected java.io.InputStream |
is
|
protected java.lang.String |
name
|
protected SourceType |
type
|
protected boolean |
valid
|
Constructor Summary | |
---|---|
protected |
SourceSkeleton()
|
protected |
SourceSkeleton(java.lang.String name,
SourceType type,
java.io.InputStream is)
|
Method Summary | |
---|---|
java.lang.String |
getDescription()
Return the description of this source. |
java.io.InputStream |
getInputStream()
Get an input stream for this source. |
java.lang.String |
getName()
Return the name of this source. |
java.io.Reader |
getReader()
Get a reader for the contents of this source. |
java.io.Reader |
getReader(java.lang.String encoding)
Get a reader for the contents of this source. |
java.lang.String |
getString()
Get a string from the contents of this source. |
java.lang.String |
getString(java.lang.String encoding)
Get a string from the contents of this source. |
SourceType |
getType()
Return the type of this source. |
boolean |
isText()
Return true if the type of this source is text . |
boolean |
isValid()
Return true iff any of the ISource.getInputStream() ,
ISource.getString() , ISource.getReader() methods will return
a non-null object. |
protected void |
setInputStream(java.io.InputStream is)
|
protected void |
setName(java.lang.String name)
|
protected void |
setType(SourceType type)
|
protected void |
setValid(boolean valid)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected SourceType type
protected java.io.InputStream is
protected boolean valid
Constructor Detail |
---|
protected SourceSkeleton()
protected SourceSkeleton(java.lang.String name, SourceType type, java.io.InputStream is)
Method Detail |
---|
public boolean isValid()
ISource
true
iff any of the ISource.getInputStream()
,
ISource.getString()
, ISource.getReader()
methods will return
a non-null
object.
isValid
in interface ISource
public java.lang.String getName()
ISource
getName
in interface ISource
public java.lang.String getDescription()
ISource
getDescription
in interface ISource
public SourceType getType()
ISource
type
of this source.
getType
in interface ISource
public java.io.InputStream getInputStream() throws java.io.IOException
ISource
getInputStream
in interface ISource
java.io.IOException
public boolean isText()
ISource
true
if the type of this source is text
.
isText
in interface ISource
true
iff getType().isText()
returns true
.public java.lang.String getString() throws java.io.IOException
ISource
StringUtil.UTF8
encoding.
getString
in interface ISource
java.io.IOException
public java.io.Reader getReader() throws java.io.IOException
ISource
StringUtil.UTF8
encoding.
getReader
in interface ISource
java.io.IOException
public java.lang.String getString(java.lang.String encoding) throws java.io.IOException
ISource
encoding
.
getString
in interface ISource
java.io.IOException
public java.io.Reader getReader(java.lang.String encoding) throws java.io.IOException
ISource
encoding
.
getReader
in interface ISource
java.io.IOException
protected void setValid(boolean valid)
protected void setInputStream(java.io.InputStream is)
protected void setName(java.lang.String name)
protected void setType(SourceType type)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |