Top Description Inners Fields Constructors Methods
javax.xml.catalog

pack-priv Class GroupEntry

extends BaseEntry
Class Inheritance
Known Direct Subclasses
javax.xml.catalog.CatalogEntry, javax.xml.catalog.CatalogImpl
Imports
java.net.URI, java.util.ArrayList, .HashMap, .List, .Map

Represents a group entry.
Since
9

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
GroupEntry.PreferType

PreferType represents possible values of the prefer property

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv CatalogImpl
pack-priv List<String>
pack-priv Map<String, CatalogImpl>
pack-priv List<BaseEntry>
pack-priv CatalogFeatures
pack-priv boolean
pack-priv boolean
pack-priv Map<String, CatalogImpl>
pack-priv int
pack-priv int
pack-priv CatalogImpl
pack-priv String
pack-priv boolean
pack-priv String
pack-priv boolean
Inherited from javax.xml.catalog.BaseEntry:
baseSpecifiedbaseURIidmatchIdSLASHtype

Constructor Summary

AccessConstructor and Description
public
GroupEntry(BaseEntry.CatalogEntryType
the type of the entry
type
,
CatalogImpl
the parent Catalog
parent
)

Constructs a GroupEntry

public
GroupEntry(String
The baseURI attribute
base
,
String...
The attributes
attributes
)

Constructs a group entry.

public
GroupEntry(CatalogImpl
the catalog this GroupEntry belongs to
catalog
,
String
the baseURI attribute
base
,
String...
the attributes
attributes
)

Constructs a group entry.

Method Summary

Modifier and TypeMethod and Description
public void
addEntry(BaseEntry
The entry to be added.
entry
)

Adds an entry.

pack-priv CatalogImpl

Returns:

a Catalog object previously loaded, or null if none in the saved list
getLoadedCatalog
(String
The systemId of a catalog
catalogId
)

Returns a previously loaded Catalog object if found.

pack-priv boolean

Returns:

true if is circular, false otherwise
isCircular
(CatalogImpl
the parent of the catalog to be loaded
parent
,
String
the system identifier of the catalog to be loaded
systemId
)

Checks whether the catalog is circularly referenced

public boolean

Returns:

true if the prefer attribute is set to system, false if not.
isPreferPublic
()

Queries the prefer attribute

pack-priv Catalog
loadDelegateCatalog(CatalogImpl
the parent catalog of the delegate catalog
parent
,
URI
the URI to the catalog
catalogURI
)

Loads a delegate catalog by the catalogId specified.

pack-priv void
loadDelegateCatalogs(CatalogImpl
the parent catalog of the delegate catalogs
parent
)

Loads all delegate catalogs.

private String

Returns:

the URI string if a mapping is found, or null otherwise.
matchDelegate
(BaseEntry.CatalogEntryType
the type of the Catalog entry
type
,
String
the system or public id to be matched
id
)

Matches delegatePublic or delegateSystem against the specified id

public String

Returns:

a URI string if a mapping is found, or null otherwise.
matchPublic
(String
The public identifier of the external entity being referenced.
publicId
)

Attempt to find a matching entry in the catalog by publicId.

public String

Returns:

a URI string if a mapping is found, or null otherwise.
matchSystem
(String
The system identifier of the external entity being referenced.
systemId
)

Attempt to find a matching entry in the catalog by systemId.

public String

Returns:

a URI string if a mapping is found, or null otherwise.
matchURI
(String
The URI reference of a resource.
uri
)

Attempt to find a matching entry in the catalog by the uri element.

public void
reset()

Resets the group entry to its initial state.

private void
resetOnStart()

Resets the state of the Catalog instance, allowing it to be reused.

pack-priv String

Returns:

the resolved systemId if a match is found, null otherwise
resolve
(String
The public identifier of the external entity being referenced.
publicId
,
String
The system identifier of the external entity being referenced.
systemId
)

Attempt to find a matching entry in the catalog by publicId or systemId.

pack-priv void
setCatalog(CatalogImpl
the catalog this GroupEntry belongs to
catalog
)

Sets the catalog for this GroupEntry.

public final void
setPrefer(String
The value of the prefer attribute
value
)

Sets the prefer property.

pack-priv final boolean

Returns:

true if the catalogId passed verification, false otherwise
verifyCatalogFile
(CatalogImpl
the parent of the catalog to be loaded
parent
,
URI
the URI to the catalog
catalogURI
)

Verifies that the catalog file represented by the catalogId exists.

Inherited from javax.xml.catalog.BaseEntry:
getBaseURIgetIdgetMatchIdgetTypematchmatchsetBaseURIsetIdsetMatchIdsetTypeverifyURI

Field Detail

ATTRIBUTE_DEFFERback to summary
pack-priv static final int ATTRIBUTE_DEFFER
ATTRIBUTE_PREFERback to summary
pack-priv static final int ATTRIBUTE_PREFER
ATTRIBUTE_RESOLUTIONback to summary
pack-priv static final int ATTRIBUTE_RESOLUTION
catalogback to summary
pack-priv CatalogImpl catalog
catalogsSearchedback to summary
pack-priv List<String> catalogsSearched
delegateCatalogsback to summary
pack-priv Map<String, CatalogImpl> delegateCatalogs
entriesback to summary
pack-priv List<BaseEntry> entries
featuresback to summary
pack-priv CatalogFeatures features
isInstantMatchback to summary
pack-priv boolean isInstantMatch
isPreferPublicback to summary
pack-priv boolean isPreferPublic
loadedCatalogsback to summary
pack-priv Map<String, CatalogImpl> loadedCatalogs
longestRewriteMatchback to summary
pack-priv int longestRewriteMatch
longestSuffixMatchback to summary
pack-priv int longestSuffixMatch
parentback to summary
pack-priv CatalogImpl parent
rewriteMatchback to summary
pack-priv String rewriteMatch
shouldKeepStateback to summary
pack-priv boolean shouldKeepState
suffixMatchback to summary
pack-priv String suffixMatch
systemEntrySearchedback to summary
pack-priv boolean systemEntrySearched

Constructor Detail

GroupEntryback to summary
public GroupEntry(BaseEntry.CatalogEntryType type, CatalogImpl parent)

Constructs a GroupEntry

Parameters
type:BaseEntry.CatalogEntryType

the type of the entry

parent:CatalogImpl

the parent Catalog

GroupEntryback to summary
public GroupEntry(String base, String... attributes)

Constructs a group entry.

Parameters
base:String

The baseURI attribute

attributes:String[]

The attributes

GroupEntryback to summary
public GroupEntry(CatalogImpl catalog, String base, String... attributes)

Constructs a group entry.

Parameters
catalog:CatalogImpl

the catalog this GroupEntry belongs to

base:String

the baseURI attribute

attributes:String[]

the attributes

Method Detail

addEntryback to summary
public void addEntry(BaseEntry entry)

Adds an entry.

Parameters
entry:BaseEntry

The entry to be added.

getLoadedCatalogback to summary
pack-priv CatalogImpl getLoadedCatalog(String catalogId)

Returns a previously loaded Catalog object if found.

Parameters
catalogId:String

The systemId of a catalog

Returns:CatalogImpl

a Catalog object previously loaded, or null if none in the saved list

isCircularback to summary
pack-priv boolean isCircular(CatalogImpl parent, String systemId)

Checks whether the catalog is circularly referenced

Parameters
parent:CatalogImpl

the parent of the catalog to be loaded

systemId:String

the system identifier of the catalog to be loaded

Returns:boolean

true if is circular, false otherwise

isPreferPublicback to summary
public boolean isPreferPublic()

Queries the prefer attribute

Returns:boolean

true if the prefer attribute is set to system, false if not.

loadDelegateCatalogback to summary
pack-priv Catalog loadDelegateCatalog(CatalogImpl parent, URI catalogURI)

Loads a delegate catalog by the catalogId specified.

Parameters
parent:CatalogImpl

the parent catalog of the delegate catalog

catalogURI:URI

the URI to the catalog

loadDelegateCatalogsback to summary
pack-priv void loadDelegateCatalogs(CatalogImpl parent)

Loads all delegate catalogs.

Parameters
parent:CatalogImpl

the parent catalog of the delegate catalogs

matchDelegateback to summary
private String matchDelegate(BaseEntry.CatalogEntryType type, String id)

Matches delegatePublic or delegateSystem against the specified id

Parameters
type:BaseEntry.CatalogEntryType

the type of the Catalog entry

id:String

the system or public id to be matched

Returns:String

the URI string if a mapping is found, or null otherwise.

matchPublicback to summary
public String matchPublic(String publicId)

Attempt to find a matching entry in the catalog by publicId.

The method searches through the public-type entries, including public, delegatePublic, and group entries in the current catalog in order to find a match.

Parameters
publicId:String

The public identifier of the external entity being referenced.

Returns:String

a URI string if a mapping is found, or null otherwise.

matchSystemback to summary
public String matchSystem(String systemId)

Attempt to find a matching entry in the catalog by systemId.

The method searches through the system-type entries, including system, rewriteSystem, systemSuffix, delegateSystem, and group entries in the current catalog in order to find a match.

Parameters
systemId:String

The system identifier of the external entity being referenced.

Returns:String

a URI string if a mapping is found, or null otherwise.

matchURIback to summary
public String matchURI(String uri)

Attempt to find a matching entry in the catalog by the uri element.

The method searches through the uri-type entries, including uri, rewriteURI, uriSuffix, delegateURI and group entries in the current catalog in order to find a match.

Parameters
uri:String

The URI reference of a resource.

Returns:String

a URI string if a mapping is found, or null otherwise.

resetback to summary
public void reset()

Resets the group entry to its initial state.

resetOnStartback to summary
private void resetOnStart()

Resets the state of the Catalog instance, allowing it to be reused.

resolveback to summary
pack-priv String resolve(String publicId, String systemId)

Attempt to find a matching entry in the catalog by publicId or systemId.

The resolution follows the following rules determined by the prefer setting: prefer "system": attempts to resolve with a system entry; attempts to resolve with a public entry when only publicId is specified. prefer "public": attempts to resolve with a system entry; attempts to resolve with a public entry if no matching system entry is found. If no match is found, continue searching uri entries.

Parameters
publicId:String

The public identifier of the external entity being referenced.

systemId:String

The system identifier of the external entity being referenced.

Returns:String

the resolved systemId if a match is found, null otherwise

setCatalogback to summary
pack-priv void setCatalog(CatalogImpl catalog)

Sets the catalog for this GroupEntry.

Parameters
catalog:CatalogImpl

the catalog this GroupEntry belongs to

setPreferback to summary
public final void setPrefer(String value)

Sets the prefer property. If the value is null or empty, or any String other than the defined, it will be assumed as the default value.

Parameters
value:String

The value of the prefer attribute

verifyCatalogFileback to summary
pack-priv final boolean verifyCatalogFile(CatalogImpl parent, URI catalogURI)

Verifies that the catalog file represented by the catalogId exists. If it doesn't, returns false to ignore it as specified in the Catalog specification, section 8. Resource Failures.

Verifies that the catalog represented by the catalogId has not been searched or is not circularly referenced.

Parameters
parent:CatalogImpl

the parent of the catalog to be loaded

catalogURI:URI

the URI to the catalog

Returns:boolean

true if the catalogId passed verification, false otherwise

Exceptions
CatalogException:
if circular reference is found.
javax.xml.catalog back to summary

public final Enum GroupEntry.PreferType

extends Enum<GroupEntry.PreferType>
Class Inheritance

PreferType represents possible values of the prefer property

Field Summary

Modifier and TypeField and Description
pack-priv final String
public static final GroupEntry.PreferType
public static final GroupEntry.PreferType

Constructor Summary

AccessConstructor and Description
private
PreferType(String literal)

Method Summary

Modifier and TypeMethod and Description
public boolean
prefer(String prefer)

public static GroupEntry.PreferType
public static GroupEntry.PreferType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

literalback to summary
pack-priv final String literal
PUBLICback to summary
public static final GroupEntry.PreferType PUBLIC
SYSTEMback to summary
public static final GroupEntry.PreferType SYSTEM

Constructor Detail

PreferTypeback to summary
private PreferType(String literal)

Method Detail

preferback to summary
public boolean prefer(String prefer)
valueOfback to summary
public static GroupEntry.PreferType valueOf(String name)
valuesback to summary
public static GroupEntry.PreferType[] values()