public class ERXUtilities extends Object
Modifier and Type | Class and Description |
---|---|
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. |
Constructor and Description |
---|
ERXUtilities() |
Modifier and Type | Method and Description |
---|---|
static NSArray |
allFrameworkNames()
Utility method to get all of the framework names that
have been loaded into the application.
|
static com.webobjects.eoaccess.EOEntity |
caseInsensitiveEntityNamed(String entityName)
Finds an entity given a case insensitive search
of all the entity names.
|
static <T> T |
deepClone(T obj,
boolean onlyCollections)
Returns a deep clone of the given object.
|
static 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,
NSArray objects)
Simple utility method for deleting an array
of objects from an editing context.
|
static void |
deplicateRelationshipFromEO(com.webobjects.eocontrol.EOEnterpriseObject r1,
String relationshipName)
Copies a relationship from one EO to another using the name of the relationship
|
static 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 String |
escapeApostrophe(String aString)
Gets rid of all ' from a String.
|
static NSDictionary |
relationshipEntityWithEntityAndKeyPath(com.webobjects.eoaccess.EOEntity srcentity,
String keyPath) |
static com.webobjects.eocontrol.EOEnterpriseObject |
relationshipObjectWithObjectAndKeyPath(com.webobjects.eocontrol.EOEnterpriseObject object,
String keyPath) |
static com.webobjects.eoaccess.EORelationship |
relationshipWithObjectAndKeyPath(com.webobjects.eocontrol.EOEnterpriseObject object,
String keyPath)
Traverses a key path to return the last
EORelationship
object. |
static void |
replicateDataFromEOToEO(com.webobjects.eocontrol.EOEnterpriseObject r1,
com.webobjects.eocontrol.EOEnterpriseObject r2,
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,
String relationshipName)
Copies a relationship from one EO to another using the name of the relationship
|
static String |
stackTrace()
Generates a string representation of the current stacktrace.
|
static String |
stackTrace(Throwable t)
Converts a throwable's stacktrace into a
string representation.
|
public static NSArray deletedObjectsPKeys(com.webobjects.eocontrol.EOEditingContext ec)
ec
- editing contextpublic static com.webobjects.eoaccess.EORelationship relationshipWithObjectAndKeyPath(com.webobjects.eocontrol.EOEnterpriseObject object, String keyPath)
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
object
- enterprise object to find the relationship off ofkeyPath
- key path used to find the relationshippublic static NSDictionary relationshipEntityWithEntityAndKeyPath(com.webobjects.eoaccess.EOEntity srcentity, String keyPath)
public static com.webobjects.eocontrol.EOEnterpriseObject relationshipObjectWithObjectAndKeyPath(com.webobjects.eocontrol.EOEnterpriseObject object, String keyPath)
public static void deleteObjects(com.webobjects.eocontrol.EOEditingContext ec, NSArray objects)
ec
- editing context to have objects deleted fromobjects
- objects to be deleted.public static NSArray allFrameworkNames()
public static NSArray entitiesForModelGroup(com.webobjects.eoaccess.EOModelGroup group)
group
- eo model grouppublic static com.webobjects.eoaccess.EOEntity caseInsensitiveEntityNamed(String entityName)
Note: The current implementation caches the entity-entity name pair in an insensitive manner. This means that all of the models should be loaded before this method is called.
public static String stackTrace()
public static String stackTrace(Throwable t)
t
- throwable to print to a stringpublic static String escapeApostrophe(String aString)
aString
- string to checkpublic static void replicateDataFromEOToEO(com.webobjects.eocontrol.EOEnterpriseObject r1, com.webobjects.eocontrol.EOEnterpriseObject r2, NSArray attributeNames)
public static void replicateRelationshipFromEOToEO(com.webobjects.eocontrol.EOEnterpriseObject r1, com.webobjects.eocontrol.EOEnterpriseObject r2, String relationshipName)
public static void deplicateRelationshipFromEO(com.webobjects.eocontrol.EOEnterpriseObject r1, 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 valuesCopyright © 2002 – 2020 Project Wonder.