CrxOop CrxOop: Bringing Object Oriented Programming, and Proper Prototype Based Programming, To Javascript
The aim of the library documented below is to provide developers with a solution to allow development using interfaces and classes as they are known in other object oriented programming (OOP) languages such as C++, C#, Java and PHP. Further more, V1.4 introduces structures, a generalization of the concept of prototypal inheritance, known here as POBP.
Subject
Body*
Email
SUBMIT CLOSE
Menu

7.7 crxOop.isStructureRegistered

crxOop.isStructureRegistered can be used to check during run time whether a structure has been registered or not. The first parameter can be either a structure definition object (object), or a structure name (string).

JS (Tree)
crx_registerStructure("ExampleStructure1",
{
});

crx_registerStructure("ExampleStructure2",
{
});

console.log((crxOop.isStructureRegistered("ExampleStructure1") ? "true" : "false"));
console.log((crxOop.isStructureRegistered("ExampleStructure2") ? "true" : "false"));
console.log((crxOop.isStructureRegistered("ExampleStructure3") ? "true" : "false"));
true
true
false
JS (Verbose)
crx_registerStructure("ExampleStructure1",
{
   "VERBOSE": 1
});

crx_registerStructure("ExampleStructure2",
{
   "VERBOSE": 1
});

console.log((crxOop.isStructureRegistered("ExampleStructure1") ? "true" : "false"));
console.log((crxOop.isStructureRegistered("ExampleStructure2") ? "true" : "false"));
console.log((crxOop.isStructureRegistered("ExampleStructure3") ? "true" : "false"));
true
true
false