Package uk.ac.starlink.util
Class StarEntityResolver
java.lang.Object
uk.ac.starlink.util.StarEntityResolver
- All Implemented Interfaces:
EntityResolver
Provides specialised XML entity resolution.
This resolver knows about some entities which starjava applications
are likely to want to retrieve; it keeps copies of them so that
no network connection is required for them.
Use getInstance()
to obtain an instance of this class without
a parent.
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionStarEntityResolver
(EntityResolver parent) Constructs a resolver which will resolve entities this class knows about, and for those it doesn't it will defer resolution to a supplied parent resolver. -
Method Summary
Modifier and TypeMethodDescriptionstatic StarEntityResolver
Returns the sole instance of this class.protected String
getLocalResource
(String publicId, String systemId) Returns a resource name locating the entity referenced by a given public/system ID pair.resolveEntity
(String publicId, String systemId) Resolves an entity if it is one of the ones that we keep on hand.
-
Constructor Details
-
StarEntityResolver
Constructs a resolver which will resolve entities this class knows about, and for those it doesn't it will defer resolution to a supplied parent resolver.- Parameters:
parent
- fallback resolver (may be null)
-
-
Method Details
-
getInstance
Returns the sole instance of this class.- Returns:
- StarEntityResolver instance
-
resolveEntity
Resolves an entity if it is one of the ones that we keep on hand.- Specified by:
resolveEntity
in interfaceEntityResolver
- Throws:
SAXException
IOException
-
getLocalResource
Returns a resource name locating the entity referenced by a given public/system ID pair. If there is a local copy of this entity, its path relative to this class is returned, otherwise null is returned.- Parameters:
publicId
- the entity's public IDsystemId
- the entity's system ID- Returns:
- path to the resource, or null if it is unknown
-