ix.util.xml
Class AbstractFileSyntax
java.lang.Object
ix.util.xml.AbstractFileSyntax
- All Implemented Interfaces:
- FileSyntax, Loader, Saver
- Direct Known Subclasses:
- FileSyntax.RDFFiles, FileSyntax.XMLFiles, Ip2XMLConfig.ChecklistFiles, Ip2XMLConfig.HtmlFiles, Ip2XMLConfig.InitFiles, Ip2XMLConfig.LPADFiles, Ip2XMLConfig.LTFFiles, Ip2XMLConfig.OwlSFiles, Ip2XMLConfig.TextFiles, Ip2XMLConfig.TFFiles
public abstract class AbstractFileSyntax
- extends java.lang.Object
- implements FileSyntax
Convenient base class for FileSyntax
es.
Field Summary |
static java.util.List |
ANY_CLASS
|
Method Summary |
boolean |
canRead()
Is reading supported? |
boolean |
canWrite()
Is writing supported? |
protected boolean |
existsClass(java.lang.String className)
|
boolean |
isAvailable()
Indicates whether this syntax can be used. |
protected java.lang.Object |
makeInstance(java.lang.String className)
|
java.util.List |
readableClasses()
The classes whose instances can be read in. |
java.lang.Object |
readObject(java.net.URL url)
|
java.lang.String |
toString()
|
java.util.List |
writableClasses()
The classes whose instances can be written out. |
void |
writeObject(java.lang.Object obj,
java.io.File file)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ANY_CLASS
public static final java.util.List ANY_CLASS
AbstractFileSyntax
public AbstractFileSyntax()
isAvailable
public boolean isAvailable()
- Description copied from interface:
FileSyntax
- Indicates whether this syntax can be used. Some syntaxes rely
on classes that are not always present in the class-path.
- Specified by:
isAvailable
in interface FileSyntax
canRead
public boolean canRead()
- Description copied from interface:
FileSyntax
- Is reading supported?
- Specified by:
canRead
in interface FileSyntax
canWrite
public boolean canWrite()
- Description copied from interface:
FileSyntax
- Is writing supported?
- Specified by:
canWrite
in interface FileSyntax
readableClasses
public java.util.List readableClasses()
- Description copied from interface:
FileSyntax
- The classes whose instances can be read in. General-purpose
syntaxes can read (at least) instances of every class that
has a
ClassSyntax
. They can return
a list containing only Object.class.
- Specified by:
readableClasses
in interface FileSyntax
writableClasses
public java.util.List writableClasses()
- Description copied from interface:
FileSyntax
- The classes whose instances can be written out. General-purpose
syntaxes can write (at least) instances of every class that
has a
ClassSyntax
. They can return
a list containing only Object.class.
- Specified by:
writableClasses
in interface FileSyntax
readObject
public java.lang.Object readObject(java.net.URL url)
throws java.io.IOException
- Specified by:
readObject
in interface Loader
- Throws:
java.io.IOException
writeObject
public void writeObject(java.lang.Object obj,
java.io.File file)
throws java.io.IOException
- Specified by:
writeObject
in interface Saver
- Throws:
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
existsClass
protected boolean existsClass(java.lang.String className)
makeInstance
protected java.lang.Object makeInstance(java.lang.String className)