Project Wonder 5.0

er.rest
Class ERXAbstractRestDelegate

java.lang.Object
  extended by er.rest.ERXAbstractRestDelegate
All Implemented Interfaces:
IERXRestDelegate
Direct Known Subclasses:
EOEntityRestDelegate, EOModelGroupRestDelegate, EOModelRestDelegate, ERXEORestDelegate, ERXNoOpRestDelegate

public abstract class ERXAbstractRestDelegate
extends java.lang.Object
implements IERXRestDelegate

ERXAbstractRestDelegate is the default implementation of the IERXRestDelegate interface that can handle looking up delegates for non-eo classes, etc.

Author:
mschrag

Nested Class Summary
 
Nested classes/interfaces inherited from interface er.rest.IERXRestDelegate
IERXRestDelegate.Factory
 
Constructor Summary
ERXAbstractRestDelegate()
           
ERXAbstractRestDelegate(com.webobjects.eocontrol.EOEditingContext editingContext)
           
 
Method Summary
 boolean __hasNumericPrimaryKeys(com.webobjects.eocontrol.EOClassDescription classDescription)
          This API will likely change.
protected abstract  java.lang.Object _createObjectOfEntityWithID(com.webobjects.eocontrol.EOClassDescription entity, java.lang.Object id)
           
protected abstract  java.lang.Object _fetchObjectOfEntityWithID(com.webobjects.eocontrol.EOClassDescription entity, java.lang.Object id)
           
protected abstract  boolean _isDelegateForEntity(com.webobjects.eocontrol.EOClassDescription entity)
           
protected abstract  java.lang.Object _primaryKeyForObject(com.webobjects.eocontrol.EOClassDescription entity, java.lang.Object obj)
           
 java.lang.Object createObjectOfEntityWithID(com.webobjects.eocontrol.EOClassDescription entity, java.lang.Object id)
          Creates a new instance of the entity.
 com.webobjects.eocontrol.EOEditingContext editingContext()
           
 java.lang.Object objectOfEntityWithID(com.webobjects.eocontrol.EOClassDescription entity, java.lang.Object id)
          Returns the object with the given entity and ID.
 java.lang.Object primaryKeyForObject(java.lang.Object obj)
          Returns the primary key for the specified object.
 void setCreateMissingObjects(boolean createMissingObjects)
           
 void setEditingContext(com.webobjects.eocontrol.EOEditingContext editingContext)
          Sets the editing context fort his rest delegate (which might not be necessary, but EO delegates require it).
 boolean shouldCreateMissingObjects()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXAbstractRestDelegate

public ERXAbstractRestDelegate()

ERXAbstractRestDelegate

public ERXAbstractRestDelegate(com.webobjects.eocontrol.EOEditingContext editingContext)
Method Detail

__hasNumericPrimaryKeys

public boolean __hasNumericPrimaryKeys(com.webobjects.eocontrol.EOClassDescription classDescription)
Description copied from interface: IERXRestDelegate
This API will likely change. Override if you have to for now, but I'm not sure if it makes more sense to return an array of pk classes, a map of pk to pk class, this boolean, or an array of pk attribute names. If we return pk names, we could probably get rid of primaryKeyForObject, or at least fully implement it in ERXAbstractRestDelegate, but I don't want to fully commit to this API yet. In the meantime, this at least provides a stapgap for automatic registration.

Specified by:
__hasNumericPrimaryKeys in interface IERXRestDelegate
Parameters:
classDescription - the class description in question
Returns:
whether or not the given class description has numeric pks

setCreateMissingObjects

public void setCreateMissingObjects(boolean createMissingObjects)

shouldCreateMissingObjects

public boolean shouldCreateMissingObjects()

setEditingContext

public void setEditingContext(com.webobjects.eocontrol.EOEditingContext editingContext)
Description copied from interface: IERXRestDelegate
Sets the editing context fort his rest delegate (which might not be necessary, but EO delegates require it).

Specified by:
setEditingContext in interface IERXRestDelegate
Parameters:
editingContext - the editing context for this delegate

editingContext

public com.webobjects.eocontrol.EOEditingContext editingContext()

primaryKeyForObject

public java.lang.Object primaryKeyForObject(java.lang.Object obj)
Description copied from interface: IERXRestDelegate
Returns the primary key for the specified object.

Specified by:
primaryKeyForObject in interface IERXRestDelegate
Parameters:
obj - the object to return a pk for
Returns:
the primary key of the object

createObjectOfEntityWithID

public java.lang.Object createObjectOfEntityWithID(com.webobjects.eocontrol.EOClassDescription entity,
                                                   java.lang.Object id)
Description copied from interface: IERXRestDelegate
Creates a new instance of the entity.

Specified by:
createObjectOfEntityWithID in interface IERXRestDelegate
Parameters:
entity - the entity
Returns:
a new instance of the entity

objectOfEntityWithID

public java.lang.Object objectOfEntityWithID(com.webobjects.eocontrol.EOClassDescription entity,
                                             java.lang.Object id)
Description copied from interface: IERXRestDelegate
Returns the object with the given entity and ID.

Specified by:
objectOfEntityWithID in interface IERXRestDelegate
Parameters:
entity - the entity
id - the ID of the object
Returns:
the object with the given entity and ID

_isDelegateForEntity

protected abstract boolean _isDelegateForEntity(com.webobjects.eocontrol.EOClassDescription entity)

_createObjectOfEntityWithID

protected abstract java.lang.Object _createObjectOfEntityWithID(com.webobjects.eocontrol.EOClassDescription entity,
                                                                java.lang.Object id)

_primaryKeyForObject

protected abstract java.lang.Object _primaryKeyForObject(com.webobjects.eocontrol.EOClassDescription entity,
                                                         java.lang.Object obj)

_fetchObjectOfEntityWithID

protected abstract java.lang.Object _fetchObjectOfEntityWithID(com.webobjects.eocontrol.EOClassDescription entity,
                                                               java.lang.Object id)

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.