Package sc.lang.java
Class Definition
- java.lang.Object
-
- sc.lang.SemanticNode
-
- sc.lang.java.JavaSemanticNode
-
- sc.lang.java.Definition
-
- All Implemented Interfaces:
ISemanticNode
,IDefinition
,ILifecycle
- Direct Known Subclasses:
Statement
public abstract class Definition extends JavaSemanticNode implements IDefinition
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class sc.lang.java.JavaSemanticNode
JavaSemanticNode.DepTypeCtx, JavaSemanticNode.DepTypeMode, JavaSemanticNode.MemberCache, JavaSemanticNode.MemberType
-
-
Field Summary
Fields Modifier and Type Field Description SemanticNodeList<java.lang.Object>
modifiers
Definition
overrides
-
Fields inherited from class sc.lang.java.JavaSemanticNode
debugDisablePrettyToString, STOP_SEARCHING_SENTINEL
-
Fields inherited from class sc.lang.SemanticNode
debugDiffTrace, initialized, PARENT_NODE_PROPERTY, parentNode, PARSE_NODE_PROPERTY, parseletId, parseNode, parseNodeInvalid, processed, started, transformed, validated
-
Fields inherited from interface sc.lang.ISemanticNode
CopyAll, CopyIndependent, CopyInitLevels, CopyNormal, CopyParseNode, CopyReplace, CopyState, CopyTransformed, SkipParseNode
-
-
Constructor Summary
Constructors Constructor Description Definition()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addInheritedAnnotationProcessor(IAnnotationProcessor process, java.lang.String annotName)
Overriddenvoid
addModifier(java.lang.Object modifier)
Definition
deepCopy(int options, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> oldNewMap)
Performs a deep copy of the semantic node tree.AccessLevel
getAccessLevel(boolean explicitOnly)
java.lang.Object
getAnnotation(java.lang.String annotationName, boolean checkModified)
java.util.Map<java.lang.String,java.lang.Object>
getAnnotations()
static java.lang.String
getAnnotationValueKey(java.lang.String typeName, java.lang.String ident)
java.util.List<java.lang.Object>
getComputedModifiers()
IDefinitionProcessor[]
getDefinitionProcessors()
java.lang.String
getEnclosingTypeName()
This is here specifically for serializing the enclosingTypeName as part of the Definition in js.layerjava.lang.Object[]
getExtraModifiers()
AccessLevel
getInternalAccessLevel()
int
getModifierFlags()
Used to extract just the important modifiers into a single integer for client/server meta-data synchronizationjava.util.List<java.lang.Object>
getRepeatingAnnotation(java.lang.String annotationName)
sc.lang.sc.ScopeModifier
getScope()
ScopeDefinition
getScopeDefinition()
java.lang.String
getScopeName()
sc.lang.sc.IScopeProcessor
getScopeProcessor()
boolean
hasAnnotation(java.lang.String annotName)
boolean
hasModifier(java.lang.String modifier)
void
init()
boolean
isDefaultSync()
boolean
mergeModifiers(java.lang.Object overridden, boolean replace, boolean mergeDefaultModifiers)
java.lang.String
modifiersToString(boolean includeAnnotations, boolean includeAccess, boolean includeFinal, boolean includeScopes, boolean absolute, JavaSemanticNode.MemberType type)
Returns the a specific set of of modifiers in string form - including annotations, access, final, or scopes with flags.boolean
needsTransform()
void
process()
After validate, before transformprotected void
processModifiers(java.util.List<java.lang.Object> modifiers)
void
removeAnnotation(java.lang.String annotationName)
void
setAnnotations(java.util.Map<java.lang.String,java.lang.Object> res)
void
setModifierFlags(int val)
void
start()
void
startModifiers()
boolean
transform(ILanguageModel.RuntimeType runtime)
All definitions share the ability to inherit their definitions.boolean
transformDefaultModifier()
boolean
useDefaultModifier()
void
validate()
-
Methods inherited from class sc.lang.java.JavaSemanticNode
addDependentType, addNodeCompletions, applyPartialValue, canInsertStatementBefore, declaresConstructor, definesConstructor, definesMember, definesMethod, definesType, detectCycles, displayError, displayFormattedError, displayTypeError, displayVerboseWarning, displayWarning, findMember, findMemberOwner, findMethod, findStatement, findType, findType, getDependencyDisabledText, getEnclosingBlockStatement, getEnclosingIMethod, getEnclosingIType, getEnclosingMethod, getEnclosingMethod, getEnclosingStatement, getEnclosingTag, getEnclosingTemplate, getEnclosingType, getExecMode, getImportedTypeName, getJavaLanguage, getJavaModel, getLayeredSystem, getMessageString, getRootTag, getRootType, getStructuralEnclosingType, isCollapsibleNode, isDynamicType, isReferenceValueObject, isStatic, needsDataBinding, refreshNode, runtimeError, suggestCompletions, toFileString, toGenerateString, transformTemplate, visitTypeReferences
-
Methods inherited from class sc.lang.SemanticNode
changeLanguage, clearInitialized, clearParseNode, clearStarted, computeNearString, containsChild, deepEquals, diffNode, ensureValidated, equals, formatLeftParenDelegateToParent, formatSpaceBeforeAngleBracket, getAnyChildParseNode, getChildAtIndex, getChildNestingDepth, getEnclosingSrcStatement, getLanguageModel, getNestingDepth, getNodeCount, getNodeErrorRange, getNodeErrorText, getNodeWarningText, getNotFoundError, getParentNode, getParseErrorNode, getParseletId, getParseNode, getRootNode, getStartIndex, getStopSemanticProps, getTransformed, getUserVisibleName, hasErrors, hashCode, indexOfChild, isInitialized, isParseNodeValid, isProcessed, isSemanticChildValue, isSemanticProperty, isSemanticProperty, isStarted, isTrailingSrcStatement, isValidated, regenerate, regenerateIfTracking, removeChild, replaceChild, restoreParseNode, restoreParseNode, sameSrcLocation, serialize, setParentNode, setParseErrorNode, setParselet, setParseletId, setParseNode, setParseNodeValid, setProperty, setProperty, spaceAfterParen, stop, styleNode, styleNode, toDeclarationString, toDefinitionString, toDefinitionString, toDefinitionString, toHeaderString, toLanguageString, toLanguageString, toLocationString, toLocationString, toLocationString, toModelString, toModelString, toSafeLanguageString, validateParseNode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface sc.lang.java.IDefinition
getEnclosingIType
-
-
-
-
Field Detail
-
modifiers
public SemanticNodeList<java.lang.Object> modifiers
-
overrides
public transient Definition overrides
-
-
Method Detail
-
init
public void init()
- Specified by:
init
in interfaceILifecycle
- Overrides:
init
in classSemanticNode
-
startModifiers
public void startModifiers()
-
start
public void start()
- Specified by:
start
in interfaceILifecycle
- Overrides:
start
in classSemanticNode
-
validate
public void validate()
- Specified by:
validate
in interfaceILifecycle
- Overrides:
validate
in classSemanticNode
-
addInheritedAnnotationProcessor
protected void addInheritedAnnotationProcessor(IAnnotationProcessor process, java.lang.String annotName)
Overridden
-
processModifiers
protected void processModifiers(java.util.List<java.lang.Object> modifiers)
-
process
public void process()
Description copied from interface:ISemanticNode
After validate, before transform- Specified by:
process
in interfaceILifecycle
- Specified by:
process
in interfaceISemanticNode
- Overrides:
process
in classSemanticNode
-
getScopeName
public java.lang.String getScopeName()
-
getScopeDefinition
public ScopeDefinition getScopeDefinition()
-
getScope
public sc.lang.sc.ScopeModifier getScope()
-
getScopeProcessor
public sc.lang.sc.IScopeProcessor getScopeProcessor()
-
getDefinitionProcessors
public IDefinitionProcessor[] getDefinitionProcessors()
-
isDefaultSync
public boolean isDefaultSync()
-
hasModifier
public boolean hasModifier(java.lang.String modifier)
- Specified by:
hasModifier
in interfaceIDefinition
-
addModifier
public void addModifier(java.lang.Object modifier)
-
getInternalAccessLevel
public AccessLevel getInternalAccessLevel()
-
getExtraModifiers
public java.lang.Object[] getExtraModifiers()
-
getAccessLevel
public AccessLevel getAccessLevel(boolean explicitOnly)
- Specified by:
getAccessLevel
in interfaceIDefinition
-
getComputedModifiers
public java.util.List<java.lang.Object> getComputedModifiers()
-
modifiersToString
public java.lang.String modifiersToString(boolean includeAnnotations, boolean includeAccess, boolean includeFinal, boolean includeScopes, boolean absolute, JavaSemanticNode.MemberType type)
Description copied from interface:IDefinition
Returns the a specific set of of modifiers in string form - including annotations, access, final, or scopes with flags. Used for generating the modifiers string for one definition generated from another (e.g. a setX method from a field) If absoluteTypeNames is true, the absolute path of annotations is used. If filterType is not null, only annotations appropriate for the given member type are included. If you are generating code from a field for a setX method, you'd set a filter type of MemberType.Method.- Specified by:
modifiersToString
in interfaceIDefinition
-
getAnnotation
public java.lang.Object getAnnotation(java.lang.String annotationName, boolean checkModified)
- Specified by:
getAnnotation
in interfaceIDefinition
-
getRepeatingAnnotation
public java.util.List<java.lang.Object> getRepeatingAnnotation(java.lang.String annotationName)
- Specified by:
getRepeatingAnnotation
in interfaceIDefinition
-
hasAnnotation
public boolean hasAnnotation(java.lang.String annotName)
-
removeAnnotation
public void removeAnnotation(java.lang.String annotationName)
-
mergeModifiers
public boolean mergeModifiers(java.lang.Object overridden, boolean replace, boolean mergeDefaultModifiers)
-
needsTransform
public boolean needsTransform()
- Specified by:
needsTransform
in interfaceISemanticNode
- Overrides:
needsTransform
in classSemanticNode
-
transformDefaultModifier
public boolean transformDefaultModifier()
-
transform
public boolean transform(ILanguageModel.RuntimeType runtime)
All definitions share the ability to inherit their definitions. They must set the "overrides" property when they figure out if they are replacing another definition.- Specified by:
transform
in interfaceISemanticNode
- Overrides:
transform
in classSemanticNode
-
useDefaultModifier
public boolean useDefaultModifier()
-
deepCopy
public Definition deepCopy(int options, java.util.IdentityHashMap<java.lang.Object,java.lang.Object> oldNewMap)
Description copied from interface:ISemanticNode
Performs a deep copy of the semantic node tree. Subclasses should do their own copy implementation to decide what else to copy. Uses the copy options flags above. The default, with 0, just copies the semantic node information so you get a new tree like's it parsed but without parse node info. Use that mode only if you want to throw away the original source and regenerate it all from scratch. Otherwise, you can copy the parse tree as well. If you want to copy the semantic node's initial resolved state - including it's init/start, etc. and whatever the subclass adds to that copy, use CopyState or CopyNormal - for both parse nodes and state.- Specified by:
deepCopy
in interfaceISemanticNode
- Overrides:
deepCopy
in classSemanticNode
-
setAnnotations
public void setAnnotations(java.util.Map<java.lang.String,java.lang.Object> res)
-
getAnnotations
public java.util.Map<java.lang.String,java.lang.Object> getAnnotations()
- Specified by:
getAnnotations
in interfaceIDefinition
-
getAnnotationValueKey
public static java.lang.String getAnnotationValueKey(java.lang.String typeName, java.lang.String ident)
-
setModifierFlags
public void setModifierFlags(int val)
-
getModifierFlags
public int getModifierFlags()
Used to extract just the important modifiers into a single integer for client/server meta-data synchronization
-
getEnclosingTypeName
public java.lang.String getEnclosingTypeName()
This is here specifically for serializing the enclosingTypeName as part of the Definition in js.layer
-
-