| java.lang.Object org.openlaszlo.xml.internal.Schema org.openlaszlo.compiler.ViewSchema
ViewSchema | public class ViewSchema extends Schema (Code) | | A schema that describes a Laszlo XML file.
|
Method Summary | |
void | addAttributeDefs(Element sourceElement, String classname, List attributeDefs, CompilationEnvironment env) Add this list of attribute name/type info to the in-core model of the class definitions. | public void | addElement(Element elt, String className, String superclassName, List attributeDefs, CompilationEnvironment env) Add a new element to the attribute type map.
Parameters: elt - the element to add to the map Parameters: superclassName - an element to inherit attribute to type info from. | public boolean | canContainElement(String parentTag, String childTag) Check if a child element can legally be contained in a parent element. | public void | checkInstanceMethodDeclaration(Element elt, String classname, String methodName, CompilationEnvironment env) | public void | checkMethodDeclaration(Element elt, String classname, String methodName, CompilationEnvironment env) | public AttributeSpec | findSimilarAttribute(String className, String attributeName) | public AttributeSpec | getAttributeSpec(String elt, String attrName) Finds the AttributeSpec definition of an attribute, on a class
or by searching up it's parent class chain. | static Type | getAttributeType(String attrName) | public Type | getAttributeType(Element e, String attrName) Returns a value representing the type of an attribute within an
XML element. | public Type | getAttributeType(String elt, String attrName) Returns a value representing the type of an attribute within an
XML element. | public String | getBaseClassname(String className) | AttributeSpec | getClassAttribute(String classname, String attrName) | ClassModel | getClassModel(String elementName) | public String | getSuperclassName(String className) | public Type | getTypeForName(String name) | boolean | hasHTMLContent(Element e) true if this element's content is HTML. | boolean | hasTextContent(Element e) | static boolean | isDocElement(Element e) | static boolean | isHTMLElement(Element e) true if this element is an HTML element, that shouldbe included in the text content of an element that tests truewith hasHTMLContent. | boolean | isInputTextElement(Element e) | boolean | isMouseEventAttribute(String name) | public void | loadSchema(CompilationEnvironment env) | public boolean | methodOverrideAllowed(String classname, String methodName) | public static int | parseColor(String str) | public void | setAttributeType(Element elt, String classname, String attrName, AttributeSpec attrspec) | boolean | supportsTextAttribute(Element e) | public String | toLZX() | public String | toLZX(String indent) |
BOOLEAN_TYPE | final public static Type BOOLEAN_TYPE(Code) | | 'boolean' is compiled the same as an expression type
|
COLOR_TYPE | final public static Type COLOR_TYPE(Code) | | |
CSS_TYPE | final public static Type CSS_TYPE(Code) | | |
EVENT_HANDLER_TYPE | final public static Type EVENT_HANDLER_TYPE(Code) | | Type of event handler bodies.
|
EXPRESSION_TYPE | final public static Type EXPRESSION_TYPE(Code) | | Type of script expressions.
|
INHERITABLE_BOOLEAN_TYPE | final public static Type INHERITABLE_BOOLEAN_TYPE(Code) | | |
METHOD_TYPE | final public static Type METHOD_TYPE(Code) | | |
NUMBER_EXPRESSION_TYPE | final public static Type NUMBER_EXPRESSION_TYPE(Code) | | |
REFERENCE_TYPE | final public static Type REFERENCE_TYPE(Code) | | |
SETTER_TYPE | final public static Type SETTER_TYPE(Code) | | Type of attribute setter function
|
SIZE_EXPRESSION_TYPE | final public static Type SIZE_EXPRESSION_TYPE(Code) | | |
TOKEN_TYPE | final public static Type TOKEN_TYPE(Code) | | Type of tokens.
|
XML_LITERAL | final public static Type XML_LITERAL(Code) | | |
enforceValidIdentifier | public boolean enforceValidIdentifier(Code) | | If true, requires class names to be valid javascript identifiers.
We disable this when defining LZX builtin tags such as "import"
which are reserved javascript tokens.
|
sHex3Pattern | final static Pattern sHex3Pattern(Code) | | |
sHex6Pattern | final static Pattern sHex6Pattern(Code) | | |
sMatcher | final static PatternMatcher sMatcher(Code) | | |
sRGBPattern | final static Pattern sRGBPattern(Code) | | |
addAttributeDefs | void addAttributeDefs(Element sourceElement, String classname, List attributeDefs, CompilationEnvironment env)(Code) | | Add this list of attribute name/type info to the in-core model of the class definitions.
Parameters: sourceElement - the user's LZX source file element that holds class LZX definition Parameters: classname - the class we are defining Parameters: attributeDefs - list of AttributeSpec attribute info to add to the Schema |
addElement | public void addElement(Element elt, String className, String superclassName, List attributeDefs, CompilationEnvironment env)(Code) | | Add a new element to the attribute type map.
Parameters: elt - the element to add to the map Parameters: superclassName - an element to inherit attribute to type info from. May be null. Parameters: attributeDefs - list of attribute name/type defs |
canContainElement | public boolean canContainElement(String parentTag, String childTag)(Code) | | Check if a child element can legally be contained in a parent element.
This works with the class hierarchy as follows:
+ Look up the ClassModel corresponding to the parentTag
+ Check the containsElements table to see if child tag is in there
+ If not, look up the ClassModel of the child tag, and follow up the chain
checking if that name is present in the table
+ If not, ascend up the parent classmodel, and call canContainElement recursively
|
checkInstanceMethodDeclaration | public void checkInstanceMethodDeclaration(Element elt, String classname, String methodName, CompilationEnvironment env)(Code) | | Checks to do when declaring a method on an instance;
Does the class exist?
Does the superclass allow overriding of this method?
|
checkMethodDeclaration | public void checkMethodDeclaration(Element elt, String classname, String methodName, CompilationEnvironment env)(Code) | | Checks to do when declaring a method on a class;
Does the class exist?
Is this a duplicate of another method declaration on this class?
Does the superclass allow overriding of this method?
|
getAttributeSpec | public AttributeSpec getAttributeSpec(String elt, String attrName)(Code) | | Finds the AttributeSpec definition of an attribute, on a class
or by searching up it's parent class chain.
Parameters: elt - an Element name Parameters: attrName - an attribute name the AttributeSpec or null |
getAttributeType | static Type getAttributeType(String attrName)(Code) | | |
getAttributeType | public Type getAttributeType(Element e, String attrName)(Code) | | Returns a value representing the type of an attribute within an
XML element. Unknown attributes have Expression type.
Parameters: e - an Element Parameters: attrName - an attribute name a value represting the type of the attribute's |
getAttributeType | public Type getAttributeType(String elt, String attrName) throws UnknownAttributeException(Code) | | Returns a value representing the type of an attribute within an
XML element. Unknown attributes have Expression type.
Parameters: elt - an Element name Parameters: attrName - an attribute name a value represting the type of the attribute's |
getBaseClassname | public String getBaseClassname(String className)(Code) | | the base class of a user defined class |
getClassAttribute | AttributeSpec getClassAttribute(String classname, String attrName)(Code) | | Does this class or its ancestors have this attribute declared for it?
|
hasHTMLContent | boolean hasHTMLContent(Element e)(Code) | | true if this element's content is HTML. |
hasTextContent | boolean hasTextContent(Element e)(Code) | | true if this element content is interpreted as text |
isDocElement | static boolean isDocElement(Element e)(Code) | | |
isHTMLElement | static boolean isHTMLElement(Element e)(Code) | | true if this element is an HTML element, that shouldbe included in the text content of an element that tests truewith hasHTMLContent. |
isInputTextElement | boolean isInputTextElement(Element e)(Code) | | true if this element is an input text field |
isMouseEventAttribute | boolean isMouseEventAttribute(String name)(Code) | | |
methodOverrideAllowed | public boolean methodOverrideAllowed(String classname, String methodName)(Code) | | checks whether a method with a given method is allowed to be overridden
Parameters: elt - an Element name Parameters: methodName - a method name boolean if the method exists on the class or superclass |
parseColor | public static int parseColor(String str)(Code) | | Parse according to http://www.w3.org/TR/2001/WD-css3-color-20010305,
but also allow 0xXXXXXX
|
setAttributeType | public void setAttributeType(Element elt, String classname, String attrName, AttributeSpec attrspec)(Code) | | Set the attribute to the given type, for a specific element
|
supportsTextAttribute | boolean supportsTextAttribute(Element e)(Code) | | |
|
|