Package sc.lang.java
Class TypedMethodExpression
- java.lang.Object
-
- All Implemented Interfaces:
ISemanticNode
,ISrcStatement
,IUserDataNode
,IClassBodyStatement
,IDefinition
,ITypedObject
,IValueNode
,ILifecycle
public class TypedMethodExpression extends IdentifierExpression
The regular IdentifierExpression is used to hold simple method invocations - when arguments != null. This is used when there are type arguments to the method call - e.g. Foo.<Arg1,Arg2>bar();
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class sc.lang.java.IdentifierExpression
IdentifierExpression.IdentifierType
-
Nested classes/interfaces inherited from class sc.lang.java.Statement
Statement.ErrorRangeInfo, Statement.RuntimeStatus
-
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 java.util.List<JavaType>
typeArguments
java.lang.String
typedIdentifier
-
Fields inherited from class sc.lang.java.IdentifierExpression
identifiers, innerCreator
-
Fields inherited from class sc.lang.java.ArgumentsExpression
arguments
-
Fields inherited from class sc.lang.java.Expression
bindingDirection, bindingStatement, inactive, nestedBinding, replacedByStatement, UnknownReferredType
-
Fields inherited from class sc.lang.java.Statement
childNestingDepth, errorArgs, excluded, fromStatement
-
Fields inherited from class sc.lang.java.Definition
modifiers, 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 TypedMethodExpression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
applyPartialValue(java.lang.Object value)
When Parser.enablePartialValues is set, and we do not complete parsing the input we'll have a set of errors which represent model fragments.java.util.List<IString>
getAllIdentifiers()
java.lang.Object
getGenericType()
java.util.List<JavaType>
getMethodTypeArguments()
java.lang.Object
getTypeDeclaration()
boolean
isReferenceInitializer()
boolean
refreshBoundTypes(int flags)
void
start()
void
styleNode(IStyleAdapter adapter)
Styling for identifier expressions is complicated because the information we need to do the styling is at this level, but the elements we are styling are buried down in the parse-tree of this node.java.lang.String
toGenerateString()
int
transformTemplate(int ix, boolean statefulContext)
A pass over the semantic node tree to convert template statements into layer cake statements.-
Methods inherited from class sc.lang.java.IdentifierExpression
addBreakpointNodes, addDependentTypes, addIdentifier, addNodeCompletions, argsToGenerateString, callsSuper, callsSuperMethod, callsThis, canMakeBindable, changeExpressionsThis, changeToRHS, clearStarted, convertPropertyToGetName, convertPropertyToSetName, convertToSetMethod, create, create, createMethodCall, deepCopy, doCastOnConvert, eval, evalBindingArgs, exec, execForRuntime, findClosestMethod, findFromStatement, generateIdentString, getAssignedProperty, getBindingTypeName, getBoundType, getBoundTypeNoParamType, getConstrArgs, getGenericTypeForIdentifier, getIdentifierPathName, getIdentifierType, getIdentifierTypeFromType, getLHSAssignmentTyped, getNodeContainsPart, getNodeErrorRange, getParentReferenceType, getParentReferenceTypeExpression, getQualifiedClassIdentifier, getReferencePropertyName, getReferenceType, getTypeForIdentifier, isConstant, isDeclaredConstant, isGetSetConversionDisabled, isInferredFinal, isInferredSet, isSettableExpr, isSimpleReference, isStaticTarget, makeBindable, markFixedSuper, needsEnclosingClass, needsGetMethod, needsGetSet, needsSetMethod, needsTransform, offset, producesHtml, propagatesInferredType, removeIdentifier, reresolveTypeReference, setAccessTimeForRefs, setAssignment, setBindingInfo, setIdentifier, setIdentifiersFromArgs, setInferredType, setParentNode, setValue, stop, suggestCompletions, transform, transformBindingArgs, transformToJS, validate, visitTypeReferences
-
Methods inherited from class sc.lang.java.ArgumentsExpression
getBodyStatements
-
Methods inherited from class sc.lang.java.Expression
addChildBodyStatements, addInitStatements, applyJSConversion, canInsertStatementBefore, clearInferredType, createBindingParameters, createFromValue, createImportedIdentExpr, evalBinding, evalBindingParameters, evalBindingParametersWithThis, evalDouble, evalLong, formatExprToJS, getAbsoluteGenericTypeName, getGenericArgumentType, getGenericTypeName, getNodeErrorText, getNodeWarningText, getNotFoundError, getPrimitiveValue, getRuntimeClass, getUnwrappedExpr, getUserVisibleName, hasInferredType, initBinding, inNamedPropertyMethod, inObjectGetMethod, inPropertyMethodForDef, isLeafStatement, isReferenceValueObject, isVoidType, needsParenWrapper, parse, toDefinitionString, toLanguageString, toSafeLanguageString, toString, transformBinding
-
Methods inherited from class sc.lang.java.Statement
addMappingForSrcStatement, addMappingForSrcStatement, addMappingForStatement, addMemberByName, addMembersByName, addReturnStatements, addStatementNodeCompletions, addToFileLineIndex, checkFromStatementRef, childIsTopLevelStatement, clearDynFields, clearTransformed, collectConstructorPropInit, collectReferenceInitializers, conflictsWith, displayError, displayFormattedError, displayRangeError, displayTypeError, evalRemoteExprs, execSys, findStatement, formatToJS, getBuildInitExpression, getChildNestingDepth, getComment, getCurrentMethod, getFromStatement, getIndentStr, getNestingDepth, getNumStatementLines, getRuntimeStatus, getSrcStatement, getStatementTerminator, getUserData, hasErrors, initDynStatement, initDynStatement, initDynStatements, isIncompleteStatement, isLabeled, isLineStatement, matchesStatement, modifyDefinition, setComment, setFromStatement, setUserData, updateFromStatementRef
-
Methods inherited from class sc.lang.java.Definition
addInheritedAnnotationProcessor, addModifier, getAccessLevel, getAnnotation, getAnnotations, getAnnotationValueKey, getComputedModifiers, getDefinitionProcessors, getEnclosingTypeName, getExtraModifiers, getInternalAccessLevel, getModifierFlags, getRepeatingAnnotation, getScope, getScopeDefinition, getScopeName, getScopeProcessor, hasAnnotation, hasModifier, init, isDefaultSync, mergeModifiers, modifiersToString, process, processModifiers, removeAnnotation, setAnnotations, setModifierFlags, startModifiers, transformDefaultModifier, useDefaultModifier
-
Methods inherited from class sc.lang.java.JavaSemanticNode
addDependentType, declaresConstructor, definesConstructor, definesMember, definesMethod, definesType, detectCycles, displayVerboseWarning, displayWarning, findMember, findMemberOwner, findMethod, findType, findType, getDependencyDisabledText, getEnclosingBlockStatement, getEnclosingIMethod, getEnclosingIType, getEnclosingMethod, getEnclosingMethod, getEnclosingStatement, getEnclosingTag, getEnclosingTemplate, getEnclosingType, getExecMode, getImportedTypeName, getJavaLanguage, getJavaModel, getLayeredSystem, getMessageString, getRootTag, getRootType, getStructuralEnclosingType, isCollapsibleNode, isDynamicType, isStatic, needsDataBinding, refreshNode, runtimeError, toFileString
-
Methods inherited from class sc.lang.SemanticNode
changeLanguage, clearInitialized, clearParseNode, computeNearString, containsChild, deepEquals, diffNode, ensureValidated, equals, formatLeftParenDelegateToParent, formatSpaceBeforeAngleBracket, getAnyChildParseNode, getChildAtIndex, getEnclosingSrcStatement, getLanguageModel, getNodeCount, getParentNode, getParseErrorNode, getParseletId, getParseNode, getRootNode, getStartIndex, getStopSemanticProps, getTransformed, hashCode, indexOfChild, isInitialized, isParseNodeValid, isProcessed, isSemanticChildValue, isSemanticProperty, isSemanticProperty, isStarted, isTrailingSrcStatement, isValidated, regenerate, regenerateIfTracking, removeChild, replaceChild, restoreParseNode, restoreParseNode, sameSrcLocation, serialize, setParseErrorNode, setParselet, setParseletId, setParseNode, setParseNodeValid, setProperty, setProperty, spaceAfterParen, styleNode, toDeclarationString, toDefinitionString, toDefinitionString, toHeaderString, toLanguageString, toLocationString, toLocationString, toLocationString, toModelString, toModelString, validateParseNode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface sc.lang.java.IDefinition
getEnclosingIType
-
Methods inherited from interface sc.lang.ISemanticNode
changeLanguage, clearInitialized, clearParseNode, containsChild, deepEquals, diffNode, getChildAtIndex, getDependencyDisabledText, getNodeCount, getParentNode, getParseErrorNode, getParseletId, getParseNode, getRootNode, getTransformed, indexOfChild, isInitialized, isParseNodeValid, isSemanticChildValue, isStarted, isTrailingSrcStatement, isValidated, process, refreshNode, regenerate, regenerateIfTracking, removeChild, replaceChild, restoreParseNode, serialize, setParseErrorNode, setParseletId, setParseNode, setParseNodeValid, toHeaderString, toLanguageString, toModelString, validateParseNode
-
-
-
-
Field Detail
-
typedIdentifier
public java.lang.String typedIdentifier
-
typeArguments
public java.util.List<JavaType> typeArguments
-
-
Method Detail
-
getAllIdentifiers
public java.util.List<IString> getAllIdentifiers()
- Overrides:
getAllIdentifiers
in classIdentifierExpression
-
getMethodTypeArguments
public java.util.List<JavaType> getMethodTypeArguments()
- Overrides:
getMethodTypeArguments
in classExpression
-
start
public void start()
- Specified by:
start
in interfaceILifecycle
- Overrides:
start
in classIdentifierExpression
-
isReferenceInitializer
public boolean isReferenceInitializer()
- Overrides:
isReferenceInitializer
in classIdentifierExpression
-
styleNode
public void styleNode(IStyleAdapter adapter)
Description copied from class:IdentifierExpression
Styling for identifier expressions is complicated because the information we need to do the styling is at this level, but the elements we are styling are buried down in the parse-tree of this node. So far this is the only problematic case for Java so we are living with it but adding some features at the parselets level would help. One problem is that the parseNode for the IdentifierExpression may be expression, optExpression or exprStatement. We optionally need to 'drill down' to get the parse-node for the IdentifierExpression, then wrap the output with any parse nodes we skipped before or after. To handle this at the parselet level, we could skip those levels automatically. Another problem is that the path name is split into the first name, then "." followed by each subsequent name so there's an extra bump in the hierarchy to deal with the second and subsequent path-names. We could add a method called - childStyleHandler which is called for each child parse node that produces an array value (in this case, the identifiers array). It would return null for parse nodes which are ignored in styling or 'member' or 'staticMember' as necessary for each segment in the identifiers array. That method would be passed the current parent parse node, the child-index, and the current parse-node so it could go back into the identifier expression and find the right style for that segment of the path-name. It could probaby just unmap the value array and deal with the hierarchy skip so maybe we don't need that much context in that method.- Specified by:
styleNode
in interfaceISemanticNode
- Overrides:
styleNode
in classIdentifierExpression
-
refreshBoundTypes
public boolean refreshBoundTypes(int flags)
- Overrides:
refreshBoundTypes
in classIdentifierExpression
-
transformTemplate
public int transformTemplate(int ix, boolean statefulContext)
Description copied from class:JavaSemanticNode
A pass over the semantic node tree to convert template statements into layer cake statements.- Overrides:
transformTemplate
in classIdentifierExpression
-
toGenerateString
public java.lang.String toGenerateString()
- Overrides:
toGenerateString
in classIdentifierExpression
-
applyPartialValue
public boolean applyPartialValue(java.lang.Object value)
Description copied from class:JavaSemanticNode
When Parser.enablePartialValues is set, and we do not complete parsing the input we'll have a set of errors which represent model fragments. In some cases, it would be nice to put the model together as well as possible for code hinting. This method can append fragments onto it... if so return true.- Overrides:
applyPartialValue
in classIdentifierExpression
-
getTypeDeclaration
public java.lang.Object getTypeDeclaration()
- Specified by:
getTypeDeclaration
in interfaceITypedObject
- Overrides:
getTypeDeclaration
in classIdentifierExpression
-
getGenericType
public java.lang.Object getGenericType()
- Overrides:
getGenericType
in classIdentifierExpression
-
-