new Type(typeSpec, superType, interfaces, data)
- Description:
A BajaScript Type.
This Constructor shouldn't be invoked directly.
Type is an inner class. To access a Type please use baja.lt.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
typeSpec |
String | |
superType |
String | |
interfaces |
Array.<String> | |
data |
Object |
Extends
Methods
equals(obj) → {Boolean}
- Description:
Test for equality.
- Source:
- Overrides:
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
value to test for equality. |
Returns:
- Type
- Boolean
getDisplayName(cxopt) → {Promise.<string>|string}
- Description:
Resolves to the type display name for this type.
Attempts to look up the lexicon value for the given type if context is
provided. If not found, the display name is given as the type name with
spaces added between words based upon capital letters.If no context provided, it will return the friendly version of the type
name.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
cx |
Object |
<optional> |
Returns:
- Type
- Promise.<string> | string
getIcon() → {baja.Icon}
Returns:
- Type
- baja.Icon
getInstance()
- Description:
Return an instance of the Type.
A Type may have an Function Constructor associated with it. If a Constructor
is found with this Type, it is used to return an instance.If a Constructor can't be found on this Type, then the Super Types
are inspected and the first Constructor found is used instead.
This provides an elegant 'dynamic typing' mechanism whereby a
Constructor is not needed for every single Type.If the Type is a concrete
SimpleorSingleton, then the
DEFAULTproperty on the constructor is returned.
- Source:
Throws:
-
if an instance of the Type can't be created
(e.g. if the Type is an interface, is abstract, or if no
constructor can be found). - Type
- Error
Returns:
instance of Type.
getInterfaces() → {Array}
- Description:
Return an array of interfaces Types implemented by this Type.
- Source:
Returns:
an array of interface types (all Type)
- Type
- Array
getModuleName() → {String}
Returns:
module name.
- Type
- String
getSuperType() → {Type}
Returns:
Super Type or null if not available
- Type
- Type
getTypeName() → {String}
Returns:
type name.
- Type
- String
getTypeSpec() → {String}
- Description:
Return the full Type Specification for the Type (
moduleName:typeName).
- Source:
Returns:
type spec.
- Type
- String
is(type) → {Boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
type |
String | Type | this can be an instance of a Type object |
Returns:
true if this Type polymorphically matches the other.
- Type
- Boolean
isAbstract() → {Boolean}
Returns:
- Type
- Boolean
isAction() → {Boolean}
Returns:
- Type
- Boolean
isComplex() → {Boolean}
Returns:
- Type
- Boolean
isComponent() → {Boolean}
Returns:
- Type
- Boolean
isFrozenEnum() → {Boolean}
Returns:
- Type
- Boolean
isInterface() → {Boolean}
Returns:
- Type
- Boolean
isLink() → {Boolean}
Returns:
- Type
- Boolean
isNumber() → {Boolean}
Returns:
- Type
- Boolean
isOrdScheme() → {Boolean}
Returns:
- Type
- Boolean
isSimple() → {Boolean}
Returns:
- Type
- Boolean
isSingleton() → {Boolean}
Returns:
- Type
- Boolean
isStruct() → {Boolean}
Returns:
- Type
- Boolean
isTopic() → {Boolean}
Returns:
- Type
- Boolean
isTransient() → {Boolean}
Returns:
- Type
- Boolean
isValue() → {Boolean}
Returns:
- Type
- Boolean
toString() → {String}
Returns:
type spec
- Type
- String
valueOf() → {*}
- Description:
Return the inner value of the object.
By default the object's instance is returned.
- Source:
- Inherited From:
Returns:
the inner value of the object or just the object's instance.
- Type
- *