Package org.apache.shale.clay.parser

Examples of org.apache.shale.clay.parser.Parser$Attributes


  /**
   * Support for CustomControlCreator
   * @param interact
   */
  public ControlInteractAttributes(final InteractType interact) {
    this.attributes = new Attributes(interact.getAttributes());
  }
View Full Code Here


      final Nifty nifty,
      final Element element,
      final EffectEventId effectEventId,
      final Attributes effectsTypeAttibutes,
      final LinkedList < Object > controllers) {
    Attributes effectAttributes = new Attributes(getAttributes());
    effectAttributes.merge(effectsTypeAttibutes);

    Attributes attributes = effectAttributes;

    RegisterEffectType registerEffectType = getRegisteredEffectType(nifty, attributes);
    if (registerEffectType == null) {
      return;
    }

    Class < ? > effectClass = registerEffectType.getEffectClass();
    if (effectClass == null) {
      return;
    }

    EffectProperties effectProperties = new EffectProperties(attributes.createProperties());
    applyEffectValues(effectProperties);

    Effect effect = createEffect(nifty, effectEventId, attributes);
    effect.init(
        element,
View Full Code Here

    parent = parentParam;
    controlAttributes = controlAttributesParam;
  }

  public Attributes resolve(final Attributes attributes) {
    Attributes result = new Attributes(attributes);

    for (Entry entry : getParameterSet(attributes)) {
      String key = (String) entry.getKey();
      String value = (String) entry.getValue();
      if (controlAttributes.isSet(key)) {
        result.set(value, controlAttributes.get(key));
      }
    }

    Attributes res = parent.resolve(result);
    for (Entry entry : getParameterSet(attributes)) {
      String value = (String) entry.getValue();
      result.set(value, "");
    }
    return res;
View Full Code Here

  public RegisterEffectType() {
  }

  public RegisterEffectType(final String nameParam, final String classParam) {
    Attributes attributes = new Attributes();
    attributes.set("name", nameParam);
    attributes.set("class", classParam);
    try {
      initFromAttributes(attributes);
    } catch (Exception e) {
      logger.warning(
          "unable to register effect [" + nameParam + "] for class [" + classParam + "] (" + e.getMessage() + "]");
View Full Code Here

        List messages = new ArrayList();

        if (uri != null && CLAY_URI_NAMESPACE.equals(uri)) {
            try {
                StringBuffer buff = loadTemplate(page);
                Parser p = new Parser();
                List roots = p.parse(buff);

                for (int i = 0;  i < roots.size(); i++) {
                    Node node = (Node) roots.get(i);
                    validateClayTags(prefix, node, messages);
                }
View Full Code Here

        // generate the document

        StringBuffer buffer = loadTemplate(templateURL);

        List roots = new Parser().parse(buffer);
        Iterator ri = roots.iterator();
        while (ri.hasNext()) {
            Node node = (Node) ri.next();
            Builder renderer = getBuilder(node);
            ElementBean child = renderer.createElement(node);
View Full Code Here

        clay.encodeEnd(facesContext);
       
        //end the document
        buffResponsewriter.endDocument();
       
        Parser p = new Parser();
        List nodes = p.parse(writer.getBuffer());
        assertEquals("1 root node", 1, nodes.size());

        Node comment = findComment((Node) nodes.get(0));
        assertNotNull("comment found", comment);      
        assertTrue("is a comment", comment.isComment());
View Full Code Here

        clay.encodeEnd(facesContext);
       
        //end the document
        buffResponsewriter.endDocument();
       
        Parser p = new Parser();
        List nodes = p.parse(writer.getBuffer());
        assertEquals("1 root node", 1, nodes.size());
       
        Node comment = findComment((Node) nodes.get(0));
        assertNotNull("comment found", comment);      
        assertTrue("is a comment", comment.isComment());
View Full Code Here

        clay.encodeEnd(facesContext);
       
        //end the document
        buffResponsewriter.endDocument();
       
        Parser p = new Parser();
        List nodes = p.parse(writer.getBuffer());
        assertEquals("2 root node", 2, nodes.size());

        Node paragraph = (Node) nodes.get(1);
        assertNotNull(paragraph);
       
View Full Code Here

TOP

Related Classes of org.apache.shale.clay.parser.Parser$Attributes

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.