Package railo.transformer.bytecode.statement.tag

Examples of railo.transformer.bytecode.statement.tag.Attribute


import railo.transformer.library.tag.TagLibTag;

public class Transaction implements AttributeEvaluator {

  public TagLibTag evaluate(TagLibTag tagLibTag, Tag tag) throws AttributeEvaluatorException {
    Attribute action = tag.getAttribute("action");
   
    if(action!=null){
      Tag parent = ASMUtil.getAncestorTag(tag, tag.getFullname());
      if(parent!=null) {
        tagLibTag=tagLibTag.duplicate(false);
View Full Code Here


          // ignore
        }
        else if(stat instanceof TagFunction) {
         
          Function.throwIfNotEmpty(t);
          Attribute attr = t.getAttribute("access");
         
          if(attr!=null) {
            ExprString expr = CastString.toExprString(attr.getValue());
           
            if(!(expr instanceof LitString))
              throw new EvaluatorException(
            "the attribute access of the Tag function inside an interface must contain a constant value");
            String access = ((LitString)expr).getString().trim();
            if(!"public".equalsIgnoreCase(access))
              throw new EvaluatorException(
            "the attribute access of the tag function inside an interface definition can only have the value [public] not ["+access+"]");
          }
          else t.addAttribute(new Attribute(false,"access",LitString.toExprString("public"),"string"));
         
        }
        else throw new EvaluatorException("tag "+libTag.getFullName()+" can only contain function definitions.");
      }
    }
View Full Code Here

        TagLibTag outputTag = lib.getTag("output");
       
        TagOutput output=new TagOutput(tag.getStart(),null);
        output.setFullname(outputTag.getFullName());
        output.setTagLibTag(outputTag);
        output.addAttribute(new Attribute(false,"output",LitBoolean.TRUE,"boolean"));
        output.addAttribute(new Attribute(false,"formail",LitBoolean.TRUE,"boolean"));
       
        Body body=new BodyBase();//output.getBody();
        output.setBody(body);
       
        ASMUtil.replace(tag,output,false);
View Full Code Here

  /**
   * @return the hint
   */
  public String getHint() {
    if(hint==null) {
      Attribute attr = params.remove("hint");
      if(attr!=null) {
        Literal lit=(Literal) attr.getValue();
        hint=lit.getString().trim();
      }
      else {
        hint=DocCommentTransformer.unwrap(tmpHint.toString());
      }
View Full Code Here

    }
    return hint;
  }

  public Attribute getHintAsAttribute() {
    return new Attribute(true,"hint",LitString.toExprString(getHint()),"string");
  }
View Full Code Here

    }
  }

  private Attribute param(ParserString ps) {
    String name=paramName(ps);
    if(name==null) return new Attribute(true,"@",LitBoolean.TRUE,"boolean");
   
    // white space
    while(ps.isValidIndex() && ps.isCurrentWhiteSpace()){
      if(ps.getCurrent()=='\n')
        return new Attribute(true,name,LitBoolean.TRUE,"boolean");
      ps.next();
    }
    Expression value = paramValue(ps);
    return new Attribute(true,name, value,value instanceof LitBoolean?"boolean":"string");
  }
View Full Code Here

  private JavaScriptTransformer jst=new JavaScriptTransformer();
  private CFMLScriptTransformer cst=new CFMLScriptTransformer();
 
  public void transform(Page page,CFMLTransformer parent, EvaluatorPool ep,FunctionLib[] flibs, Tag tag, TagLibTag tagLibTag,TagLibTag[] scriptTags, CFMLString cfml,TransfomerSettings settings)
  throws TemplateException {
    Attribute attr = tag.getAttribute("language");
    if(attr!=null) {
      Expression expr = CastString.toExprString(attr.getValue());
      if(!(expr instanceof LitString))
        throw new TemplateException(cfml,"Attribute language of the Tag script, must be a literal string value");
      String str = ((LitString)expr).getString().trim();
      if("java".equalsIgnoreCase(str))    jst.transform(page,parent, ep, flibs, tag, tagLibTag,scriptTags, cfml,settings);
      else if("cfml".equalsIgnoreCase(str))  cst.transform(page,parent, ep, flibs, tag, tagLibTag,scriptTags, cfml,settings);
View Full Code Here

    /**
     * @see railo.transformer.cfml.evaluator.Evaluator#execute(railo.runtime.config.Config, org.w3c.dom.Element, railo.transformer.library.tag.TagLibTag, railo.transformer.library.function.FunctionLib[], railo.transformer.util.CFMLString)
     */
  public TagLib execute(Config config,Tag tag, TagLibTag libTag, FunctionLib[] flibs,Data data) throws TemplateException {
    TagImport ti=(TagImport) tag;
    Attribute p = tag.getAttribute("prefix");
    Attribute t = tag.getAttribute("taglib");
    Attribute path = tag.getAttribute("path");
   
    if(p!=null || t!=null){
      if(p==null)
        throw new TemplateException(data.cfml,"Wrong Context, missing attribute [prefix] for tag "+tag.getFullname());
      if(t==null)
View Full Code Here

      }
     
     
     
      tag.addAttribute(
          new Attribute(
              false,
              "_id",
              LitString.toExprString(id),
              "string"
          ));
      tag.addAttribute(
          new Attribute(
              false,
              "_ids",
              LitString.toExprString(railo.runtime.type.util.ListUtil.listToList(previous.ids, ",")),
              "string"
          ));

      tag.addAttribute(
          new Attribute(
              false,
              "_srcs",
              previous.src,
              "string"
          ));
View Full Code Here

     * @param attrName
     * @return attribute value
     * @throws EvaluatorException
     */
  public static Literal getAttributeLiteral(Tag tag,String attrName) throws EvaluatorException {
    Attribute attr = tag.getAttribute(attrName);
    if(attr!=null && attr.getValue() instanceof Literal) return ((Literal)attr.getValue());
        throw new EvaluatorException("attribute ["+attrName+"] must be a constant value");
    }
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.statement.tag.Attribute

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.