Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.tm4j.net
Interface Locator  view Locator download Locator.java

All Known Subinterfaces:
URILocator
All Known Implementing Classes:
LocatorAdapter, LocatorBase

public interface Locator

The interface to be supported by all classes implementing resolvable addresses in TM4J. A locator may be absolute or relative, and it may be resolved relative to another locator.Each locator consists of the following components:

Classes implementing Locator are usually not instantiated directly — you should resort to using LocatorFactory.createLocator(java.lang.String, java.lang.String) 55 instead. Classes implementing Locator should ensure that they provide a constructor of the signature (LocatorFactory, String, String) to allow for proper locator creation on the factory's part. LocatorBase provides such a constructor, so it's generally a good idea to extend that class rather than implement Locator directly.

Since:
0.6.0

Method Summary
 Locator copy()
          Returns a copy of this object.
 boolean equals(Locator loc)
          Determines the equality of this Locator to loc:
 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
 int hashCode()
          Returns the Locator's object hashcode.
 void initialise(java.lang.String notation, java.lang.String address)
          Initializes the locator with the specified notation and address.
 Locator resolveRelative(Locator rel)
          Returns a new Locator whose address is the result of resolving the specified Locator relative to this Locator.
 Locator resolveRelative(java.lang.String rel)
          Returns a new Locator whose address is the result of resolvng the specified relative address string relative to this Locator.
 void setFactory(LocatorFactory factory)
          Associates the locator with the given factory.
 

Method Detail

initialise

public void initialise(java.lang.String notation,
                       java.lang.String address)
                throws MalformedLocatorException,
                       InvalidNotationException
Initializes the locator with the specified notation and address. This method is commonly called by constructors.


getFactory

public LocatorFactory getFactory()
Returns the locator factory associated with this locator.


setFactory

public void setFactory(LocatorFactory factory)
Associates the locator with the given factory. Applications should ensure that this method is not invoked directly, except by factory classes implementing LocatorFactory.


getAddress

public java.lang.String getAddress()
Gets the address associated with the locator


getNotation

public java.lang.String getNotation()
Gets the string defining the notation type of this locator


resolveRelative

public Locator resolveRelative(Locator rel)
                        throws LocatorResolutionException
Returns a new Locator whose address is the result of resolving the specified Locator relative to this Locator.


resolveRelative

public Locator resolveRelative(java.lang.String rel)
                        throws LocatorResolutionException
Returns a new Locator whose address is the result of resolvng the specified relative address string relative to this Locator.


equals

public boolean equals(Locator loc)
Determines the equality of this Locator to loc:


hashCode

public int hashCode()
Returns the Locator's object hashcode.


copy

public Locator copy()
             throws LocatorFactoryException
Returns a copy of this object.