|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.tm4j.net.LocatorBase
An abstract base class implementing the Locator interface.
| Field Summary | |
protected java.lang.String |
m_address
The address of the resource which this locator represents. |
protected LocatorFactory |
m_factory
The locator factory associated with this locator. |
protected java.lang.String |
m_notation
This locator's notation. |
| Constructor Summary | |
LocatorBase()
Creates an empty, uninitialized locator. |
|
LocatorBase(Locator loc)
Creates a locator from the given template, copying the original locator's notation and address. |
|
LocatorBase(LocatorFactory factory)
Creates a new locator and associates it with the given factory. |
|
LocatorBase(LocatorFactory factory,
java.lang.String notation,
java.lang.String address)
Creates a complete, initialized locator. |
|
| Method Summary | |
java.lang.String |
getAddress()
Gets the address associated with the locator |
LocatorFactory |
getFactory()
Returns the locator factory associated with this locator. |
java.lang.String |
getNotation()
Gets the string defining the notation type of this locator |
void |
initialise(java.lang.String notation,
java.lang.String address)
Initializes the locator with the specified notation and address. |
abstract boolean |
isSupportedNotation(java.lang.String notation)
Determines whether the locator implementation supports the specified notation. |
abstract java.lang.String |
normalizeAddress(java.lang.String address)
Returns a normalized representation of the locator's address. |
void |
setFactory(LocatorFactory factory)
Associates the locator with the given factory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.tm4j.net.Locator |
copy, equals, hashCode, resolveRelative, resolveRelative |
| Field Detail |
protected java.lang.String m_notation
protected java.lang.String m_address
protected LocatorFactory m_factory
| Constructor Detail |
public LocatorBase()
public LocatorBase(LocatorFactory factory,
java.lang.String notation,
java.lang.String address)
throws InvalidNotationException,
MalformedLocatorException
LocatorFactory.
factory - the factory which creates the locator.notation - the locator's notation.address - the address of the resource which this
locator represents.
InvalidNotationException - if the locator implementation
does not support the given notation.
MalformedLocatorException - if the address cannot be normalized.public LocatorBase(LocatorFactory factory)
LocatorFactory and leaves the locator uninitialized.
The factory class should subsequently invoke
initialise(String, String).
factory - the factory which creates the locator.
public LocatorBase(Locator loc)
throws InvalidNotationException,
MalformedLocatorException
loc - the locator to be copied
InvalidNotationException - if the locator implementation
does not support the given notation.
MalformedLocatorException - if the address cannot be normalized.| Method Detail |
public void setFactory(LocatorFactory factory)
LocatorLocatorFactory.
setFactory in interface Locatorfactory - the factory to be associated with the locator.public LocatorFactory getFactory()
Locator
getFactory in interface Locator
public void initialise(java.lang.String notation,
java.lang.String address)
throws InvalidNotationException,
MalformedLocatorException
Locator
initialise in interface Locatornotation - the notation to be used for this locator.address - the address to be defined by this locator.
MalformedLocatorException - if the implementation failed to
parse the given address.
InvalidNotationException - if the implementation does not
support the specified notation type.public java.lang.String getAddress()
Locator
getAddress in interface Locatorpublic java.lang.String getNotation()
Locator
getNotation in interface Locatorpublic abstract boolean isSupportedNotation(java.lang.String notation)
notation - the notation identifier to check for.
true if notation represents
a locator notation supported by the implementing class,
false otherwise.
public abstract java.lang.String normalizeAddress(java.lang.String address)
throws MalformedLocatorException
address - a generic string address that the implementation
should normalize in the context it sees fit.
MalformedLocatorException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||