Package railo.transformer.bytecode

Examples of railo.transformer.bytecode.Page


      }
      else
        throw new EvaluatorException("Wrong Context, tag "+tlt.getFullName()+" can't be inside other tags, tag is inside tag "+p.getFullname());
    }

    Page page=(Page) pPage;
   
    // is inside a file named cfc
    String src=page.getSource();
    int pos=src.lastIndexOf(".");
    if(!(pos!=-1 && pos<src.length() && src.substring(pos+1).equals("cfc")))
      throw new EvaluatorException("Wrong Context, "+tlt.getFullName()+" tag must be inside a file with extension cfc");
   
    // check if more than one component in document and remove any other data
    List stats = page.getStatements();
    Iterator it = stats.iterator();
    Statement stat;
    int count=0;
    while(it.hasNext()) {
      stat=(Statement) it.next();
      if(stat instanceof Tag) {
        tag=(Tag) stat;
        if(tag.getTagLibTag().getTagClassName().equals(className)) count++;
      }
    }
    if(count>1)
      throw new EvaluatorException("inside one cfc file only one tag "+tlt.getFullName()+" is allowed, now we have "+count);

    boolean isComponent="railo.runtime.tag.Component".equals(tlt.getTagClassName());
    boolean isInterface="railo.runtime.tag.Interface".equals(tlt.getTagClassName());
    if(isComponent)page.setIsComponent(true);
    if(isInterface)page.setIsInterface(true);
   
// Attributes
   
    // output
    // "output=true" wird in "railo.transformer.cfml.attributes.impl.Function" geh�ndelt
View Full Code Here


   * @see railo.transformer.cfml.evaluator.EvaluatorSupport#evaluate(railo.transformer.bytecode.statement.tag.Tag, railo.transformer.library.tag.TagLibTag, railo.transformer.library.function.FunctionLib[])
   */
  public void evaluate(Tag tag,TagLibTag tagLibTag,FunctionLib[] flibs) throws EvaluatorException {
        String id="sprite_"+IDGenerator.intId();
        try {
      Page page = ASMUtil.getAncestorPage(tag);
      String key=Md5.getDigestAsString(Thread.currentThread().getId()+":"+page.getSource());
      Expression src = tag.getAttribute("src").getValue();
     
     
      // get data from previous sprites
      Previous previous = sprites.get(key);
View Full Code Here

      //print.out("src:"+source.getDisplayPath());
        //print.dumpStack();
      Resource classFile=classRootDir.getRealResource(className+".class");
      Resource classFileDirectory=classFile.getParentResource();
          byte[] barr = null;
      Page page = null;
     
      if(!classFileDirectory.exists()) classFileDirectory.mkdirs();
     
          try {
            page = cfmlTransformer.transform(config,source,tld,fld);
            barr = page.execute(source,classFile);
        IOUtil.copy(new ByteArrayInputStream(barr), classFile,true);
            return barr;
      }
          catch (AlreadyClassException ace) {
            InputStream is=null;
View Full Code Here

   * @return ᅵbersetztes CFXD Dokument Element.
   * @throws TemplateException
   * @throws IOException
   */
  public Page transform(ConfigImpl config,SourceFile sf, TagLib[] tlibs, FunctionLib[] flibs) throws TemplateException, IOException  {
    Page p;
    CFMLString cfml;
   
    boolean writeLog=config.getExecutionLogEnabled();
    String charset=config.getTemplateCharset();
    boolean dotUpper = config.getDotNotationUpperCase();
   
   
    while(true){
      try {
        cfml=new CFMLString(sf,charset,writeLog);
        p = transform(config,cfml,tlibs,flibs,sf.getResource().lastModified(),dotUpper);
        break;
      }
      catch(ProcessingDirectiveException pde) {
        if(pde.getWriteLog()!=null)writeLog=pde.getWriteLog().booleanValue();
        if(pde.getDotNotationUpperCase()!=null)dotUpper=pde.getDotNotationUpperCase().booleanValue();
        if(!StringUtil.isEmpty(pde.getCharset()))charset=pde.getCharset();
      }
    }
   
    // if cfc has no component tag or is script without cfscript
    if(p.isPage() && ResourceUtil.getExtension(sf.getResource(),"").equalsIgnoreCase(config.getCFCExtension())){
      cfml.setPos(0);
      TagLibTag tlt;
      CFMLString original = cfml;
     
      // try inside a cfscript
      tlt = CFMLTransformer.getTLT(original,"script");
      String text="<"+tlt.getFullName()+">"+original.getText()+"</"+tlt.getFullName()+">";
      cfml=new CFMLString(text,charset,writeLog,sf);
     
      try {
        while(true){
          if(cfml==null){
            cfml=new CFMLString(sf,charset,writeLog);
            text="<"+tlt.getFullName()+">"+cfml.getText()+"</"+tlt.getFullName()+">";
            cfml=new CFMLString(text,charset,writeLog,sf);
          }
          try {
            p= transform(config,cfml,tlibs,flibs,sf.getResource().lastModified(),dotUpper);
            break;
          }
          catch(ProcessingDirectiveException pde) {
            if(pde.getWriteLog()!=null)writeLog=pde.getWriteLog().booleanValue();
            if(pde.getDotNotationUpperCase()!=null)dotUpper=pde.getDotNotationUpperCase().booleanValue();
            if(!StringUtil.isEmpty(pde.getCharset()))charset=pde.getCharset();
            cfml=null;
          }
        }
      }
      catch (ComponentTemplateException e) {
        throw e.getTemplateException();
      }
      catch (TemplateException e) {
        //print.printST(e);
      }
     
     
     
     
      // try inside a component
      if(p.isPage()){
        tlt = CFMLTransformer.getTLT(original,"component");
        text="<"+tlt.getFullName()+">"+original.getText()+"</"+tlt.getFullName()+">";
        cfml=new CFMLString(text,charset,writeLog,sf);
           
        while(true){
View Full Code Here

   
   

    SourceFile source=cfml.getSourceFile();
   
    Page page=new Page(config,source.getPhyscalFile(),source.getFullClassName(),Info.getFullVersionInfo(),sourceLastModified,cfml.getWriteLog(),config.getSupressWSBeforeArg());
    TagData data = new TagData(_tlibs,flibs,config.getCoreTagLib().getScriptTags(),cfml,dotNotationUpperCase,page);
   
    //Body body=page;
    try {
      do {
       
        body(data,page,false,null);
       
        if(data.cfml.isAfterLast()) break;
        if(data.cfml.forwardIfCurrent("</")){
          int pos = data.cfml.getPos();
          TagLib tagLib=nameSpace(data);
          if(tagLib==null){
            page.addPrintOut("</", null,null);
          }
          else {
            String name = identifier(data.cfml,true);
            if(tagLib.getIgnoreUnknowTags()) {
              TagLibTag tlt = tagLib.getTag(name);
              if(tlt==null) {
                data.cfml.setPos(pos);
                page.addPrintOut("</", null,null);
              }
            }
            else throw new TemplateException(cfml,"no matching start tag for end tag ["+tagLib.getNameSpaceAndSeparator()+name+"]");
     
          }
View Full Code Here

    if(name==null){
      addAttribute(new Attribute(false, "name",LitString.toExprString("thread"+RandomUtil.createRandomStringLC(20)), "string"));
    }

    GeneratorAdapter adapter = bc.getAdapter();
    Page page = ASMUtil.getAncestorPage(this);
   
    int index=page.addThread(this);
    super._writeOut(bc,false);
   
    adapter.loadLocal(bc.getCurrentTag());
    adapter.loadThis();
        adapter.push(index);
View Full Code Here

      int externalizeStringGTE=((ConfigImpl)bc.getPageSource().getMapping().getConfig()).getExternalizeStringGTE();
     
      if(externalizeStringGTE>-1 && str.length()>externalizeStringGTE && StringUtil.indexOfIgnoreCase(bc.getMethod().getName(),"call")!=-1) {
        try{
          GeneratorAdapter ga = bc.getAdapter();
          Page page = bc.getPage();
          Range range= page.registerString(bc,str);
          ga.visitVarInsn(Opcodes.ALOAD, 0);
          ga.visitVarInsn(Opcodes.ALOAD, 1);
          ga.push(range.from);
          ga.push(range.to);
          ga.visitMethodInsn(Opcodes.INVOKEVIRTUAL, bc.getClassName(), "str", "(Lrailo/runtime/PageContext;II)Ljava/lang/String;");
View Full Code Here

TOP

Related Classes of railo.transformer.bytecode.Page

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.