Package net.anotheria.anodoc.util
Class KeyUtility
- java.lang.Object
-
- net.anotheria.anodoc.util.KeyUtility
-
public class KeyUtility extends java.lang.ObjectSome utilities for key handling.- Since:
- 1.0
- Version:
- $Id: $Id
- Author:
- another
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetDocumentName(java.lang.String key)Extracts the name of the document from the key.static java.lang.StringgetDocumentType(java.lang.String key)Extracts the name of the document type (document or list) from the key.static java.lang.StringgetKeyFromListKey(java.lang.String listKey)Extracts the document key from the given listkey.static java.lang.StringgetListPos(java.lang.String listKey)getListPos.static booleanisDocument(java.lang.String key)isDocument.static booleanisList(java.lang.String key)isList.
-
-
-
Method Detail
-
getDocumentType
public static java.lang.String getDocumentType(java.lang.String key)
Extracts the name of the document type (document or list) from the key.- Parameters:
key- aStringobject.- Returns:
- name of the document type
-
getDocumentName
public static java.lang.String getDocumentName(java.lang.String key)
Extracts the name of the document from the key.- Parameters:
key- aStringobject.- Returns:
- name of the document
-
isDocument
public static boolean isDocument(java.lang.String key)
isDocument.
- Parameters:
key- aStringobject.- Returns:
- true if the given key represents a document (contains document identifier in the key).
-
isList
public static boolean isList(java.lang.String key)
isList.
- Parameters:
key- aStringobject.- Returns:
- true if the given key represents a list (contains list identifier in the key).
-
getListPos
public static java.lang.String getListPos(java.lang.String listKey)
getListPos.
- Parameters:
listKey- aStringobject.- Returns:
- the position of the current document from the listkey.
-
getKeyFromListKey
public static java.lang.String getKeyFromListKey(java.lang.String listKey)
Extracts the document key from the given listkey.- Parameters:
listKey- is a document key combined with the list position.- Returns:
- document key
-
-