Package org.fife.rsta.ac.js.ast.type
Class TypeDeclarationFactory
java.lang.Object
org.fife.rsta.ac.js.ast.type.TypeDeclarationFactory
TypeDeclarationFactory contains cache of TypeDeclarations for to make the
lookup of JavaScript types as efficient as possible.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddType(String name, TypeDeclaration dec) booleanAnswers the question whether an object can be instantiated (i.e.convertJavaScriptType(String lookupName, boolean qualified) The API may have its own types, so these need converting back to JavaScript types e.g.getClassName(String lookup) protected Stringprivate StringgetTypeDeclaration(String name) booleanReturns whether the qualified name is a built-in JavaScript typevoidremoveType(String name) Removes declaration type from type cachesetTypeDeclarationVersion(String ecmaVersion, boolean xmlSupported, boolean client)
-
Field Details
-
ecma
-
-
Constructor Details
-
TypeDeclarationFactory
public TypeDeclarationFactory()
-
-
Method Details
-
setTypeDeclarationVersion
-
getDefaultECMAVersion
- Returns:
- Default base ECMA implementation
-
getAllJavaScriptTypes
-
removeType
Removes declaration type from type cache- Parameters:
name- name of type declaration
-
isJavaScriptType
Returns whether the qualified name is a built-in JavaScript type- Parameters:
td- The type declaration to check.- Returns:
- Whether it is a built-in JS type.
-
getTypeDeclaration
- Parameters:
name-- Returns:
- Lookup type declaration from name. If the
TypeDeclarationcannot be found, then lookup using reserve lookup
-
getJSTypeDeclarationAsString
- Parameters:
name- of TypeDeclaration to lookup- Returns:
- lookup
TypeDeclarationand return the JavaScript name
-
convertJavaScriptType
The API may have its own types, so these need converting back to JavaScript types e.g. JSString == String, JSNumber == Number -
getDefaultTypeDeclaration
- Returns:
- default type declaration - ANY
-
addType
-
getClassName
- Throws:
RuntimeException
-
getECMAScriptObjects
- Returns:
- a list of ECMA JavaScriptObjects
-
canJavaScriptBeInstantiated
Answers the question whether an object can be instantiated (i.e. has a constructor)- Parameters:
name- name of class to test
-