public class CodeSourceImpl extends MetaObject implements ExprCodeSource
| Modifier and Type | Class and Description | 
|---|---|
class  | 
CodeSourceImpl.MethodSource  | 
PersistableDefObject.CustomizationType, PersistableDefObject.PersonalizationTypeExprCodeSource.TypeINHERIT_POLICY_DEFAULT, INHERIT_POLICY_LEGACY, INHERIT_POLICY_STRICT, mComponentClass, mDebug_checkDef_throw, PERSMERGED_BASE_PACKAGE, PUBLISH_TO_BUSINESS_EDITOR_DEFAULT, PUBLISH_TO_BUSINESS_EDITOR_FALSE, PUBLISH_TO_BUSINESS_EDITOR_TRUE, SI_CustIntoStaticDef, SI_InheritPersonalization, SI_InheritPolicy, SI_MessageBundleClass, SI_ResourceBundleDef, SMAX_MetaObjectJIT_PACKAGE_NAME, mDebugToSkipEmptyDocForBug24949961, mEditedProperties, mEditedPropertyExprsDEF_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_EXPRMAPmFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX, RESID_SUFFIXDEFAULT_CODE_SOURCE_NAME, DYNAMIC_CODE_SOURCE_NAME, DYNAMIC_CODESOURCE_DISABLE, DYNAMIC_CODESOURCE_ENABLE, ENTITY_SOURCE_PATH, GLOBAL_SOURCE_PATH, mLogger, MOM_PROTOCOL, PERSONALIZED_CODE_SOURCE_NAME, SCRIPT_CLASS_SOURCE_PATH, TMP_CODE_SOURCE_NAME, VIEW_SOURCE_PATHFLAG_DIRTY, FLAG_EDITABLE, FLAG_FROM_TIP, FLAG_LOAD_BASE, FLAG_LOAD_HL_DEFS, FLAG_MAJOR_VERSION_CHANGED, FLAG_MINOR_VERSION_CHANGED, FLAG_NEW, FLAG_NEW_RECURSE, FLAG_SKIP_WRITE, XML_STATEMENT| Constructor and Description | 
|---|
CodeSourceImpl()  | 
CodeSourceImpl(CodeSourceImpl codeSource)  | 
CodeSourceImpl(java.lang.String className,
              java.lang.String text,
              java.lang.String contentType)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addExpression(ExprDef exprDef)  | 
void | 
applyDiffChildren(DifferDetails dif,
                 DiffResolver resolver)
Applies changes to children defs. 
 | 
int | 
calculateOffset(ExprDef exprDef)  | 
CodeSourceImpl.MethodSource | 
createMethodSource(java.lang.String name,
                  java.util.List<java.lang.String> statements,
                  int lineNumber,
                  int lastLineNumber,
                  int columnNumber,
                  int lastColumnNumber)  | 
ExprDef | 
createScriptClassExprDef()  | 
DifferDetails | 
diffChildren(DiffMergeable docDef,
            DiffMergeable orgDef,
            DifferDetails difDetails)
Performs diff of children defs. 
 | 
static CodeSourceImpl | 
findDefObject(java.lang.String name)  | 
static CodeSourceImpl | 
findDefObjectNoCache(java.lang.String name)  | 
static java.util.Set<java.lang.String> | 
getAllClassNamesFromMDS(int scope)
Returns a set of the script Class names in the MDS repository. 
 | 
java.lang.Object | 
getCacheKey()
The key that should be used to cache the byte code that is generated
 for the code source. 
 | 
java.util.Map<java.lang.String,byte[]> | 
getClassData(java.lang.String name)  | 
java.lang.String | 
getClassName()
The name of the class that will be generated by the compiler for
 the code source. 
 | 
java.lang.String | 
getContentType()  | 
int | 
getDefTypeId()  | 
java.lang.String | 
getDefXMLElementTag()  | 
java.lang.String | 
getDefXMLNameSpace()  | 
java.lang.String | 
getExpressionSource(ExprDef exprDef)  | 
java.lang.String | 
getFullFileName()  | 
java.io.Reader | 
getScriptReader()  | 
java.lang.String | 
getScriptText()  | 
java.lang.String | 
getSourceFileName()
A name that a debugger source manager may be used to lookup the
 CodeSource or the script text associated with the CodeSource. 
 | 
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. 
 | 
void | 
invalidateCache()  | 
static CodeSourceImpl | 
loadFromXML(DefElement xmlElement)  | 
void | 
loadXMLContents(DefElement xmlElement,
               java.lang.String fullName)  | 
ExprDef | 
lookupExprDef(int linenum)  | 
ExprDef | 
lookupExprDef(OwnerType type,
             java.lang.String path)  | 
void | 
removeExpression(ExprDef exprDef)  | 
void | 
resolveDefObject()  | 
protected void | 
setDefForComponent(ComponentObjectImpl comp)  | 
void | 
setParent(NamedObjectImpl parent)
Sets this object's parent. 
 | 
void | 
setScriptText(java.lang.String codeSource)  | 
void | 
setScriptText(java.lang.String text,
             java.lang.String contentType)  | 
void | 
storeClassData(java.lang.String name,
              byte[] classData)  | 
protected void | 
unsetDefForComponent(ComponentObjectImpl comp)  | 
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 
 | 
adjustPropertyMapForWrite, checkEditable, createDefCustomizer, deregisterSessionObject, doneLoadingInternal, extractCustIntoPDef, getDefCustomizerFullFileName, getDefCustomizerFullName, getDefCustomizerName, getEditObject, getEditVersionsAsString, getInheritPersonalizationStrValue, getInheritPersonalizationValue, getInheritPolicyStrValue, getInheritPolicyValue, getMajorVersion, getMessageBundleClass, getMinorVersion, getMsgBundleDef, getPackageDef, getPackageName, getPersDef, getPersDefForEdit, getPersDefNoUpdateCheck, getPersMergedDef, getPublishToBusinessEditorValue, getResourceBundleDef, getResourcePrefix, getScalarDirtyCount, getStaticBaseDefObject, getStaticDef, isAutoMerged, isConvertPDef, isCreateEditPDef, isCustIntoStaticDef, isDefCustomizer, isDefNewBase, isDynamic, isEditable, isInheritPersonalization, isInheritPolicyLegacy, isInheritPolicyStrict, isPublishToBusinessEditor, isScalarDirty, loadDefVersions, loadResourceBundle, lookupDefCustomizer, lookupPublishedDefCustomizer, newComponentClassInstance, objectFound, objectRemoved, registerDefObject, registerSessionDefObject, resetDefResolved, saveXMLContents, setCustIntoStaticDef, setDefCustomizer, setDefScope, setDirty, setEditable, setFullName, setInheritPersonalization, setInheritPersonalizationStrValue, setInheritPolicyStrValue, setMessageBundleClass, setPublishToBusinessEditor, setPublishToBusinessEditorValue, setResourceBundleDef, setScalarDirty, setupDefWriterFromMO, writeXMLContentsaddChildren, callFinishedLoading, ensureVariableManager, finishedLoading, getAdfmConfigStartupProperty, getAllProperties, getBaseDefObject, getBooleanAdfmConfigProperty, getVariableManager, getVarMgrParents, hasVariables, isDeprecated, isFromCustomization, loadProperties, loadVariables, resolvePropertyRaw, resolveReferences, setBaseDefObject, setBaseDefObject, setNameaddDefImport, addExtendedDefObject, addSavedDocName, allocatePDef, allocatePropertyMap, allocatePropertyMapForEdits, applyDiffContents, baseIsWriteObject, beginDiffObjects, buildChildName, buildFileName, checkEditableWithDefWriter, checkStructWithOld, close, createEditPDef, createFromXML, deregisterDefObject, deregisterHLDef, diffChildrenHLDefs, diffChildrenProperties, diffContents, diffObjects, ensureDifferDetails, ensureDifferSkip, findDefImport, forgetChanges, getBaseDir, getBasePackage, getChildren, getDefImports, getDefManager, getDefTypeName, getDefWriter, getDifferSkip, getEditedPropertiesMap, getEditedPropertyExpressionsMap, getEditedPropertyMap, getExtendedDefObjectsInternal, getFileName, getFullDirName, getHLDefMap, getIdentificationAttributeName, getMergeableFullName, getMergeableName, getOrigObject, getPropertyMap, getPropertyNamesSet, getSavedDocNames, getSessionSyncLock, getSubstitutedNames, getSyncLock, guaranteePath, hasExtendedDefObjects, includeCustomizationLayerInfo, isCustomizationEnabled, isCustomizationEnabled, isDirty, isFromTip, isLoadBase, isLoadHLDefs, isMajorVersionChanged, isMinorVersionChanged, isNew, isNewRecurse, isPersonalizationEnabled, isPersonalizationEnabled, isPropertyExpression, isSaveToJSON, isSkipWrite, isWriteObject, loadDefImports, loadDefObject, loadXMLContentsNoResolve, lockDefinitionContext, lookupHLDef, makeNew, mergeChanges, mergeEditedPropertiesForJSON, mergePropertyMap, postSaveContents, readJSONObject, reapplyChanges, registerClass, registerHLDef, registerSiteDefObject, reloadFromXMLContents, remove, removeAndDelete, removeDefImport, removeExtendedDefObject, removeProperty, saveJSONContents, setCustomizationEnabled, setCustomizationEnabled, setDefaultBaseDir, setDefMgr, setEditableFlag, setEditableObject, setForRuntime, setFullNameInternal, setLoadBase, setLoadHLDefs, setMajorVersionChanged, setNew, setNewRecurse, setOrigObject, setPersonalizationEnabled, setPersonalizationEnabled, setProperty, setPropertyExpression, setPropertyMap, setSkipWrite, setWholeDefDirty, setWholeDefNew, staticUpdateChildrenList, transferDefChangesInto, unlockDefinitionContext, updateChildObject, updateChildrenList, updateMdsKeyFromTip, verifyVersion, verifyVersionNullCheck, writeHeaderForNew, writeJSONContents, writeObject, writeVersionaddPropertySetName, enableUpdateCheck, getAllExtendedDefObjects, getContainerDef, getContainerName, getDefinitionState, getDefScope, getExtendedDefObjects, getMdsKey, getMdsReference, getMdsReferenceName, getPropertySetName, getPropertySetNames, getRootBaseDefObject, isBaseDefFor, isComponentDefinition, isDynamicDefinitionObject, isObjectResolved, isSubtypeOf, isSuppressUpdateCheck, loadCustomProperties, loadPropertiesInMap, loadPropertySetNames, loadSchemaProperties, objectInserted, setMdsKey, setMdsReference, setObjectResolved, setPropertySetName, staticLoadCustomProperties, staticLoadSchemaProperties, suppressUpdateCheckgetFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionDef, getPropertyExpressionsMap, getPropertyExprEval, getRawPropertyValue, getResourcesFromBundle, getStringFromMessageBundle, hasProperty, refreshProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, setPropertiesMap, setPropertiesMap2, setProperty, setPropertyExpressionMap, setRawPropertyValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDefScope, getNamegetNamegetFullNamegetProperty, removeProperty, setPropertypublic CodeSourceImpl()
public CodeSourceImpl(java.lang.String className,
                      java.lang.String text,
                      java.lang.String contentType)
@Concealed public CodeSourceImpl(CodeSourceImpl codeSource)
public void setScriptText(java.lang.String codeSource)
public void setParent(NamedObjectImpl parent)
DefObjectpublic java.lang.String getClassName()
ExprCodeSourcegetClassName in interface ExprCodeSourcepublic java.lang.String getSourceFileName()
ExprCodeSourcegetSourceFileName in interface ExprCodeSourcepublic java.lang.Object getCacheKey()
ExprCodeSourcegetCacheKey in interface ExprCodeSourcepublic ExprDef lookupExprDef(OwnerType type, java.lang.String path)
lookupExprDef in interface ExprCodeSourcepublic ExprDef lookupExprDef(int linenum)
lookupExprDef in interface ExprCodeSource@Concealed public ExprDef createScriptClassExprDef()
public java.lang.String getExpressionSource(ExprDef exprDef)
getExpressionSource in interface ExprCodeSourcepublic void removeExpression(ExprDef exprDef)
removeExpression in interface ExprCodeSourcepublic void addExpression(ExprDef exprDef) throws IllegalImportException
addExpression in interface ExprCodeSourceIllegalImportExceptionpublic int calculateOffset(ExprDef exprDef)
calculateOffset in interface ExprCodeSourcepublic java.util.Map<java.lang.String,byte[]> getClassData(java.lang.String name)
getClassData in interface ExprCodeSourcepublic void storeClassData(java.lang.String name,
                           byte[] classData)
storeClassData in interface ExprCodeSourcepublic boolean hasExpression(ExprDef exprDef)
ExprCodeSourcehasExpression in interface ExprCodeSourceexprDef - an expression def.  If null this will return true
    if the CodeSource defines any expression.public java.io.Reader getScriptReader()
getScriptReader in interface ExprCodeSourcepublic java.lang.String getScriptText()
getScriptText in interface ExprCodeSourcepublic void setScriptText(java.lang.String text,
                          java.lang.String contentType)
public java.lang.String getFullFileName()
getFullFileName in class PersistableDefObject@Concealed public java.lang.String getDefXMLElementTag()
getDefXMLElementTag in interface PersistentDefinitiongetDefXMLElementTag in class PersistableDefObject@Concealed public java.lang.String getXMLElementTag()
PersistentDefinitiongetXMLElementTag in interface PersistentDefinitiongetXMLElementTag in class PersistableDefObject@Concealed public java.lang.String getDefXMLNameSpace()
getDefXMLNameSpace in interface PersistentDefinitiongetDefXMLNameSpace in class DefObjectpublic void writeContents(DefWriter jos)
PersistentDefinitionwriteContents in interface PersistentDefinitionwriteContents in class MetaObjectjos - the Output storage for persistencepublic void writeChildren(DefWriter jos)
PersistentDefinitionwriteChildren in interface PersistentDefinitionwriteChildren in class MetaObjectjos - the Output storage for persistencepublic void resolveDefObject()
resolveDefObject in class MetaObjectpublic int getDefTypeId()
getDefTypeId in class DefObjectprotected void setDefForComponent(ComponentObjectImpl comp)
setDefForComponent in class DefObjectprotected void unsetDefForComponent(ComponentObjectImpl comp)
unsetDefForComponent in class DefObjectpublic static CodeSourceImpl findDefObjectNoCache(java.lang.String name)
public static CodeSourceImpl findDefObject(java.lang.String name)
public void loadXMLContents(DefElement xmlElement, java.lang.String fullName)
loadXMLContents in class MetaObject@Concealed public static CodeSourceImpl loadFromXML(DefElement xmlElement)
public DifferDetails diffChildren(DiffMergeable docDef, DiffMergeable orgDef, DifferDetails difDetails)
DiffMergeabledifDetails 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 DiffMergeablediffChildren in class DefObjectdocDef - 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)
DiffMergeabledif 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(<XML-tag-for-Child1>);
          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 DiffMergeableapplyDiffChildren in class DefObjectpublic ExprCodeSource.Type getType()
getType in interface ExprCodeSourcepublic java.lang.String getContentType()
getContentType in interface ExprCodeSourcepublic static java.util.Set<java.lang.String> getAllClassNamesFromMDS(int scope)
@Concealed public CodeSourceImpl.MethodSource createMethodSource(java.lang.String name, java.util.List<java.lang.String> statements, int lineNumber, int lastLineNumber, int columnNumber, int lastColumnNumber)
public void invalidateCache()
invalidateCache in interface ExprCodeSource