public abstract class NamedObjectFactory extends Object
Constructor and Description |
---|
NamedObjectFactory() |
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
create(String name,
Object namingContext)
Internal factory method.
|
static String |
createName(Class objectClass,
Object namingContext) |
static String |
createName(Class objectClass,
Object namingContext,
String nameBase) |
static Object |
createObject(Class<? extends DataMap> objectClass,
Object namingContext,
String nameBase) |
static Object |
createObject(Class objectClass,
Object namingContext)
Creates an object using an appropriate factory class.
|
static Relationship |
createRelationship(Entity srcEnt,
Entity targetEnt,
boolean toMany)
Creates a relationship using an appropriate factory class.
|
protected abstract boolean |
isNameInUse(String name,
Object namingContext)
Checks if the name is already taken by another sibling in the same context.
|
protected String |
makeName(Object namingContext)
Creates a unique name for the new object and constructs this object.
|
protected String |
makeName(Object namingContext,
String nameBase) |
protected Object |
makeObject(Object namingContext)
Creates a unique name for the new object and constructs this object.
|
protected Object |
makeObject(Object namingContext,
String nameBase) |
protected abstract String |
nameBase()
Returns a base default name, like "UntitledEntity", etc.
|
public static String createName(Class objectClass, Object namingContext, String nameBase)
public static Object createObject(Class objectClass, Object namingContext)
Note that newly created object is not added to the parent. This behavior can be changed later.
public static Object createObject(Class<? extends DataMap> objectClass, Object namingContext, String nameBase)
public static Relationship createRelationship(Entity srcEnt, Entity targetEnt, boolean toMany)
Note that newly created object is not added to the parent. This behavior can be changed later.
protected String makeName(Object namingContext)
protected Object makeObject(Object namingContext)
protected abstract String nameBase()
protected abstract Object create(String name, Object namingContext)
Copyright © 2001–2018 Apache Cayenne. All rights reserved.