org.teleal.lemma.anchor
Class AnchorAddress

java.lang.Object
  extended by org.teleal.lemma.anchor.AnchorAddress

public class AnchorAddress
extends Object

Encapsulates parsing of citation anchor URIs.

Two addresses are equal if they have the same scheme and path, and (if not null) fragment.

Author:
Christian Bauer

Field Summary
static Pattern PATTERN
           
 
Constructor Summary
AnchorAddress(Scheme scheme, String path, String fragment)
           
 
Method Summary
 boolean equals(Object o)
           
 String getFragment()
           
 String getPath()
           
 Scheme getScheme()
           
 int hashCode()
           
static String toFileAddress(String string)
          Converts a simple file path into a file:// URI string.
 String toIdentifierString()
          Generates an XSD:id typed String that can be used in XML documents as identifier attribute value.
 String toString()
           
static AnchorAddress valueOf(Scheme scheme, com.sun.javadoc.SeeTag tag)
           
static AnchorAddress valueOf(String string)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PATTERN

public static final Pattern PATTERN
Constructor Detail

AnchorAddress

public AnchorAddress(Scheme scheme,
                     String path,
                     String fragment)
Method Detail

getScheme

public Scheme getScheme()

getPath

public String getPath()

getFragment

public String getFragment()

valueOf

public static AnchorAddress valueOf(String string)

valueOf

public static AnchorAddress valueOf(Scheme scheme,
                                    com.sun.javadoc.SeeTag tag)

toFileAddress

public static String toFileAddress(String string)
Converts a simple file path into a file:// URI string.

Parameters:
string - A file path, e.g. "/my/file.txt".
Returns:
A URI string, e.g. "file://my/file.txt";

toIdentifierString

public String toIdentifierString()
Generates an XSD:id typed String that can be used in XML documents as identifier attribute value.

Returns:
An XSD:id compatible string representation of this URI.

toString

public String toString()
Overrides:
toString in class Object
Returns:
The complement of the valueOf(String) operation.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2010 Teleal GmbH, Switzerland. All Rights Reserved.