Package org.xmlresolver.loaders
Class XmlLoader
- java.lang.Object
-
- org.xmlresolver.loaders.XmlLoader
-
- All Implemented Interfaces:
CatalogLoader
public class XmlLoader extends java.lang.Object implements CatalogLoader
An XML catalog loader.This loader understands the XML Catalogs 1.1 specification XML catalog syntax.
-
-
Constructor Summary
Constructors Constructor Description XmlLoader(ResolverConfiguration config)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetArchivedCatalogs()Return whether or not archived catalogs are allowed.static ResolvergetLoaderResolver()booleangetPreferPublic()Return the current "prefer public" status.org.xmlresolver.catalog.entry.EntryCatalogloadCatalog(java.net.URI catalog)Load the specified catalog.org.xmlresolver.catalog.entry.EntryCatalogloadCatalog(java.net.URI catalog, org.xml.sax.InputSource source)Load the specified catalog from a given input source.voidsetArchivedCatalogs(boolean allow)Allow archived catalogs on the catalog path.voidsetPreferPublic(boolean prefer)Set the default "prefer public" status for this catalog.
-
-
-
Constructor Detail
-
XmlLoader
public XmlLoader(ResolverConfiguration config)
-
-
Method Detail
-
setPreferPublic
public void setPreferPublic(boolean prefer)
Set the default "prefer public" status for this catalog.- Specified by:
setPreferPublicin interfaceCatalogLoader- Parameters:
prefer- True if public identifiers are to be preferred.
-
getPreferPublic
public boolean getPreferPublic()
Return the current "prefer public" status.- Specified by:
getPreferPublicin interfaceCatalogLoader- Returns:
- The current "prefer public" status of this catalog loader.
-
setArchivedCatalogs
public void setArchivedCatalogs(boolean allow)
Description copied from interface:CatalogLoaderAllow archived catalogs on the catalog path.If allowed, then ZIP files may be specified as catalogs. The loader will return the catalog associated with the
/catalog.xmlor/org/xmlresolver/catalog.xmlwithin the ZIP file.- Specified by:
setArchivedCatalogsin interfaceCatalogLoader- Parameters:
allow- True if archived catalogs are to be allowed.
-
getArchivedCatalogs
public boolean getArchivedCatalogs()
Description copied from interface:CatalogLoaderReturn whether or not archived catalogs are allowed.- Specified by:
getArchivedCatalogsin interfaceCatalogLoader- Returns:
- True if archived catalogs are allowed.
-
getLoaderResolver
public static Resolver getLoaderResolver()
-
loadCatalog
public org.xmlresolver.catalog.entry.EntryCatalog loadCatalog(java.net.URI catalog)
Description copied from interface:CatalogLoaderLoad the specified catalog.The manager maintains a set of the catalogs that it has loaded. If an attempt is made to load a catalog twice, the previously loaded catalog is returned.
- Specified by:
loadCatalogin interfaceCatalogLoader- Parameters:
catalog- The catalog URI.- Returns:
- The parsed catalog.
-
loadCatalog
public org.xmlresolver.catalog.entry.EntryCatalog loadCatalog(java.net.URI catalog, org.xml.sax.InputSource source)Load the specified catalog from a given input source.This method exists so that a catalog can be loaded even if it doesn't have a URI that can be dereferenced. It must still have a URI.
The manager maintains a set of the catalogs that it has loaded. If an attempt is made to load a catalog twice, the previously loaded catalog is returned.
- Specified by:
loadCatalogin interfaceCatalogLoader- Parameters:
catalog- The catalog URI.source- The input source.- Returns:
- The parsed catalog.
-
-