|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.foundation.ERXUtilities
public class ERXUtilities
Diverse collection of utility methods for handling everything from EOF to foundation. In the future this class will most likely be split into more meaning full groups of utility methods.
Nested Class Summary | |
---|---|
static interface |
ERXUtilities.BooleanCallback
Generic boolean callback interface with a context object. |
static interface |
ERXUtilities.BooleanOperation
Useful interface for binding objects to WOComponent bindings where you want to delay the evaluation of the boolean operation until valueForBinding is
actually called. |
static interface |
ERXUtilities.Callback
Generic callback interface with a context object. |
static interface |
ERXUtilities.Operation
Useful interface for binding objects to WOComponent bindings where you want to delay the evaluation of the operation until valueForBinding is
actually called. |
Field Summary | |
---|---|
static com.webobjects.foundation.NSTimestamp |
DISTANT_FUTURE
|
static com.webobjects.foundation.NSTimestamp |
DISTANT_PAST
|
static org.apache.log4j.Logger |
log
logging support |
Constructor Summary | |
---|---|
ERXUtilities()
|
Method Summary | ||
---|---|---|
static void |
addObjectToObjectOnBothSidesOfRelationshipWithKey(com.webobjects.eocontrol.EOEnterpriseObject addedObject,
com.webobjects.eocontrol.EOEnterpriseObject referenceObject,
java.lang.String key)
Deprecated. use ERXEOControlUtilities.addObjectToObjectOnBothSidesOfRelationshipWithKey(EOEnterpriseObject,EOEnterpriseObject,String) |
|
static com.webobjects.foundation.NSArray |
allFrameworkNames()
Utility method to get all of the framework names that have been loaded into the application. |
|
static com.webobjects.foundation.NSArray |
allSubEntitiesForEntity(com.webobjects.eoaccess.EOEntity entity,
boolean includeAbstracts)
Utility method used to find all of the sub entities for a given entity. |
|
static com.webobjects.eoaccess.EOEntity |
caseInsensitiveEntityNamed(java.lang.String entityName)
Finds an entity given a case insensitive search of all the entity names. Note: The current implementation caches the entity-entity name pair in an insensitive manner. |
|
static com.webobjects.eocontrol.EOEnterpriseObject |
createEO(java.lang.String entityName,
com.webobjects.eocontrol.EOEditingContext editingContext)
Deprecated. use ERXEOControlUtilities.createAndInsertObject(EOEditingContext,String) |
|
static com.webobjects.eocontrol.EOEnterpriseObject |
createEO(java.lang.String entityName,
com.webobjects.eocontrol.EOEditingContext editingContext,
com.webobjects.foundation.NSDictionary objectInfo)
Deprecated. use createAndInsertObject(EOEditingContext,String, NSDictionary) |
|
static com.webobjects.eocontrol.EOEnterpriseObject |
createEOLinkedToEO(java.lang.String entityName,
com.webobjects.eocontrol.EOEditingContext editingContext,
java.lang.String relationshipName,
com.webobjects.eocontrol.EOEnterpriseObject eo)
Deprecated. use ERXEOControlUtilities.createAndAddObjectToRelationship(EOEditingContext,EOEnterpriseObject,String,String,NSDictionary); |
|
static com.webobjects.eocontrol.EOEnterpriseObject |
createEOLinkedToEO(java.lang.String entityName,
com.webobjects.eocontrol.EOEditingContext editingContext,
java.lang.String relationshipName,
com.webobjects.eocontrol.EOEnterpriseObject eo,
com.webobjects.foundation.NSDictionary objectInfo)
Deprecated. use ERXEOControlUtilities.createAndAddObjectToRelationship(EOEditingContext,EOEnterpriseObject,String,String,NSDictionary); |
|
static com.webobjects.eocontrol.EOArrayDataSource |
dataSourceForArray(com.webobjects.foundation.NSArray array)
Deprecated. see ERXEOControlUtilities.dataSourceForArray(NSArray) |
|
static
|
deepClone(T obj,
boolean onlyCollections)
Returns a deep clone of the given object. |
|
static com.webobjects.foundation.NSArray |
deletedObjectsPKeys(com.webobjects.eocontrol.EOEditingContext ec)
Utility method for returning all of the primary keys for all of the objects that are marked for deletion in the editing context. |
|
static void |
deleteObjects(com.webobjects.eocontrol.EOEditingContext ec,
com.webobjects.foundation.NSArray objects)
Simple utility method for deleting an array of objects from an editing context. |
|
static void |
deplicateRelationshipFromEO(com.webobjects.eocontrol.EOEnterpriseObject r1,
java.lang.String relationshipName)
Copies a relationship from one EO to another using the name of the relationship |
|
static com.webobjects.foundation.NSTimestamp |
distantFuture()
|
|
static com.webobjects.foundation.NSTimestamp |
distantPast()
|
|
static com.webobjects.foundation.NSArray |
entitiesForModelGroup(com.webobjects.eoaccess.EOModelGroup group)
Simple utility method for getting all of the entities for all of the models of a given model group. |
|
static java.lang.String |
escapeApostrophe(java.lang.String aString)
Gets rid of all ' from a String. |
|
static com.webobjects.foundation.NSTimestampFormatter |
gregorianDateFormatterForJavaDate()
Utility method to return a standard timestamp formatter for the default string representation of java dates. |
|
static com.webobjects.foundation.NSArray |
intersectingElements(com.webobjects.foundation.NSArray array1,
com.webobjects.foundation.NSArray array2)
Performs a basic intersection between two arrays. |
|
static com.webobjects.eocontrol.EOEnterpriseObject |
localInstanceOfObject(com.webobjects.eocontrol.EOEditingContext ec,
com.webobjects.eocontrol.EOEnterpriseObject eo)
Deprecated. use ERXEOControlUtilities.localInstanceOfObject(EOEditingContext,EOEnterpriseObject); |
|
static com.webobjects.foundation.NSArray |
localInstancesOfObjects(com.webobjects.eocontrol.EOEditingContext ec,
com.webobjects.foundation.NSArray eos)
Deprecated. use ERXEOControlUtilities.localInstancesOfObjects(EOEditingContext,NSArray); |
|
static void |
makeEditableSharedEntityNamed(java.lang.String entityName)
Deprecated. see ERXEOAccessUtilities.makeEditableSharedEntityNamed(String) |
|
static com.webobjects.foundation.NSDictionary |
primaryKeyDictionaryForEntity(com.webobjects.eocontrol.EOEditingContext ec,
java.lang.String entityName)
Deprecated. use ERXEOAccessUtilities.primaryKeyDictionaryForEntity(EOEditingContext, String) |
|
static com.webobjects.foundation.NSDictionary |
relationshipEntityWithEntityAndKeyPath(com.webobjects.eoaccess.EOEntity srcentity,
java.lang.String keyPath)
|
|
static com.webobjects.eocontrol.EOEnterpriseObject |
relationshipObjectWithObjectAndKeyPath(com.webobjects.eocontrol.EOEnterpriseObject object,
java.lang.String keyPath)
|
|
static com.webobjects.eoaccess.EORelationship |
relationshipWithObjectAndKeyPath(com.webobjects.eocontrol.EOEnterpriseObject object,
java.lang.String keyPath)
Traverses a key path to return the last EORelationship
object.Note: that this method uses the object and not the model to traverse the key path, this has the added benefit of handling EOF inheritance |
|
static void |
replicateDataFromEOToEO(com.webobjects.eocontrol.EOEnterpriseObject r1,
com.webobjects.eocontrol.EOEnterpriseObject r2,
com.webobjects.foundation.NSArray attributeNames)
Copies values from one EO to another using an array of Attributes |
|
static void |
replicateRelationshipFromEOToEO(com.webobjects.eocontrol.EOEnterpriseObject r1,
com.webobjects.eocontrol.EOEnterpriseObject r2,
java.lang.String relationshipName)
Copies a relationship from one EO to another using the name of the relationship |
|
static com.webobjects.eoaccess.EOEntity |
rootParentEntityForEntity(com.webobjects.eoaccess.EOEntity entity)
Walks all of the parentEntity relationships to find the root entity. |
|
static com.webobjects.foundation.NSSet |
setFromArray(com.webobjects.foundation.NSArray array)
Deprecated. use ERXArrayUtilities.setFromArray(NSArray) |
|
static com.webobjects.eocontrol.EOEnterpriseObject |
sharedObjectWithFetchSpec(java.lang.String fetchSpec,
java.lang.String entityName)
Deprecated. use ERXEOControlUtilities.sharedObjectWithFetchSpec(String, String) |
|
static com.webobjects.eocontrol.EOEnterpriseObject |
sharedObjectWithPrimaryKey(java.lang.Object pk,
java.lang.String entityName)
Deprecated. use ERXEOControlUtilities.sharedObjectWithPrimaryKey(String, object) |
|
static com.webobjects.foundation.NSSelector |
sortSelectorWithKey(java.lang.String key)
Deprecated. use ERXArrayUtilities.sortSelectorWithKey(String) |
|
static java.lang.String |
stackTrace()
Generates a string representation of the current stacktrace. |
|
static java.lang.String |
stackTrace(java.lang.Throwable t)
Converts a throwable's stacktrace into a string representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.log4j.Logger log
public static final com.webobjects.foundation.NSTimestamp DISTANT_FUTURE
public static final com.webobjects.foundation.NSTimestamp DISTANT_PAST
Constructor Detail |
---|
public ERXUtilities()
Method Detail |
---|
public static void addObjectToObjectOnBothSidesOfRelationshipWithKey(com.webobjects.eocontrol.EOEnterpriseObject addedObject, com.webobjects.eocontrol.EOEnterpriseObject referenceObject, java.lang.String key)
public static com.webobjects.eocontrol.EOEnterpriseObject createEO(java.lang.String entityName, com.webobjects.eocontrol.EOEditingContext editingContext)
public static com.webobjects.eocontrol.EOEnterpriseObject createEO(java.lang.String entityName, com.webobjects.eocontrol.EOEditingContext editingContext, com.webobjects.foundation.NSDictionary objectInfo)
public static com.webobjects.eocontrol.EOEnterpriseObject createEOLinkedToEO(java.lang.String entityName, com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.String relationshipName, com.webobjects.eocontrol.EOEnterpriseObject eo)
public static com.webobjects.eocontrol.EOEnterpriseObject createEOLinkedToEO(java.lang.String entityName, com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.String relationshipName, com.webobjects.eocontrol.EOEnterpriseObject eo, com.webobjects.foundation.NSDictionary objectInfo)
public static com.webobjects.eocontrol.EOEnterpriseObject localInstanceOfObject(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.eocontrol.EOEnterpriseObject eo)
public static com.webobjects.foundation.NSArray localInstancesOfObjects(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.foundation.NSArray eos)
public static com.webobjects.eocontrol.EOEnterpriseObject sharedObjectWithFetchSpec(java.lang.String fetchSpec, java.lang.String entityName)
public static com.webobjects.eocontrol.EOEnterpriseObject sharedObjectWithPrimaryKey(java.lang.Object pk, java.lang.String entityName)
public static com.webobjects.foundation.NSDictionary primaryKeyDictionaryForEntity(com.webobjects.eocontrol.EOEditingContext ec, java.lang.String entityName)
public static com.webobjects.foundation.NSArray deletedObjectsPKeys(com.webobjects.eocontrol.EOEditingContext ec)
ec
- editing context
public static void makeEditableSharedEntityNamed(java.lang.String entityName)
ERXEOAccessUtilities.makeEditableSharedEntityNamed(String)
public static com.webobjects.eocontrol.EOArrayDataSource dataSourceForArray(com.webobjects.foundation.NSArray array)
ERXEOControlUtilities.dataSourceForArray(NSArray)
public static com.webobjects.eoaccess.EORelationship relationshipWithObjectAndKeyPath(com.webobjects.eocontrol.EOEnterpriseObject object, java.lang.String keyPath)
EORelationship
object.
object
- enterprise object to find the relationship off ofkeyPath
- key path used to find the relationship
public static com.webobjects.foundation.NSDictionary relationshipEntityWithEntityAndKeyPath(com.webobjects.eoaccess.EOEntity srcentity, java.lang.String keyPath)
public static com.webobjects.eocontrol.EOEnterpriseObject relationshipObjectWithObjectAndKeyPath(com.webobjects.eocontrol.EOEnterpriseObject object, java.lang.String keyPath)
public static void deleteObjects(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.foundation.NSArray objects)
ec
- editing context to have objects deleted fromobjects
- objects to be deleted.public static com.webobjects.foundation.NSArray allFrameworkNames()
public static com.webobjects.foundation.NSArray intersectingElements(com.webobjects.foundation.NSArray array1, com.webobjects.foundation.NSArray array2)
array1
- first arrayarray2
- second array
public static com.webobjects.foundation.NSArray entitiesForModelGroup(com.webobjects.eoaccess.EOModelGroup group)
group
- eo model group
public static com.webobjects.eoaccess.EOEntity caseInsensitiveEntityNamed(java.lang.String entityName)
public static com.webobjects.foundation.NSArray allSubEntitiesForEntity(com.webobjects.eoaccess.EOEntity entity, boolean includeAbstracts)
entity
- to walk all of the subEntities
relationshipsincludeAbstracts
- determines if abstract entities should
be included in the returned array
public static com.webobjects.eoaccess.EOEntity rootParentEntityForEntity(com.webobjects.eoaccess.EOEntity entity)
entity
- to find the root parent
public static com.webobjects.foundation.NSTimestampFormatter gregorianDateFormatterForJavaDate()
public static java.lang.String stackTrace()
public static java.lang.String stackTrace(java.lang.Throwable t)
t
- throwable to print to a string
public static com.webobjects.foundation.NSTimestamp distantFuture()
public static com.webobjects.foundation.NSTimestamp distantPast()
public static java.lang.String escapeApostrophe(java.lang.String aString)
aString
- string to check
public static com.webobjects.foundation.NSSet setFromArray(com.webobjects.foundation.NSArray array)
public static com.webobjects.foundation.NSSelector sortSelectorWithKey(java.lang.String key)
public static void replicateDataFromEOToEO(com.webobjects.eocontrol.EOEnterpriseObject r1, com.webobjects.eocontrol.EOEnterpriseObject r2, com.webobjects.foundation.NSArray attributeNames)
public static void replicateRelationshipFromEOToEO(com.webobjects.eocontrol.EOEnterpriseObject r1, com.webobjects.eocontrol.EOEnterpriseObject r2, java.lang.String relationshipName)
public static void deplicateRelationshipFromEO(com.webobjects.eocontrol.EOEnterpriseObject r1, java.lang.String relationshipName)
public static <T> T deepClone(T obj, boolean onlyCollections)
obj
- the object to cloneonlyCollections
- if true, only collections will be cloned, not individual values
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |