public class CodeSourceImpl extends PersistableDefObject implements ExprCodeSource
Modifier and Type | Class and Description |
---|---|
class |
CodeSourceImpl.MethodSource |
PersistableDefObject.CustomizationType, PersistableDefObject.PersonalizationType
ExprCodeSource.Type
mEditedProperties, mEditedPropertyExprs
DEF_MDS_CLIENT_KEY, DEF_SCOPE_ALL, DEF_SCOPE_PERS, DEF_SCOPE_SESSION, DEF_SCOPE_SHARED, DEF_SCOPE_SITE, DEF_SCOPE_USER, mBaseDefObject, mExtendedDefObjects, mObjectResolved, PERSDEF_MDS_CLIENT_KEY, PROPERTY_EXPRMAP
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX, RESID_SUFFIX
DEFAULT_CODE_SOURCE_NAME, DYNAMIC_CODE_SOURCE_NAME, mLogger, PERSONALIZED_CODE_SOURCE_NAME, TMP_CODE_SOURCE_NAME
XML_STATEMENT
Modifier and Type | Method and Description |
---|---|
boolean |
addExpression(ExprDef exprDef) |
void |
applyDiffChildren(DifferDetails dif,
DiffResolver resolver)
Applies changes to children defs.
|
CodeSourceImpl.MethodSource |
createMethodSource(java.lang.String name,
java.util.List<java.lang.String> statements,
int lineNumber,
int lastLineNumber,
int columnNumber,
int lastColumnNumber) |
DifferDetails |
diffChildren(DiffMergeable docDef,
DiffMergeable orgDef,
DifferDetails difDetails)
Performs diff of children defs.
|
java.lang.Object |
getCacheKey()
The key that should be used to cache the byte code that is generated
for the code source.
|
java.lang.String |
getClassName()
The name of the class that will be generated by the compiler for
the code source.
|
java.lang.String |
getContentType() |
java.lang.String |
getDefXMLElementTag() |
java.lang.String |
getDefXMLNameSpace() |
java.lang.String |
getExpressionSource(ExprDef exprDef) |
java.io.Reader |
getScriptReader() |
java.lang.String |
getScriptText() |
ExprCodeSource.Type |
getType() |
java.lang.String |
getXMLElementTag()
Returns a piece of static info for the type of object this is invoked
upon.
|
boolean |
hasExpression(ExprDef exprDef)
Return true if the CodeSource defines an expression for the specified
expresmion.
|
static CodeSourceImpl |
loadFromXML(DefElement xmlElement) |
void |
loadXMLContents(DefElement xmlElement,
java.lang.String fullName) |
ExprDef |
lookupExprDef(OwnerType type,
java.lang.String path) |
boolean |
removeExpression(ExprDef exprDef) |
void |
setParent(NamedObjectImpl parent)
Sets this object's parent.
|
void |
writeChildren(DefWriter jos)
Writes the Object's children to the Persistent storage
|
void |
writeContents(DefWriter jos)
Objects should write their persistence output in this method
|
addDefImport, addExtendedDefObject, addSavedDocName, adjustPropertyMapForWrite, allocatePropertyMap, allocatePropertyMapForEdits, applyDiffContents, beginDiffObjects, checkEditable, checkStructWithOld, close, createFromXML, deregisterDefObject, deregisterSessionObject, diffContents, diffObjects, ensureDifferDetails, findDefImport, finishedLoading, getBaseDir, getBasePackage, getDefImports, getDefManager, getDefTypeName, getDefWriter, getEditedPropertiesMap, getEditedPropertyExpressionsMap, getEditedPropertyMap, getEditObject, getEditVersionsAsString, getExtendedDefObjectsInternal, getFileName, getFullDirName, getFullFileName, getMajorVersion, getMergeableFullName, getMergeableName, getMinorVersion, getOrigObject, getPropertyMap, getSavedDocNames, getSessionSyncLock, getSubstitutedNames, getSyncLock, guaranteePath, hasExtendedDefObjects, includeCustomizationLayerInfo, isCustomizationEnabled, isCustomizationEnabled, isDirty, isEditable, isFromTip, isLoadBase, isMajorVersionChanged, isMinorVersionChanged, isNew, isPersonalizationEnabled, isPersonalizationEnabled, isPropertyExpression, loadDefImports, loadDefObject, loadXMLContentsNoResolve, lockDefinitionContext, mergeChanges, mergePropertyMap, objectRemoved, reapplyChanges, registerClass, registerDefObject, registerSessionDefObject, registerSiteDefObject, remove, removeAndDelete, removeDefImport, removeExtendedDefObject, removeProperty, saveXMLContents, setCustomizationEnabled, setCustomizationEnabled, setDefaultBaseDir, setDefMgr, setDirty, setEditable, setEditableFlag, setEditableObject, setFullName, setFullNameInternal, setLoadBase, setMajorVersionChanged, setNew, setOrigObject, setPersonalizationEnabled, setPersonalizationEnabled, setProperty, setPropertyExpression, setPropertyMap, setupDefWriterFromMO, staticUpdateChildrenList, unlockDefinitionContext, updateChildrenList, updateMdsKeyFromTip, verifyVersion, verifyVersionNullCheck, writeHeaderForNew, writeObject, writeVersion, writeXMLContents
addPropertySetName, enableUpdateCheck, getAllExtendedDefObjects, getBaseDefObject, getContainerDef, getContainerName, getDefinitionState, getDefScope, getExtendedDefObjects, getMdsKey, getMdsReference, getPropertySetName, getPropertySetNames, getRootBaseDefObject, isBaseDefFor, isComponentDefinition, isDeprecated, isDynamicDefinitionObject, isObjectResolved, isSubtypeOf, isSuppressUpdateCheck, loadCustomProperties, loadProperties, loadPropertiesInMap, loadPropertySetNames, loadSchemaProperties, resolveReferences, setBaseDefObject, setBaseDefObject, setDefScope, setMdsKey, setMdsReference, setName, setObjectResolved, setPropertySetName, staticLoadCustomProperties, staticLoadSchemaProperties, suppressUpdateCheck
getAllProperties, getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionDef, getPropertyExpressionsMap, getPropertyNamesSet, getRawPropertyValue, getResourcesFromBundle, getStringFromMessageBundle, refreshProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, resolvePropertyRaw, setPropertiesMap, setPropertiesMap2, setProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getScriptText
getFullName
public void setParent(NamedObjectImpl parent)
DefinitionObject
setParent
in class DefinitionObject
parent
- the named object that is to be the parent of this object.public java.lang.String getClassName()
ExprCodeSource
getClassName
in interface ExprCodeSource
public java.lang.Object getCacheKey()
ExprCodeSource
getCacheKey
in interface ExprCodeSource
public ExprDef lookupExprDef(OwnerType type, java.lang.String path)
lookupExprDef
in interface ExprCodeSource
public java.lang.String getExpressionSource(ExprDef exprDef)
getExpressionSource
in interface ExprCodeSource
public boolean removeExpression(ExprDef exprDef)
removeExpression
in interface ExprCodeSource
public boolean addExpression(ExprDef exprDef)
addExpression
in interface ExprCodeSource
public boolean hasExpression(ExprDef exprDef)
ExprCodeSource
hasExpression
in interface ExprCodeSource
exprDef
- an expression def. If null this will return true
if the CodeSource defines any expression.public java.io.Reader getScriptReader()
getScriptReader
in interface ExprCodeSource
public java.lang.String getScriptText()
getScriptText
in interface ExprCodeSource
@Concealed public java.lang.String getDefXMLElementTag()
getDefXMLElementTag
in interface PersistentDefinition
getDefXMLElementTag
in class PersistableDefObject
@Concealed public java.lang.String getXMLElementTag()
PersistentDefinition
getXMLElementTag
in interface PersistentDefinition
getXMLElementTag
in class PersistableDefObject
@Concealed public java.lang.String getDefXMLNameSpace()
getDefXMLNameSpace
in interface PersistentDefinition
getDefXMLNameSpace
in class PersistableDefObject
public void writeContents(DefWriter jos)
PersistentDefinition
writeContents
in interface PersistentDefinition
writeContents
in class PersistableDefObject
jos
- the Output storage for persistencepublic void writeChildren(DefWriter jos)
PersistentDefinition
writeChildren
in interface PersistentDefinition
writeChildren
in class PersistableDefObject
jos
- the Output storage for persistencepublic void loadXMLContents(DefElement xmlElement, java.lang.String fullName)
loadXMLContents
in class PersistableDefObject
@Concealed public static CodeSourceImpl loadFromXML(DefElement xmlElement)
public DifferDetails diffChildren(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeable
difDetails
and
return it at the end.
For example, if this def has Child1 and Child2, its implementation should look something like:
public DifferDetails diffChildren(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails) { difDetails = diffChildrenChild1(docDef, orgDef, difDetails); difDetails = diffChildrenChild1(docDef, orgDef, difDetails); return difDetails; }
where diffChildrenChild1()
uses DifferChildren
's
helper method diffChildrenList
to diff the child defs.
diffChildren
in interface DiffMergeable
diffChildren
in class PersistableDefObject
docDef
- the document-level definitionorgDef
- the original definition. It could be
null
if the definition did not exist originallydifDetails
- the DifferDetails
that accumulate
the details of diff from the document-level (top-level) defDifferDetails
that has all the details
of diffpublic void applyDiffChildren(DifferDetails dif, DiffResolver resolver)
DiffMergeable
dif
contains the
changes to be applied to the children. For each child def, this method
should first retrieve the diff details for the child, which is of type
DifferChildren
. Then, it should call
DifferChildren.applyDiffChanges(oracle.jbo.mom.DiffChildrenMerge, oracle.jbo.mom.DiffResolver)
to perform
the change operation.
applyChanges()
requires a
DiffChildrenMerge
object, which has the insert,
update, and remove methods. 'this'
def object must
provide implmementation of these operations.
Here is a sample:
public void applyDiffChildren(DifferDetails dif, DiffResolver resolver) { DifferChangeMap detailMap = dif.getDetailMap(); if (detailMap != null) { DifferChildren difChild1 = (DifferChildren) detailMap.getValue(); if (difVCs != null) { DiffChildrenMerge dm = new DiffChildrenMerge() { public void insertChild(Object id, Object value) { .. perform insert op for Child1 .. } public void updateChild(Object id, Object value, Object oldValue) { .. perform update op for Child1 .. } public void removeChild(Object id) { .. perform remove op for Child1 .. } }; difChild1.applyDiffChanges(dm, resolver); } // Similarly for Child2 } }
applyDiffChildren
in interface DiffMergeable
applyDiffChildren
in class PersistableDefObject
public ExprCodeSource.Type getType()
getType
in interface ExprCodeSource
public java.lang.String getContentType()
getContentType
in interface ExprCodeSource
@Concealed public CodeSourceImpl.MethodSource createMethodSource(java.lang.String name, java.util.List<java.lang.String> statements, int lineNumber, int lastLineNumber, int columnNumber, int lastColumnNumber)