public class InstrumentingSchema extends SchemaWrapper implements InstrumentingSchemaI
ATT_NAME_DEFAULT_PACKAGE, INITIALDATA_LINE_ENCLOSING_CHAR, INITIALDATA_LINE_SEPARATOR_CHAR, INITIALDATA_SCHEMA_ADDITIONS_FILENAME, MD_DISABLE, MD_NON_DESTRUCTIVE, MD_RECREATE_INDEXES, NAME_MINLENGTH, RELATION_TYPE_1_N, RELATION_TYPE_N_1, RELATION_TYPE_N_M, SUFFIX_FOLDER_KEY| Modifier and Type | Method and Description |
|---|---|
void |
addDefinerFuture(java.util.concurrent.Future f) |
void |
addInitFuture(java.util.concurrent.Future f) |
VirtualEntity |
addVirtualEntity(BasicEntityI baseEntity,
java.lang.String name)
Creates a new virtual sub entity to this schema and its namespace.
|
VirtualEntity |
addVirtualEntity(java.lang.String baseEntityName,
java.lang.String name)
Creates a new VirtualEntity extending the given BaseEntity and returns it.
|
AttributeI |
addVirtualProperty(electric.xml.Element el)
Adds a virtual property to this schema using an XML element.
|
AttributeI |
addVirtualProperty(electric.xml.Element el,
java.util.Map parameters)
Adds a virtual property to this schema using an XML element.
|
AttributeI |
addVirtualProperty(electric.xml.Element el,
java.util.Map parameters,
boolean ignoreError)
Adds a virtual property to this schema using an XML element definition.
|
AttributeI |
addVirtualProperty(java.util.Map def)
Creates a new virtual property using a definition from a flat map.
|
AttributeI |
addVirtualProperty(java.util.Map def,
java.util.Map parameters)
Creates a new virtual property using a definition from a flat map.
|
AttributeI |
addVirtualProperty(java.util.Map def,
java.util.Map parameters,
boolean ignoreError)
Creates a new virtual property using a definition from a flat map.
|
InstrumentingEntity |
coerceEntity(EntityI e,
java.lang.String reason)
Wraps and returns the wrapped EntityI into this InstrumentingSchemaI
|
java.util.List<EntityI> |
coerceEntityList(java.util.List<EntityI> l,
java.lang.String reason) |
java.lang.String |
describe(java.lang.Object o)
"format" an object.
|
java.lang.String |
describe(java.lang.Object o,
java.lang.String formatdef)
"format" an object.
|
java.lang.String |
describe(java.lang.Object o,
java.lang.String formatdef,
java.util.Map variables)
"format" an object.
|
java.lang.String |
describe(java.lang.Object o,
java.lang.String formatdef,
java.util.Map variables,
SchemaI onBehalfOfSchema)
"format" an object.
|
void |
flushCaches()
Iterates over all Entities and flushes caches which may contain references to
previously loaded BOs, e.g. the value cache in ScriptedAttributes.
|
java.util.List<ScriptImport> |
getDefaultImports() |
java.util.function.Consumer<SetValueEventI> |
getDefaultSetValueCallback() |
java.util.List<EntityI> |
getEntitiesForInterface(java.lang.Class clazz)
Returns a list of all entities that implement the given interface.
|
InstrumentingEntity |
getEntity(java.lang.String name) |
EntityI |
getEntityForClass(java.lang.Class<? extends BOI> clazz) |
EntityI |
getEntityForClassName(java.lang.String className) |
EntityI |
getEntityForObject(java.lang.Object o) |
java.util.List<EntityI> |
getEntityList()
Retrieves a list of all entities known and defined within this schema.
|
java.util.List<GDPRConfigurationElement> |
getGDPRConfigElements() |
static InstrumentingSchemaI |
getInstance(SchemaI schema) |
static InstrumentingSchemaI |
getInstanceForFormReload(SchemaI schema) |
static InstrumentingSchemaI |
getInstanceForTests(SchemaI schema) |
java.util.Collection<? extends SchemaInterfaceI> |
getInterfaces()
Returns a collection of all interfaces defined in the schema.
|
EntityI |
getLowestCommonDenominateEntity(BOI[] bos) |
java.util.Collection<? extends SchemaInterfaceI> |
getProjectInterfaces()
Returns a collection of all project-specific interfaces defined in the schema.
|
AbstractScript |
getScript()
Script support for instrumenting etc.
|
AbstractScript |
getScript(java.lang.String _language) |
AbstractScript |
getSubScript() |
AbstractScript |
getSubScript(java.util.List<ScriptImport> additionalImports) |
AbstractScript |
getSubScript(java.util.List<ScriptImport> additionalImports,
java.lang.Class baseClass) |
AbstractScript |
getSubScript(java.util.List<ScriptImport> additionalImports,
java.lang.Class baseClass,
java.lang.String language) |
AbstractScript |
getSubScript(java.util.List<ScriptImport> additionalImports,
java.lang.String language) |
AbstractScript |
getSubScript(java.lang.String language) |
java.util.List<EntityI> |
getVirtualSubEntityList(EntityI baseEntity) |
java.util.List<EntityI> |
getVirtualSubEntityList(java.lang.String baseEntityName) |
boolean |
hasVirtualSubEntities(EntityI baseEntity) |
boolean |
hasVirtualSubEntities(java.lang.String baseEntityName) |
void |
setDefaultSetValueCallback(java.util.function.Consumer<SetValueEventI> callback) |
java.util.List<java.lang.Throwable> |
waitForCompilationAndGetErrors() |
void |
waitForDefinerCompilation() |
addRelationObject, aggregate, aggregate, aggregate, aggregate, createFunction, createFunction, createFunction, createFunction, createFunction, createFunction, createFunctionFromXML, createFunctionFromXML, createFunctionFromXML, createFunctionFromXML, flattenToString, getAnnotatedValue, getAnnotatedValue, getAnnotatedValueAsString, getAnnotatedValueAsString, getAttribute, getAttribute, getBOForLastPathElement, getClosestAvailableAggregateAnchor, getCryptoHandler, getCurrentFolder, getCurrentModuleOrProject, getCurrentModulePackage, getDefaultPackage, getDiscriminators, getFingerprint, getFormatter, getFormatter, getFormatter, getFormatter, getFrappingAttributes, getInterface, getNonPersistentAttributes, getPackageList, getPermissionHandler, getProjectPackage, getProperty, getProperty, getRegisteredModuleProviders, getRelationObjects, getSerializationRelevantDiff, getSerialVersionUIDs, getToolTipBundleLookupPath, getType, getUsedModules, getValue, getValue, getValue, getValue, getValueAsString, getValueAsString, getValueAsString, getVersion, hasRelationObject, releaseDefinitionSource, removeRelationObject, setCryptoHandler, setPermissionHandler, setProperty, setValue, setValueAsString, setValueAsString, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddRelationObject, aggregate, aggregate, aggregate, aggregate, checkSyntacticallyValid, createFunction, createFunction, createFunction, createFunction, createFunction, createFunction, createFunctionFromXML, createFunctionFromXML, createFunctionFromXML, createFunctionFromXML, describeNE, describeNE, describeNE, describeNE, filterEntities, flattenToString, getAnnotatedValue, getAnnotatedValue, getAnnotatedValueAsString, getAnnotatedValueAsString, getAttribute, getAttribute, getBOForLastPathElement, getBundleLookupPath, getClosestAvailableAggregateAnchor, getCoreEntityList, getCryptoHandler, getCurrentFolder, getCurrentModuleOrProject, getCurrentModulePackage, getDefaultPackage, getDiscriminators, getEntity, getEntityOrAttributeNameValidationError, getFingerprint, getFormatter, getFormatter, getFormatter, getFormatter, getFrappingAttributes, getInterface, getModuleEntityList, getNonPersistentAttributes, getPackageList, getPermissionHandler, getProjectEntityList, getProjectPackage, getProperty, getProperty, getRegisteredModuleProviders, getRelationObjects, getSerializationRelevantDiff, getSerialVersionUIDs, getToolTipBundleLookupPath, getType, getUsedModules, getValue, getValue, getValue, getValue, getValueAsString, getValueAsString, getValueAsString, getVersion, hasRelationObject, isUsingModules, parseGuiTips, parseGuiTips, releaseDefinitionSource, removeRelationObject, setCryptoHandler, setPermissionHandler, setProperty, setValue, setValueAsString, setValueAsString, splitInitialDataLinepublic static InstrumentingSchemaI getInstance(SchemaI schema)
public static InstrumentingSchemaI getInstanceForTests(SchemaI schema)
public static InstrumentingSchemaI getInstanceForFormReload(SchemaI schema)
public void setDefaultSetValueCallback(java.util.function.Consumer<SetValueEventI> callback)
public java.util.function.Consumer<SetValueEventI> getDefaultSetValueCallback()
getDefaultSetValueCallback in interface InstrumentingSchemaIpublic InstrumentingEntity getEntity(java.lang.String name)
getEntity in interface SchemaIgetEntity in class SchemaWrapperpublic EntityI getEntityForClassName(java.lang.String className)
getEntityForClassName in interface SchemaIgetEntityForClassName in class SchemaWrapperpublic EntityI getEntityForClass(java.lang.Class<? extends BOI> clazz)
getEntityForClass in interface SchemaIgetEntityForClass in class SchemaWrapperpublic EntityI getEntityForObject(java.lang.Object o)
getEntityForObject in interface SchemaIgetEntityForObject in class SchemaWrapperpublic java.util.List<EntityI> getEntitiesForInterface(java.lang.Class clazz)
SchemaIThis method retrieves all entities within the schema that implement the specified interface.
The provided class must represent an interface; otherwise, an IllegalArgumentException is thrown.
getEntitiesForInterface in interface SchemaIgetEntitiesForInterface in class SchemaWrapperclazz - The interface class.public java.util.Collection<? extends SchemaInterfaceI> getInterfaces()
SchemaIgetInterfaces in interface SchemaIgetInterfaces in class SchemaWrapperSchemaInterfaceI representing all interfaces in the schema.public java.util.Collection<? extends SchemaInterfaceI> getProjectInterfaces()
SchemaIProject-specific interfaces are those that belong to the current project's package.
getProjectInterfaces in interface SchemaIgetProjectInterfaces in class SchemaWrapperSchemaInterfaceI representing all project-specific interfaces in the schema.public java.util.List<GDPRConfigurationElement> getGDPRConfigElements()
getGDPRConfigElements in interface SchemaIgetGDPRConfigElements in class SchemaWrapperpublic java.util.List<EntityI> getEntityList()
SchemaIgetEntityList in interface SchemaIgetEntityList in class SchemaWrapperList of all EntityI objects. Returns an empty list if no entities are defined.public EntityI getLowestCommonDenominateEntity(BOI[] bos)
getLowestCommonDenominateEntity in interface SchemaIgetLowestCommonDenominateEntity in class SchemaWrapperpublic InstrumentingEntity coerceEntity(EntityI e, java.lang.String reason)
InstrumentingSchemaIcoerceEntity in interface InstrumentingSchemaIpublic java.util.List<EntityI> coerceEntityList(java.util.List<EntityI> l, java.lang.String reason)
coerceEntityList in interface InstrumentingSchemaIpublic AttributeI addVirtualProperty(electric.xml.Element el)
InstrumentingSchemaIThis is a convenience method that delegates to
InstrumentingSchemaI.addVirtualProperty(Element, Map, boolean), using a default 'null'
for parameters and not ignoring errors.
addVirtualProperty in interface InstrumentingSchemaIel - The non-null root 'virtualProperty' XML element defining the property.public AttributeI addVirtualProperty(electric.xml.Element el, java.util.Map parameters)
InstrumentingSchemaIThis is a convenience method that delegates to
InstrumentingSchemaI.addVirtualProperty(Element, Map, boolean), with error handling set to
not ignore errors by default.
addVirtualProperty in interface InstrumentingSchemaIel - The non-null root 'virtualProperty' XML element defining the property.parameters - A map of additional parameters.public AttributeI addVirtualProperty(electric.xml.Element el, java.util.Map parameters, boolean ignoreError)
InstrumentingSchemaIIf a virtual property with the same name already exists within the entity's context,
the existing property is returned, and the new definition is ignored. This behavior
ensures that an existing, valid property is not accidentally overwritten.
If the name is already defined by a different type of attribute (e.g. a physical database column),
a RuntimeException may be thrown, depending on the ignoreError flag.
addVirtualProperty in interface InstrumentingSchemaIel - The non-null root 'virtualProperty' XML element defining the property.parameters - A map of additional parameters (String -> Object) to be injected into
the property's scripts at execution time (e.g. a logger or context accessor).ignoreError - If true, and the virtual property cannot be constructed
(e.g. due to a naming clash or invalid script), exceptions are caught,
logged, and the method returns null.
If false, the exception is re-thrown.null if the property could not be constructed and the error was ignored.ScriptedAttributepublic AttributeI addVirtualProperty(java.util.Map def)
InstrumentingSchemaIThis convenience method delegates to
InstrumentingSchemaI.addVirtualProperty(Map, Map, boolean), using a default 'null'
for parameters and not ignoring errors.
addVirtualProperty in interface InstrumentingSchemaIdef - The map containing key-value pairs that define the virtual property.public AttributeI addVirtualProperty(java.util.Map def, java.util.Map parameters)
InstrumentingSchemaIThis convenience method delegates to
InstrumentingSchemaI.addVirtualProperty(Map, Map, boolean), with error handling set to
not ignore errors by default.
addVirtualProperty in interface InstrumentingSchemaIdef - The map containing key-value pairs that define the virtual property.parameters - A map of additional parameters.public AttributeI addVirtualProperty(java.util.Map def, java.util.Map parameters, boolean ignoreError)
InstrumentingSchemaIThis method provides a programmatic way to define a virtual property. The keys in the map correspond to the attributes of the XML element, and script values are expected to be Groovy closures.
addVirtualProperty in interface InstrumentingSchemaIdef - The map containing key-value pairs that define the virtual property.parameters - A map of additional parameters to be injected into the scripts.ignoreError - If true, and the property cannot be constructed,
exceptions are caught and the method returns null.null if an error occurred
and was ignored.ScriptedAttributepublic java.lang.String describe(java.lang.Object o,
java.lang.String formatdef,
java.util.Map variables,
SchemaI onBehalfOfSchema)
SchemaIdescribe in interface SchemaIdescribe in class SchemaWrapperpublic java.lang.String describe(java.lang.Object o,
java.lang.String formatdef,
java.util.Map variables)
SchemaIdescribe in interface SchemaIdescribe in class SchemaWrapperpublic java.lang.String describe(java.lang.Object o,
java.lang.String formatdef)
SchemaIdescribe in interface SchemaIdescribe in class SchemaWrapperpublic java.lang.String describe(java.lang.Object o)
SchemaIdescribe in interface SchemaIdescribe in class SchemaWrapperpublic java.util.List<ScriptImport> getDefaultImports()
getDefaultImports in interface SchemaIgetDefaultImports in class SchemaWrapperpublic AbstractScript getScript()
SchemaIgetScript in interface SchemaIgetScript in class SchemaWrapperpublic AbstractScript getScript(java.lang.String _language)
getScript in interface SchemaIgetScript in class SchemaWrapperpublic AbstractScript getSubScript()
getSubScript in interface SchemaIgetSubScript in class SchemaWrapperpublic AbstractScript getSubScript(java.lang.String language)
getSubScript in interface SchemaIgetSubScript in class SchemaWrapperpublic AbstractScript getSubScript(java.util.List<ScriptImport> additionalImports)
getSubScript in interface SchemaIgetSubScript in class SchemaWrapperpublic AbstractScript getSubScript(java.util.List<ScriptImport> additionalImports, java.lang.String language)
getSubScript in interface SchemaIgetSubScript in class SchemaWrapperpublic AbstractScript getSubScript(java.util.List<ScriptImport> additionalImports, java.lang.Class baseClass)
getSubScript in interface SchemaIgetSubScript in class SchemaWrapperpublic AbstractScript getSubScript(java.util.List<ScriptImport> additionalImports, java.lang.Class baseClass, java.lang.String language)
getSubScript in interface SchemaIgetSubScript in class SchemaWrapperpublic void flushCaches()
InstrumentingSchemaIflushCaches in interface InstrumentingSchemaIpublic VirtualEntity addVirtualEntity(BasicEntityI baseEntity, java.lang.String name)
InstrumentingSchemaIBOI.getEntity()
or SchemaI.getEntityForClass(java.lang.Class), but the virtual entity
when using SchemaI.getEntityForObject(java.lang.Object).
Adding virtual properties to these is allowed, e.g. to create virtual namespaces for otherwise clashing
attribute definitions.addVirtualEntity in interface InstrumentingSchemaIbaseEntity - a nonnull BasicEntityI instance to add the virtualEntity to.name - the name of the VirtualEntity to create, nonnull.public VirtualEntity addVirtualEntity(java.lang.String baseEntityName, java.lang.String name)
InstrumentingSchemaIaddVirtualEntity in interface InstrumentingSchemaIbaseEntityName - the name of the EntityI instance to add this entity to.name - the name of the VirtualEntity to create, nonnull.public java.util.List<EntityI> getVirtualSubEntityList(EntityI baseEntity)
getVirtualSubEntityList in interface InstrumentingSchemaIpublic java.util.List<EntityI> getVirtualSubEntityList(java.lang.String baseEntityName)
getVirtualSubEntityList in interface InstrumentingSchemaIpublic boolean hasVirtualSubEntities(EntityI baseEntity)
hasVirtualSubEntities in interface InstrumentingSchemaIpublic boolean hasVirtualSubEntities(java.lang.String baseEntityName)
hasVirtualSubEntities in interface InstrumentingSchemaIpublic void addDefinerFuture(java.util.concurrent.Future f)
addDefinerFuture in interface InstrumentingSchemaIpublic void waitForDefinerCompilation()
waitForDefinerCompilation in interface InstrumentingSchemaIpublic void addInitFuture(java.util.concurrent.Future f)
addInitFuture in interface InstrumentingSchemaIpublic java.util.List<java.lang.Throwable> waitForCompilationAndGetErrors()
waitForCompilationAndGetErrors in interface InstrumentingSchemaICopyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.