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 String PATH_THIS
           
static Pattern PATTERN
           
protected static String PATTERN_FRAGMENT
           
protected static String PATTERN_PATH
           
protected static String PATTERN_SCHEME
           
 
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.ClassDoc classDoc, String fragment)
           
static AnchorAddress valueOf(Scheme scheme, com.sun.javadoc.MethodDoc methodDoc)
           
static AnchorAddress valueOf(Scheme scheme, com.sun.javadoc.PackageDoc packageDoc)
           
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_SCHEME

protected static final String PATTERN_SCHEME
See Also:
Constant Field Values

PATTERN_PATH

protected static final String PATTERN_PATH
See Also:
Constant Field Values

PATTERN_FRAGMENT

protected static final String PATTERN_FRAGMENT
See Also:
Constant Field Values

PATTERN

public static final Pattern PATTERN

PATH_THIS

public static final String PATH_THIS
See Also:
Constant Field Values
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)

valueOf

public static AnchorAddress valueOf(Scheme scheme,
                                    com.sun.javadoc.PackageDoc packageDoc)

valueOf

public static AnchorAddress valueOf(Scheme scheme,
                                    com.sun.javadoc.ClassDoc classDoc,
                                    String fragment)

valueOf

public static AnchorAddress valueOf(Scheme scheme,
                                    com.sun.javadoc.MethodDoc methodDoc)

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 © 2011 Teleal GmbH, Switzerland. All Rights Reserved.