Package org.apache.shale.clay.config.beans

Examples of org.apache.shale.clay.config.beans.SymbolBean


          StringBuffer tmp = new StringBuffer(name);
          if (tmp.charAt(0) != '@') {
            tmp.insert(0, '@');
          }
          SymbolBean symbol = new SymbolBean();
          symbol.setName(tmp.toString());
          symbol.setValue(value);
          clayParent.getSymbols().put(symbol.getName(), symbol);

          return super.doStartTag();
    }
View Full Code Here


                config.assignParent(target);
                config.realizingInheritance(target);

                // prepend the var to the generated key
                id.insert(0, var + ".");
                SymbolBean symbol = new SymbolBean();
                symbol.setName(Globals.MANAGED_BEAN_MNEMONIC);
                symbol.setValue(id.toString());
                target.addSymbol(symbol);

                namingContainer.addChild(target);
                ((ComponentBean) displayElementRoot).addChild(namingContainer);
            }
View Full Code Here

     * </p>
     *
     * @return managed bean name symbol
     */
    public String getManagedBeanName() {
        SymbolBean symbol = (SymbolBean) symbols.get(Globals.MANAGED_BEAN_MNEMONIC);
        return ((symbol != null) ? symbol.getValue() : null);
    }
View Full Code Here

     * </p>
     *
     * @param mbeanMnemonic managed bean symbol
     */
    public void setManagedBeanName(String mbeanMnemonic) {
        SymbolBean symbol = new SymbolBean();
        symbol.setName(Globals.MANAGED_BEAN_MNEMONIC);
        symbol.setValue(mbeanMnemonic);
        symbols.put(symbol.getName(), symbol);
    }
View Full Code Here

                    createAttribute(original, valueToken.getRawText(), target);
                } else  {
                    //any token that is not an attribute in the target becomes a symbol
                    StringBuffer identifier = new StringBuffer((String) e.getKey());
                    identifier.insert(0, '@');
                    SymbolBean symbol = new SymbolBean();
                    symbol.setName(identifier.toString());
                    symbol.setValue(valueToken.getRawText());
                    target.addSymbol(symbol);
                }
            }
        }
View Full Code Here

     */
    protected void encodeBegin(Node node, ElementBean target, ComponentBean root) {
        super.encodeBegin(node, target, root);
        if (getComponentType(node).equals(target.getComponentType())) {
            AttributeBean attr = target.getAttribute("value");
            SymbolBean symbol = target.getSymbol("href");
            if ((symbol != null && attr != null)
                    && (attr.getValue() == null || attr.getValue().length() == 0)) {
                createAttribute(attr, "@href", target);
            }
        }
View Full Code Here

        description = bean.getDescription();
        assertNotNull(description);
       
        assertTrue(description.startsWith("Abstract base component definition"));
       
        SymbolBean symbol = (SymbolBean) bean.getSymbols().get("@class");
        assertNotNull(symbol);
       
        description = symbol.getDescription();
        assertNotNull(description);
       
        assertEquals("The default value of the styleClass attribute.", description);
       
       
View Full Code Here

        assertNotNull(bean);
       
        description = bean.getDescription();
        assertNull(description);

        SymbolBean symbol = (SymbolBean) bean.getSymbols().get("@class");
        assertNotNull(symbol);
       
        description = symbol.getDescription();
        assertNull(description);
       
    }
View Full Code Here

       
        ClayContext clayContext = new ClayContext();
        clayContext.setFacesContext(facesContext);
        clayContext.setSymbols(symbols);
       
        SymbolBean symbol = this.createSymbol("@a", "@b");
        symbols.put(symbol.getName(), symbol);
       
        symbol = this.createSymbol("@b", "@c");
        symbols.put(symbol.getName(), symbol);
       
        symbol = this.createSymbol("@c", "@d");
        symbols.put(symbol.getName(), symbol);
       
        symbol = this.createSymbol("@d", "test");
        symbols.put(symbol.getName(), symbol);
       
        AbstractCommand.realizeSymbols(clayContext);
       
        symbol = (SymbolBean) symbols.get("@a");
        assertNotNull(symbol);
        assertEquals("test", symbol.getValue());
       
        symbol = (SymbolBean) symbols.get("@b");
        assertNotNull(symbol);
        assertEquals("test", symbol.getValue());
       
        symbol = (SymbolBean) symbols.get("@c");
        assertNotNull(symbol);
        assertEquals("test", symbol.getValue());
       
        symbol = (SymbolBean) symbols.get("@d");
        assertNotNull(symbol);
        assertEquals("test", symbol.getValue());
       
       
        symbols.clear();
       
        symbol = this.createSymbol("@a", "@b");
        symbols.put(symbol.getName(), symbol);
       
        symbol = this.createSymbol("@b", "@a");
        symbols.put(symbol.getName(), symbol);
       
        AbstractCommand.realizeSymbols(clayContext);
       
        symbol = (SymbolBean) symbols.get("@a");
        assertNotNull(symbol);
        assertEquals("@a", symbol.getValue());
       
        symbol = (SymbolBean) symbols.get("@b");
        assertNotNull(symbol);
        assertEquals("@a", symbol.getValue());
       
       
       
        symbols.clear();
       
        symbol = this.createSymbol("@foo", "@xbeanx.@xpropertyx");
        symbols.put(symbol.getName(), symbol);
       
        symbol = this.createSymbol("@xbeanx", "@a");
        symbols.put(symbol.getName(), symbol);
       
        symbol = this.createSymbol("@xpropertyx", "@b");
        symbols.put(symbol.getName(), symbol);
       
        symbol = this.createSymbol("@a", "foo");
        symbols.put(symbol.getName(), symbol);
       
        symbol = this.createSymbol("@b", "bar");
        symbols.put(symbol.getName(), symbol);
       
        AbstractCommand.realizeSymbols(clayContext);
       
        symbol = (SymbolBean) symbols.get("@foo");
        assertNotNull(symbol);
        assertEquals("foo.bar", symbol.getValue());
       
    }
View Full Code Here

       
    }
  
    //factory method for creating a symbol bean
    private SymbolBean createSymbol(String name, String value) {
        SymbolBean symbol = new SymbolBean();
        symbol.setName(name);
        symbol.setValue(value);
        return symbol;
    }  
View Full Code Here

TOP

Related Classes of org.apache.shale.clay.config.beans.SymbolBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.