org.inria.ns.reflex.processor.catalog
Class CatalogParser

java.lang.Object
  extended by org.inria.ns.reflex.processor.catalog.CatalogParser

public class CatalogParser
extends Object

CatalogParser parses an input to a Catalog.

Author:
Philippe Poulard

Method Summary
static Catalog parseCatalog(Document catalog)
          Parses a catalog.
static Catalog parseCatalog(InputStream catalog)
          Parses a catalog.
static Catalog parseCatalog(Reader catalog)
          Parses a catalog.
static Catalog parseCatalog(XFile catalog)
          Parses a catalog.
static Catalog parseCatalog(XFile base, InputSource catalog)
          Parses a catalog.
static Catalog parseCatalog(XFile base, Object catalog)
          Parses a catalog.
static Catalog parseCatalog(XFile base, String catalog)
          Parses a catalog.
static Catalog parseCatalog(XFile base, URI catalog)
          Parses a catalog.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseCatalog

public static Catalog parseCatalog(Document catalog)
                            throws BadCatalogFormatException
Parses a catalog.

Parameters:
catalog - The XML catalog to parse.
Returns:
A Catalog object.
Throws:
BadCatalogFormatException - When the input is not a catalog, or in a catalog format unknown.

parseCatalog

public static Catalog parseCatalog(InputStream catalog)
                            throws BadCatalogFormatException
Parses a catalog.

Parameters:
catalog - The input stream to parse.
Returns:
A Catalog object.
Throws:
BadCatalogFormatException - When the input is not a catalog, or in a catalog format unknown.

parseCatalog

public static Catalog parseCatalog(Reader catalog)
                            throws BadCatalogFormatException
Parses a catalog.

Parameters:
catalog - The character stream to parse.
Returns:
A Catalog object.
Throws:
BadCatalogFormatException - When the input is not a catalog, or in a catalog format unknown.

parseCatalog

public static Catalog parseCatalog(XFile base,
                                   InputSource catalog)
                            throws BadCatalogFormatException
Parses a catalog.

Parameters:
base - The base used to resolve the catalog, if it is a relative file, or null.
catalog - The input source to parse.
Returns:
A Catalog object.
Throws:
BadCatalogFormatException - When the input is not a catalog, or in a catalog format unknown.

parseCatalog

public static Catalog parseCatalog(XFile base,
                                   String catalog)
                            throws BadCatalogFormatException
Parses a catalog.

Parameters:
base - The base used to resolve the catalog, if it is a relative file, or null.
catalog - The name of the file of the catalog to parse.
Returns:
A Catalog object.
Throws:
BadCatalogFormatException - When the input is not a catalog, or in a catalog format unknown.

parseCatalog

public static Catalog parseCatalog(XFile base,
                                   URI catalog)
                            throws BadCatalogFormatException
Parses a catalog.

Parameters:
base - The base used to resolve the catalog, if it is a relative file, or null.
catalog - The URI of the catalog to parse.
Returns:
A Catalog object.
Throws:
BadCatalogFormatException - When the input is not a catalog, or in a catalog format unknown.

parseCatalog

public static Catalog parseCatalog(XFile catalog)
                            throws BadCatalogFormatException
Parses a catalog.

Parameters:
catalog - The catalog file to parse.
Returns:
A Catalog object.
Throws:
BadCatalogFormatException - When the input is not a catalog, or in a catalog format unknown.

parseCatalog

public static Catalog parseCatalog(XFile base,
                                   Object catalog)
                            throws BadCatalogFormatException
Parses a catalog. This method invokes one of the other static methods according to the object type.

Parameters:
base - The base used to resolve the catalog, if it is a relative file, or null.
catalog - The catalog to parse, that can be a file name, an URI, a file, an XML document, or an input stream.
Returns:
A Catalog object, or null.
Throws:
BadCatalogFormatException - When the input is not a catalog, or in a catalog format unknown.