Class OOSymbolsSymTypeRelations
java.lang.Object
de.monticore.symbols.oosymbols.types3.OOSymbolsSymTypeRelations
relations for SymTypes of wrt. OOSymbols,
e.g, isEnum, etc.
Mostly used as convenience instead of the required, e.g.,
- checking if a symbol exists
- checking if the symbol is a OOSymbol
- typeDispatch the symbol to the OOSymbols variant
- actually checking a value
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static OOSymbolsSymTypeRelationsprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<SymTypeOfFunction> protected boolean_isClass(SymTypeExpression type) protected booleanprotected boolean_isEnum(SymTypeExpression type) protected booleanprotected boolean_isMethod(SymTypeExpression type) protected booleanstatic Optional<SymTypeOfFunction> Checks if the type is a functional interface and returns the abstract method.protected static OOSymbolsSymTypeRelationsprotected Optional<MethodSymbol> protected Optional<OOTypeSymbol> protected Optional<FieldSymbol> static voidinit()static booleanisClass(SymTypeExpression type) static booleanstatic booleanisEnum(SymTypeExpression type) static booleanisInterface(SymTypeExpression type) static booleanisMethod(SymTypeExpression type) static voidreset()protected static voidsetDelegate(OOSymbolsSymTypeRelations newDelegate) static booleanwhether the source of the type is an enum constant.
-
Field Details
-
LOG_NAME
-
delegate
-
-
Constructor Details
-
OOSymbolsSymTypeRelations
public OOSymbolsSymTypeRelations()
-
-
Method Details
-
isClass
-
_isClass
-
isInterface
-
_isInterface
-
isEnum
-
_isEnum
-
getAbstractFunctionOfFunctionalInterFace
public static Optional<SymTypeOfFunction> getAbstractFunctionOfFunctionalInterFace(SymTypeExpression type) Checks if the type is a functional interface and returns the abstract method. S. JLS 21 9.8- Returns:
- the abstract method of the type iff the type is a functional interface
-
_getAbstractFunctionOfFunctionalInterFace
protected Optional<SymTypeOfFunction> _getAbstractFunctionOfFunctionalInterFace(SymTypeExpression type) -
sourceIsEnumConstant
whether the source of the type is an enum constant. s.a.SymTypeSourceInfo.getSourceSymbol() -
_sourceIsEnumConstant
-
isMethod
-
_isMethod
-
isConstructor
-
_isConstructor
-
getOOTypeSymbolIfAvailable
-
getMethodSymbolIfAvailable
-
getSourceFieldSymbolIfAvailable
-
init
public static void init() -
reset
public static void reset() -
setDelegate
-
getDelegate
-