|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.cog.CogXmlLib
public class CogXmlLib
Convenience methods for reading and writing Cogs as XML.
There are a good number of methods here, but they follow a common pattern:
The difference between "Cog" and "Object" methods is that "Cog" methods read or write directly from Cog structures, while "Object" methods convert Coggables to/from Cog structures first. Generally an "Object" method will call the corresponding "Cog" method with this converted Cog structure.
Otherwise the methods only differ in terms of source or destination - streams, Strings, Files, VfsFiles, and Preferences are all supported.
One exception is the writeCogToString/readCogFromString/writeObjectToString/readObjectFromString methods. The syntax for these differs from the others so it seemed worth having different nomenclature.
Copyright 2003-2009 Partner Software, Inc.
| Method Summary | |
|---|---|
static Cog |
readCogFrom(java.io.File file)
Reads a cog in XML format from the given File. |
static Cog |
readCogFrom(java.util.prefs.Preferences preferences)
Read the cog in XML format from a Preferences node. |
static Cog |
readCogFrom(java.io.Reader reader,
java.lang.String context)
Reads a cog in XMl format from the given Reader. |
static Cog |
readCogFrom(VfsFile file)
Reads a cog in XML format from the given File. |
static Cog |
readCogFromString(java.lang.String xmlString)
Reads a cog from the given XML string. |
static java.lang.String |
readCogTypeFrom(VfsFile file)
Reads just the cog type name from the given VfsFile. |
static java.lang.Object |
readObjectFrom(java.io.File file)
Reads a Coggable object from the given File in XML format. |
static java.lang.Object |
readObjectFrom(java.io.File file,
CogSchema schema)
Reads a Coggable object from the given File using the given schema. |
static java.lang.Object |
readObjectFrom(java.util.prefs.Preferences preferences)
Reads a Coggable object from a Preferences node. |
static java.lang.Object |
readObjectFrom(java.util.prefs.Preferences preferences,
CogSchema schema)
Reads a Coggable object from a Preferences node, converting using the given schema. |
static java.lang.Object |
readObjectFrom(java.io.Reader reader,
java.lang.String context)
Reads a Coggable object from the given reader in XML format. |
static java.lang.Object |
readObjectFrom(java.io.Reader reader,
java.lang.String context,
CogSchema schema)
Reads a Coggable object from the given Reader using the given schema. |
static java.lang.Object |
readObjectFrom(VfsFile file)
Reads a Coggable object from the given VfsFile in XML format. |
static java.lang.Object |
readObjectFrom(VfsFile file,
CogSchema schema)
Reads a Coggable object from the given VfsFile using the given schema. |
static java.lang.Object |
readObjectFromString(java.lang.String xmlString)
Reads a Coggable object from the given XML string. |
static java.lang.Object |
readObjectFromString(java.lang.String xmlString,
CogSchema schema)
Reads a Coggable object from the given XML string. |
static Naming<java.lang.Object> |
readObjectsFrom(VfsDirectory directory,
CogSchema schema)
Reads a Naming of objects from the given directory containing one XML file per object. |
static CogSchema |
readSchemaFrom(VfsDirectory directory)
Reads a schema from the given directory containing one XML file per type. |
static void |
writeCogTo(Cog cog,
java.io.File file)
Writes the given cog to the given file in XML format. |
static void |
writeCogTo(Cog cog,
java.util.prefs.Preferences prefs)
Writes a Cog to a Preferences node. |
static void |
writeCogTo(Cog cog,
VfsFile file)
Writes the given cog to the given VfsFile in XML format. |
static void |
writeCogTo(Cog cog,
java.io.Writer writer)
Writes the given cog in XML format to the given writer. |
static void |
writeCogTo(Cog cog,
java.io.Writer writer,
boolean compact)
Writes the given cog in XML format to the given writer. |
static java.lang.String |
writeCogToString(Cog cog)
Returns a String representation of the given cog in XML format. |
static void |
writeObjectsTo(Naming<java.lang.Object> objects,
VfsDirectory directory)
Writes out the Naming as individual Cog XML files in the given directory. |
static void |
writeObjectTo(java.lang.Object object,
java.io.File file)
Write the given Coggable object to the given File in XML format. |
static void |
writeObjectTo(java.lang.Object object,
java.util.prefs.Preferences prefs)
Writes a Coggable object to a Preferences node. |
static void |
writeObjectTo(java.lang.Object object,
VfsFile file)
Write the given Coggable object to the given VfsFile in XML format. |
static void |
writeObjectTo(java.lang.Object object,
java.io.Writer writer)
Write the given Coggable object to the given Writer in XML format. |
static void |
writeObjectTo(java.lang.Object object,
java.io.Writer writer,
boolean compact)
Write the given Coggable object to the given Writer in XML format. |
static java.lang.String |
writeObjectToString(java.lang.Object object)
Returns a String representation of the given Coggable object out in XML format. |
static java.lang.String |
writeObjectToString(java.lang.Object object,
boolean compact)
Returns a String representation of the given Coggable object out in XML format. |
static void |
writeSchemaTo(CogSchema schema,
VfsDirectory directory)
Writes out the schema as individual type files in the given directory. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String readCogTypeFrom(VfsFile file)
public static Cog readCogFrom(java.io.File file)
throws java.io.IOException
java.io.IOException
public static Cog readCogFrom(java.util.prefs.Preferences preferences)
throws java.io.IOException
java.io.IOException
public static Cog readCogFrom(java.io.Reader reader,
java.lang.String context)
throws java.io.IOException
java.io.IOException
public static Cog readCogFrom(VfsFile file)
throws java.io.IOException
java.io.IOException
public static Cog readCogFromString(java.lang.String xmlString)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFrom(java.io.File file)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFrom(java.io.File file,
CogSchema schema)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFrom(java.util.prefs.Preferences preferences)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFrom(java.util.prefs.Preferences preferences,
CogSchema schema)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFrom(java.io.Reader reader,
java.lang.String context)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFrom(java.io.Reader reader,
java.lang.String context,
CogSchema schema)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFrom(VfsFile file)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFrom(VfsFile file,
CogSchema schema)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFromString(java.lang.String xmlString)
throws java.io.IOException
java.io.IOException
public static java.lang.Object readObjectFromString(java.lang.String xmlString,
CogSchema schema)
throws java.io.IOException
java.io.IOException
public static Naming<java.lang.Object> readObjectsFrom(VfsDirectory directory,
CogSchema schema)
throws java.io.IOException
java.io.IOException
public static CogSchema readSchemaFrom(VfsDirectory directory)
throws java.io.IOException
java.io.IOException
public static void writeCogTo(Cog cog,
java.io.File file)
throws java.io.IOException
java.io.IOException
public static void writeCogTo(Cog cog,
java.util.prefs.Preferences prefs)
throws java.io.IOException
java.io.IOException
public static void writeCogTo(Cog cog,
VfsFile file)
throws java.io.IOException
java.io.IOException
public static void writeCogTo(Cog cog,
java.io.Writer writer)
throws java.io.IOException
java.io.IOException
public static void writeCogTo(Cog cog,
java.io.Writer writer,
boolean compact)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String writeCogToString(Cog cog)
public static void writeObjectsTo(Naming<java.lang.Object> objects,
VfsDirectory directory)
throws java.io.IOException
java.io.IOException
public static void writeObjectTo(java.lang.Object object,
java.io.File file)
throws java.io.IOException
java.io.IOException
public static void writeObjectTo(java.lang.Object object,
java.util.prefs.Preferences prefs)
throws java.io.IOException
java.io.IOException
public static void writeObjectTo(java.lang.Object object,
VfsFile file)
throws java.io.IOException
object - file -
java.io.IOException
public static void writeObjectTo(java.lang.Object object,
java.io.Writer writer)
throws java.io.IOException
java.io.IOException
public static void writeObjectTo(java.lang.Object object,
java.io.Writer writer,
boolean compact)
throws java.io.IOException
java.io.IOException
public static java.lang.String writeObjectToString(java.lang.Object object)
throws java.io.IOException
java.io.IOException
public static java.lang.String writeObjectToString(java.lang.Object object,
boolean compact)
throws java.io.IOException
java.io.IOException
public static void writeSchemaTo(CogSchema schema,
VfsDirectory directory)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||