org.apache.lenya.cms.publication
Class DocumentLocator

java.lang.Object
  extended by org.apache.lenya.cms.publication.DocumentLocator

public class DocumentLocator
extends java.lang.Object

A DocumentLocator describes a document based on its path in the site structure. The actual document doesn't have to exist.


Constructor Summary
protected DocumentLocator(java.lang.String pubId, java.lang.String area, java.lang.String path, java.lang.String language)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getArea()
           
 DocumentLocator getAreaVersion(java.lang.String area)
          Returns a locator with the same publication ID, path, and language, but with a different area.
 DocumentLocator getChild(java.lang.String step)
          Returns a child of this locator.
 DocumentLocator getDescendant(java.lang.String relativePath)
          Returns a descendant of this locator.
protected  java.lang.String getKey()
           
protected static java.lang.String getKey(java.lang.String pubId, java.lang.String area, java.lang.String path, java.lang.String language)
           
 java.lang.String getLanguage()
           
 DocumentLocator getLanguageVersion(java.lang.String language)
          Returns a locator with the same publication ID, area, and path, but with a different language.
static DocumentLocator getLocator(java.lang.String pubId, java.lang.String area, java.lang.String path, java.lang.String language)
          Returns a specific document locator.
 DocumentLocator getParent()
          Returns the parent of this locator.
 DocumentLocator getParent(java.lang.String defaultPath)
          Returns the parent of this locator.
 java.lang.String getPath()
           
 DocumentLocator getPathVersion(java.lang.String path)
          Returns a locator with the same publication ID, area, and language, but a different path in the site structure.
 java.lang.String getPublicationId()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentLocator

protected DocumentLocator(java.lang.String pubId,
                          java.lang.String area,
                          java.lang.String path,
                          java.lang.String language)
Method Detail

getLocator

public static DocumentLocator getLocator(java.lang.String pubId,
                                         java.lang.String area,
                                         java.lang.String path,
                                         java.lang.String language)
Returns a specific document locator.

Parameters:
pubId - The publication ID.
area - The area of the document.
path - The path of the document in the site structure.
language - The language of the document.
Returns:
A document locator.

getKey

protected static final java.lang.String getKey(java.lang.String pubId,
                                               java.lang.String area,
                                               java.lang.String path,
                                               java.lang.String language)

getArea

public java.lang.String getArea()
Returns:
The area of the document.

getLanguage

public java.lang.String getLanguage()
Returns:
The language of the document.

getPath

public java.lang.String getPath()
Returns:
The path of the document in the site structure.

getPublicationId

public java.lang.String getPublicationId()
Returns:
The publication ID.

getPathVersion

public DocumentLocator getPathVersion(java.lang.String path)
Returns a locator with the same publication ID, area, and language, but a different path in the site structure.

Parameters:
path - The path.
Returns:
A document locator.

getDescendant

public DocumentLocator getDescendant(java.lang.String relativePath)
Returns a descendant of this locator.

Parameters:
relativePath - The relative path which must not begin with a slash and must not be empty.
Returns:
A document locator.

getChild

public DocumentLocator getChild(java.lang.String step)
Returns a child of this locator.

Parameters:
step - The relative path to the child, it must not contain a slash.
Returns:
A document locator.

getParent

public DocumentLocator getParent()
Returns the parent of this locator.

Returns:
A document locator or null if this is the root locator.

getParent

public DocumentLocator getParent(java.lang.String defaultPath)
Returns the parent of this locator.

Parameters:
defaultPath - The path of the locator to return if this is the root locator.
Returns:
A document locator.

getLanguageVersion

public DocumentLocator getLanguageVersion(java.lang.String language)
Returns a locator with the same publication ID, area, and path, but with a different language.

Parameters:
language - The language.
Returns:
A document locator.

getKey

protected java.lang.String getKey()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAreaVersion

public DocumentLocator getAreaVersion(java.lang.String area)
Returns a locator with the same publication ID, path, and language, but with a different area.

Parameters:
area - The area.
Returns:
A document locator.


Copyright © 1999-2006 Apache Software Foundation. All Rights Reserved.