com.ibm.notes.java.api.data
Class NotesData

java.lang.Object
  extended by com.ibm.notes.java.api.data.NotesData
Direct Known Subclasses:
NotesDatabaseData, NotesDocumentData, NotesDocumentKeyData, NotesFormData, NotesFramesetData, NotesPageData, NotesViewData

public abstract class NotesData
extends Object

The super class for all data needed for performing operations on Notes objects, such as databases, view, documents, and others.


Field Summary
protected  String baseUrl
          Variable that contains the base Notes URL of the object.
protected static String ENCODE_ERR
          Encoding error.
protected static String NOTES_COMMAND_SEPARATOR
          Notes URL command separator.
protected static String NOTES_PARAMETER_SEPARATOR
          Notes URL parameter separator.
protected static String NOTES_PATH_SEPARATOR
          Notes URL path separator.
protected static String NOTES_PROTOCOL
          Notes protocol.
protected static String NULL_ERR
          Error text when a parameter is null.
 
Constructor Summary
  NotesData()
          Default constructor.
protected NotesData(String url)
          Construct a NotesData object from a given Notes URL.
 
Method Summary
protected static String encode(String item)
          Encodes the given item in UTF-8 format so it can be used in the Notes URL.
protected  String getBaseUrl()
          Gets the URL of the data object encoded in UTF-8 format.
abstract  String getOpenUrl()
          Gets the encoded Notes URL to open the NotesData object.
protected  Object getParser()
          Deprecated. this method should only be used internally
protected static String removeCommandAndParams(String url)
          Removes the command and any parameters that might be part of a Notes URL.
protected abstract  void setBaseUrl()
          Constructs the Notes URL of the data object from the given information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTES_PROTOCOL

protected static final String NOTES_PROTOCOL
Notes protocol.

Since:
1.5.1
See Also:
Constant Field Values

NOTES_PATH_SEPARATOR

protected static final String NOTES_PATH_SEPARATOR
Notes URL path separator.

Since:
1.5.1
See Also:
Constant Field Values

NOTES_COMMAND_SEPARATOR

protected static final String NOTES_COMMAND_SEPARATOR
Notes URL command separator.

Since:
1.5.1
See Also:
Constant Field Values

NOTES_PARAMETER_SEPARATOR

protected static final String NOTES_PARAMETER_SEPARATOR
Notes URL parameter separator.

Since:
1.5.1
See Also:
Constant Field Values

baseUrl

protected String baseUrl
Variable that contains the base Notes URL of the object. The value should not have any commands or parameters in the URL.

Since:
1.5.1

ENCODE_ERR

protected static final String ENCODE_ERR
Encoding error.

Since:
1.5.1
See Also:
Constant Field Values

NULL_ERR

protected static final String NULL_ERR
Error text when a parameter is null.

Since:
1.5.1
See Also:
Constant Field Values
Constructor Detail

NotesData

public NotesData()
Default constructor.

Since:
1.5.1

NotesData

protected NotesData(String url)
             throws NotesException 
Construct a NotesData object from a given Notes URL. The given URL must be UTF-8 encoded.

Parameters:
url - UTF-8 encoded URL representing the NotesData object
Throws:
NotesException - thrown when the URL specified cannot be parsed
Since:
1.5.1
Method Detail

getBaseUrl

protected String getBaseUrl()
Gets the URL of the data object encoded in UTF-8 format. The returned URL has no commands or parameters in it.

Returns:
the URL of the data object
Since:
1.5.1

getParser

protected final Object getParser()
                          throws NotesException 
Deprecated. this method should only be used internally

Gets the NotesUrlParser for the given URL. This parser knows how to parse specific things from the supplied URL.

Returns:
the NotesUrlParser of the URL of the NotesDataObject
Throws:
NotesException - thrown when the URL specified cannot be parsed
Since:
1.5.1

encode

protected static String encode(String item)
                        throws UnsupportedEncodingException
Encodes the given item in UTF-8 format so it can be used in the Notes URL.

Parameters:
item - item to encode
Returns:
the encoded item
Throws:
UnsupportedEncodingException - thrown when the item cannot be encoded
Since:
1.5.1

removeCommandAndParams

protected static String removeCommandAndParams(String url)
Removes the command and any parameters that might be part of a Notes URL.

Parameters:
url - the URL to remove the command and parameters from
Returns:
a Notes URL without a command or any parameters
Since:
1.5.1

setBaseUrl

protected abstract void setBaseUrl()
                            throws UnsupportedEncodingException
Constructs the Notes URL of the data object from the given information. The URL constructed should only contain the parameters passed in, no commands, or parameters should be added to the URL in this method.

Throws:
UnsupportedEncodingException - thrown when the URL cannot be encoded
Since:
1.5.1

getOpenUrl

public abstract String getOpenUrl()
Gets the encoded Notes URL to open the NotesData object. The URL is UTF-8 encoded.

Returns:
the encoded Notes URL to open the NotesData object
Since:
1.5.1