com.openexchange.api
Class OXObject

java.lang.Object
  extended by com.openexchange.api.OXObject
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
OXAttachment, OXExtended, OXSqlObject

public abstract class OXObject
extends java.lang.Object
implements java.lang.Cloneable

OXObject

Author:
Sebastian Kauss

Field Summary
static java.lang.String CREATION_TIME
           
static java.lang.String LAST_MODIFIED
           
static java.lang.String OBJECT_ID
           
 
Constructor Summary
OXObject()
           
 
Method Summary
 java.lang.Object clone()
           
 boolean contains(java.lang.String name)
          returns true if a mapping for this name exists
abstract  void delete()
          delete the OXObject the OXObject have to contain the name "object_id" with the speciefied ID to delete
abstract  void destroy()
          destroys this OXObject
 java.lang.Object get(java.lang.String name)
          return the value to which the specified name is mapped, or null if there is no mapping for this name
 java.sql.Connection getConnection()
          return the Connection and null if no connection was set
 java.util.Date getCreationTime()
          return the creation time
 java.lang.String getInternalFieldname(java.lang.String name)
          returns the internal name of the used fields or null
 java.util.Date getLastModified()
          return the last modified
 java.util.ArrayList getMandatoryFields()
          return an ArrayList with all mandatory fields for this OXObject
 java.lang.String getMappedField(java.lang.String s)
           
abstract  boolean getNext()
          return true if an next object exists
 int getObjectID()
          return object_id
 java.lang.String getPassword()
          return the password and null of no password was set
 java.util.ArrayList getReadableFields()
          return an ArrayList with all readable fields for this OXObject
 java.lang.String getUser()
          return the loginname and null if no loginname was set
 java.util.ArrayList getWriteableFields()
          return an ArrayList with all writedable fields for this OXObject
 boolean isNull(java.lang.String name)
          returns true the value of the mapped name is null otherwise false
 java.util.Iterator iterator()
          return an Iterator with all keys in the OXObject
abstract  void load()
          load the OXObject
 void put(java.lang.String name, java.lang.Object value)
          Associates the specified value with the specified name
 void remove(java.lang.String name)
          removes the mapping for this key
abstract  void reset()
          set the OXObject to the default values
abstract  void save()
          saves the OXObject with the specified values if the OXObject not contains the name "object_id" this method tries to perform an insert if the OXObject contains the name "object_id" this methods tries to perform an update
 void set(java.lang.String name, java.lang.Object value)
          Associates the specified value with the specified name
 void setInternalObject(java.lang.Object o)
          set an internal object
 void setObjectID(int object_id)
          set the object id
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATION_TIME

public static final java.lang.String CREATION_TIME
See Also:
Constant Field Values

LAST_MODIFIED

public static final java.lang.String LAST_MODIFIED
See Also:
Constant Field Values

OBJECT_ID

public static final java.lang.String OBJECT_ID
See Also:
Constant Field Values
Constructor Detail

OXObject

public OXObject()
Method Detail

getUser

public java.lang.String getUser()
return the loginname and null if no loginname was set

Returns:
the loginname and null if no loginname was set

getPassword

public java.lang.String getPassword()
return the password and null of no password was set

Returns:
the password and null of no password was set

getConnection

public java.sql.Connection getConnection()
return the Connection and null if no connection was set

Returns:
the Connection and null if no connection was set

getCreationTime

public java.util.Date getCreationTime()
return the creation time

Returns:
creationtime

getLastModified

public java.util.Date getLastModified()
return the last modified

Returns:
last modified

getObjectID

public int getObjectID()
return object_id

Returns:
object_id

setObjectID

public void setObjectID(int object_id)
set the object id


get

public java.lang.Object get(java.lang.String name)
return the value to which the specified name is mapped, or null if there is no mapping for this name

Parameters:
name -
Returns:
object

set

public void set(java.lang.String name,
                java.lang.Object value)
Associates the specified value with the specified name

Parameters:
name -
value -

put

public void put(java.lang.String name,
                java.lang.Object value)
Associates the specified value with the specified name

Parameters:
name -
value -

contains

public boolean contains(java.lang.String name)
returns true if a mapping for this name exists

Parameters:
name -
Returns:
contains

isNull

public boolean isNull(java.lang.String name)
returns true the value of the mapped name is null otherwise false

Parameters:
name -
Returns:
contains

remove

public void remove(java.lang.String name)
removes the mapping for this key

Parameters:
name -

iterator

public java.util.Iterator iterator()
return an Iterator with all keys in the OXObject


getReadableFields

public java.util.ArrayList getReadableFields()
return an ArrayList with all readable fields for this OXObject

Returns:
an ArrayList with all readable fields for this OXObject and null if no fields are readable

getWriteableFields

public java.util.ArrayList getWriteableFields()
return an ArrayList with all writedable fields for this OXObject

Returns:
an ArrayList with all writedable fields for this OXObject and null if no fields are writeable

getMandatoryFields

public java.util.ArrayList getMandatoryFields()
return an ArrayList with all mandatory fields for this OXObject

Returns:
an ArrayList with all mandatory fields for this OXObject and null if no fields are mandatory

getNext

public abstract boolean getNext()
                         throws java.lang.Exception
return true if an next object exists

Throws:
java.lang.Exception

load

public abstract void load()
                   throws java.lang.Exception,
                          OXConflictException,
                          OXPermissionException
load the OXObject

Throws:
java.lang.Exception
OXConflictException
OXPermissionException

save

public abstract void save()
                   throws java.lang.Exception,
                          OXConflictException,
                          OXMandatoryFieldException,
                          OXPermissionException
saves the OXObject with the specified values if the OXObject not contains the name "object_id" this method tries to perform an insert if the OXObject contains the name "object_id" this methods tries to perform an update

Throws:
java.lang.Exception
OXConflictException
OXMandatoryFieldException
OXPermissionException

delete

public abstract void delete()
                     throws java.lang.Exception,
                            OXConflictException,
                            OXMandatoryFieldException,
                            OXPermissionException
delete the OXObject the OXObject have to contain the name "object_id" with the speciefied ID to delete

Throws:
java.lang.Exception
OXConflictException
OXMandatoryFieldException
OXPermissionException

destroy

public abstract void destroy()
destroys this OXObject


reset

public abstract void reset()
                    throws java.lang.Exception
set the OXObject to the default values

Throws:
java.lang.Exception

getMappedField

public java.lang.String getMappedField(java.lang.String s)

setInternalObject

public void setInternalObject(java.lang.Object o)
set an internal object


getInternalFieldname

public java.lang.String getInternalFieldname(java.lang.String name)
returns the internal name of the used fields or null


toString

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

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object