jaxx.compiler.css
Class StylesheetHelper

java.lang.Object
  extended by jaxx.compiler.css.StylesheetHelper

public class StylesheetHelper
extends Object

A helper class to compute Stylesheet, Rule and Selector and extract all the compiler logic from this class.

In that way we can make the compiler as a single module and a runtime as another module.

Author:
tchemit

Nested Class Summary
static class StylesheetHelper.MouseEventEnum
           
static class StylesheetHelper.PseudoClassEnum
           
 
Constructor Summary
StylesheetHelper()
           
 
Method Summary
static int appliesTo(Rule rule, CompiledObject object)
           
static int appliesTo(Selector selector, CompiledObject object)
           
static void applyPseudoClass(String pseudoClass, Map<String,String> properties, CompiledObject object, JAXXCompiler compiler, int priority)
           
static void applyTo(CompiledObject object, JAXXCompiler compiler, Stylesheet stylesheet, Stylesheet overrides)
           
static void compilePseudoClass(String pseudoClass, CompiledObject object, String propertyCode, int pos, String methodName, JAXXCompiler compiler, boolean invertTest)
           
static MethodDescriptor getAddMouseListenerMethod(CompiledObject object)
           
static Map<String,String> getApplicableProperties(Stylesheet s, CompiledObject object)
           
static Rule[] getApplicablePseudoClasses(Stylesheet s, CompiledObject object)
           
static ClassDescriptor getMouseEventDescriptor()
           
static ClassDescriptor getMouseListenerDescriptor()
           
static MethodDescriptor getMouseListenerMethod(CompiledObject object, String property)
           
static Rule inlineAttribute(CompiledObject object, String propertyName, boolean dataBinding)
           
static Rule processRule(SimpleNode ruleNode)
           
static Selector processSelector(SimpleNode selector)
           
static Stylesheet processStylesheet(String stylesheetText)
           
static String unwrap(ClassDescriptor type, String valueCode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StylesheetHelper

public StylesheetHelper()
Method Detail

processStylesheet

public static Stylesheet processStylesheet(String stylesheetText)
                                    throws CompilerException
Throws:
CompilerException

processRule

public static Rule processRule(SimpleNode ruleNode)

processSelector

public static Selector processSelector(SimpleNode selector)

getMouseEventDescriptor

public static ClassDescriptor getMouseEventDescriptor()

getMouseListenerDescriptor

public static ClassDescriptor getMouseListenerDescriptor()

getAddMouseListenerMethod

public static MethodDescriptor getAddMouseListenerMethod(CompiledObject object)

getMouseListenerMethod

public static MethodDescriptor getMouseListenerMethod(CompiledObject object,
                                                      String property)

applyTo

public static void applyTo(CompiledObject object,
                           JAXXCompiler compiler,
                           Stylesheet stylesheet,
                           Stylesheet overrides)
                    throws CompilerException
Throws:
CompilerException

unwrap

public static String unwrap(ClassDescriptor type,
                            String valueCode)

applyPseudoClass

public static void applyPseudoClass(String pseudoClass,
                                    Map<String,String> properties,
                                    CompiledObject object,
                                    JAXXCompiler compiler,
                                    int priority)
                             throws CompilerException
Throws:
CompilerException

compilePseudoClass

public static void compilePseudoClass(String pseudoClass,
                                      CompiledObject object,
                                      String propertyCode,
                                      int pos,
                                      String methodName,
                                      JAXXCompiler compiler,
                                      boolean invertTest)
                               throws CompilerException
Throws:
CompilerException

getApplicableProperties

public static Map<String,String> getApplicableProperties(Stylesheet s,
                                                         CompiledObject object)
                                                  throws CompilerException
Throws:
CompilerException

getApplicablePseudoClasses

public static Rule[] getApplicablePseudoClasses(Stylesheet s,
                                                CompiledObject object)
                                         throws CompilerException
Throws:
CompilerException

inlineAttribute

public static Rule inlineAttribute(CompiledObject object,
                                   String propertyName,
                                   boolean dataBinding)

appliesTo

public static int appliesTo(Rule rule,
                            CompiledObject object)
                     throws CompilerException
Throws:
CompilerException

appliesTo

public static int appliesTo(Selector selector,
                            CompiledObject object)


Copyright © 2008-2011 CodeLutin. All Rights Reserved.