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

java.lang.Object
  extended by org.inria.ns.reflex.util.Key
      extended by org.inria.ns.reflex.processor.catalog.CatalogKey
          extended by org.inria.ns.reflex.processor.catalog.ExternalIdentifierKey

public class ExternalIdentifierKey
extends CatalogKey

An ExternalIdentifierKey is either a public identifier, or a system identifier, or both.

Author:
Philippe Poulard

Field Summary
 
Fields inherited from class org.inria.ns.reflex.util.Key
hash, name, type
 
Constructor Summary
ExternalIdentifierKey(String publicId, XFile systemId, boolean preferPublic)
          Construct a new key for an external identifier.
 
Method Summary
 void exportTo(DataSet dataSet)
          Create a set of properties in a target data set.
 Object getPreferredAsString()
          Return the preferred mode.
 URI getPublicId()
          Return the public ID.
 QName getSelector()
          Return the selector of this key.
 XFile getSystemId()
          Return the system ID.
 boolean preferPublic()
          Indicates if public identifiers are preferred or not.
 void preferPublic(boolean preferPublic)
          Set the current prefer mode.
 String toString()
          Return the string representation of this identifier.
 
Methods inherited from class org.inria.ns.reflex.util.Key
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExternalIdentifierKey

public ExternalIdentifierKey(String publicId,
                             XFile systemId,
                             boolean preferPublic)
Construct a new key for an external identifier. At least one of the parameters must be not null.

Parameters:
publicId - The public identifier. May be null.
systemId - The system identifier. May be null.
preferPublic - true if public identifiers are preferred, false otherwise.
Method Detail

getPublicId

public URI getPublicId()
Return the public ID.

Returns:
The public ID.

getSystemId

public XFile getSystemId()
Return the system ID.

Returns:
The system ID.

preferPublic

public boolean preferPublic()
Indicates if public identifiers are preferred or not.

Returns:
true if public identifiers are preferred, false otherwise.

preferPublic

public void preferPublic(boolean preferPublic)
Set the current prefer mode.

Parameters:
preferPublic - true if public identifiers are preferred, false otherwise.

toString

public String toString()
Return the string representation of this identifier.

Overrides:
toString in class Key
Returns:
The public ID or system ID, according to what is preferred.
See Also:
Object.toString()

exportTo

public void exportTo(DataSet dataSet)
Create a set of properties in a target data set.
NameValue
$cat:system-idThe system ID
$cat:public-idThe public ID
$cat:prefer"public" or "system"
$cat:selectorxml:external-identifier

Specified by:
exportTo in class CatalogKey
Parameters:
dataSet - The target data set.
See Also:
CatalogKey.exportTo(org.inria.ns.reflex.processor.DataSet)

getPreferredAsString

public Object getPreferredAsString()
Return the preferred mode.

Returns:
"public" or "system"

getSelector

public QName getSelector()
Return the selector of this key.

Specified by:
getSelector in class CatalogKey
Parameters:
xml:external-identifier. -
Returns:
The selector.
See Also:
CatalogKey.getSelector()