org.tizen.common.verrari_2.0.0.201311012034

16:49:57.689 INFO  jd.cli.Main - Decompiling org.tizen.common.verrari_2.0.0.201311012034.jar
package org.tizen.common.verrari;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class Activator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.common.verrari";
  private static Activator plugin;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.Activator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

public abstract interface IModelManager
  extends IModelProvider
{
  public abstract void addModel(String paramString, Object paramObject);
  
  public abstract void removeModel(String paramString);
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.IModelManager
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

import java.util.Collection;

public abstract interface IModelProvider
{
  public abstract boolean isEmpty();
  
  public abstract Collection<String> keys();
  
  public abstract Object getModel(String paramString);
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.IModelProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

import java.io.IOException;
import java.io.InputStream;

public abstract interface ITemplate
{
  public abstract String getEncoding();
  
  public abstract InputStream open()
    throws IOException;
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.ITemplate
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

import java.io.OutputStream;

public abstract interface ITemplateEngine
{
  public abstract String getEngineVersion();
  
  public abstract ITemplateProvider getTemplateProvider();
  
  public abstract void setTemplateProvider(ITemplateProvider paramITemplateProvider);
  
  public abstract void generate(String paramString, IModelProvider paramIModelProvider, OutputStream paramOutputStream)
    throws Exception;
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.ITemplateEngine
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

public abstract interface ITemplateManager
{
  public abstract void addTemplate(String paramString, ITemplate paramITemplate);
  
  public abstract void removeTemplate(String paramString);
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.ITemplateManager
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

import java.util.Collection;
import org.tizen.common.verrari.template.TemplateTransformer;

public abstract interface ITemplateProvider
{
  public abstract void setTransformer(TemplateTransformer paramTemplateTransformer);
  
  public abstract boolean isEmpty();
  
  public abstract Collection<String> keys();
  
  public abstract ITemplate getTemplate(String paramString);
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.ITemplateProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

class TemplateContext$1
  extends ThreadLocal<TemplateContext>
{
  protected TemplateContext initialValue()
  {
    return new TemplateContext();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.TemplateContext.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

import java.util.HashMap;
import org.tizen.common.verrari.model.ModelManager;

public class TemplateContext
{
  protected static ThreadLocal<TemplateContext> cabinet = new ThreadLocal()
  {
    protected TemplateContext initialValue()
    {
      return new TemplateContext();
    }
  };
  protected IModelProvider provider = new ModelManager();
  protected HashMap<String, Object> key2value = new HashMap();
  
  public static final TemplateContext getInstance()
  {
    return (TemplateContext)cabinet.get();
  }
  
  public static void clear()
  {
    cabinet.remove();
  }
  
  public static void set(TemplateContext context)
  {
    cabinet.set(context);
  }
  
  public static Object get(String key)
  {
    return getInstance().getModelProvider().getModel(key);
  }
  
  public IModelProvider getModelProvider()
  {
    return provider;
  }
  
  public void setModelProvider(IModelProvider provider)
  {
    this.provider = provider;
  }
  
  public Object getData(String key)
  {
    return key2value.get(key);
  }
  
  public void setData(String key, Object data)
  {
    key2value.put(key, data);
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.TemplateContext
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari;

public class TemplateException
  extends Exception
{
  private static final long serialVersionUID = 7233052548712665806L;
  
  public TemplateException() {}
  
  public TemplateException(String msg)
  {
    super(msg);
  }
  
  public TemplateException(Throwable cause)
  {
    super(cause);
  }
  
  public TemplateException(String msg, Throwable cause)
  {
    super(msg, cause);
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.TemplateException
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.verrari.ITemplate;
import org.tizen.common.verrari.ITemplateEngine;
import org.tizen.common.verrari.ITemplateProvider;
import org.tizen.common.verrari.template.TemplateManager;

public abstract class AbstractTemplateEngine
  implements ITemplateEngine
{
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  protected ITemplateProvider templateProvider;
  
  public AbstractTemplateEngine()
  {
    this(new TemplateManager());
  }
  
  public AbstractTemplateEngine(ITemplateProvider templateProvider)
  {
    setTemplateProvider(templateProvider);
  }
  
  public ITemplateProvider getTemplateProvider()
  {
    return templateProvider;
  }
  
  public void setTemplateProvider(ITemplateProvider provider)
  {
    templateProvider = provider;
  }
  
  protected ITemplate getTemplate(String key)
  {
    return templateProvider.getTemplate(key);
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.AbstractTemplateEngine
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine;

import org.apache.commons.lang3.ClassUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.Factory;
import org.tizen.common.FactoryWithArgument;
import org.tizen.common.util.io.BufferPool;
import org.tizen.common.verrari.ITemplateEngine;
import org.tizen.common.verrari.engine.freemarker.FreemarkerTemplateEngine;

public class TemplateEngineFactory
  implements Factory<ITemplateEngine>, FactoryWithArgument<ITemplateEngine, Class<?>>
{
  protected static TemplateEngineFactory instance = new TemplateEngineFactory();
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  protected final BufferPool bufferPool = new BufferPool();
  
  public static TemplateEngineFactory getInstance()
  {
    return instance;
  }
  
  public ITemplateEngine create()
  {
    return new FreemarkerTemplateEngine();
  }
  
  public ITemplateEngine create(Class<?> engineClass)
  {
    if (engineClass == null) {
      return null;
    }
    if (ClassUtils.isAssignable(engineClass, ITemplateEngine.class)) {
      try
      {
        return (ITemplateEngine)engineClass.newInstance();
      }
      catch (InstantiationException e)
      {
        logger.warn("Engine class can't be instantiated:", e);
      }
      catch (IllegalAccessException e)
      {
        logger.warn("Engine class can't be accessible:", e);
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.TemplateEngineFactory
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker;

import java.util.HashMap;
import org.slf4j.Logger;
import org.tizen.common.verrari.IModelManager;
import org.tizen.common.verrari.IModelProvider;
import org.tizen.common.verrari.engine.freemarker.method.FreemarkerTemplateEngineMethod;

public class FreemarkerModelManager
  extends FreemarkerModelProvider
  implements IModelManager
{
  protected HashMap<String, Object> cache = new HashMap();
  
  public FreemarkerModelManager(IModelProvider modelProvider)
  {
    super(modelProvider);
    new FreemarkerTemplateEngineMethod().reigister(this);
  }
  
  public void addModel(String key, Object model)
  {
    cache.put(key, model);
  }
  
  public void removeModel(String key)
  {
    cache.remove(key);
  }
  
  public Object getModel(String key)
  {
    logger.debug("Key :{}", key);
    Object ret = cache.get(key);
    if (ret != null) {
      return ret;
    }
    logger.info("Delegate to {}", modelProvider);
    return modelProvider.getModel(key);
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.FreemarkerModelManager
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker;

import org.tizen.common.verrari.IModelProvider;
import org.tizen.common.verrari.model.ModelProviderDelegate;

public class FreemarkerModelProvider
  extends ModelProviderDelegate
{
  public FreemarkerModelProvider(IModelProvider modelProvider)
  {
    super(modelProvider);
  }
  
  public Object get(String key)
  {
    return getModel(key);
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.FreemarkerModelProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker;

import freemarker.template.Configuration;
import freemarker.template.Template;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import org.tizen.common.util.Assert;
import org.tizen.common.util.FreeMarkerUtil;
import org.tizen.common.verrari.IModelProvider;
import org.tizen.common.verrari.ITemplateProvider;
import org.tizen.common.verrari.engine.AbstractTemplateEngine;

public class FreemarkerTemplateEngine
  extends AbstractTemplateEngine
{
  protected final Configuration cfg = FreeMarkerUtil.getDefaultConfiguration();
  
  public FreemarkerTemplateEngine()
  {
    cfg.setTemplateLoader(new FreemarkerTemplateProvider(getTemplateProvider()));
  }
  
  public void setTemplateProvider(ITemplateProvider provider)
  {
    super.setTemplateProvider(provider);
    if (cfg != null) {
      cfg.setTemplateLoader(new FreemarkerTemplateProvider(provider));
    }
  }
  
  public Configuration getConfiguration()
  {
    return cfg;
  }
  
  public String getEngineVersion()
  {
    return Configuration.getVersionNumber();
  }
  
  public void generate(String templateKey, IModelProvider modelProvider, OutputStream output)
    throws Exception
  {
    Template freemarkerTemplate = cfg.getTemplate(templateKey);
    Assert.notNull(freemarkerTemplate, "Template is null for " + templateKey);
    IModelProvider adapter = new FreemarkerModelManager(modelProvider);
    freemarkerTemplate.process(adapter, new OutputStreamWriter(output));
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.FreemarkerTemplateEngine
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker;

import freemarker.cache.TemplateLoader;
import java.io.IOException;
import java.io.Reader;
import java.util.HashMap;
import org.slf4j.Logger;
import org.tizen.common.util.IOUtil;
import org.tizen.common.verrari.ITemplate;
import org.tizen.common.verrari.ITemplateProvider;
import org.tizen.common.verrari.template.TemplateProviderDelegate;
import org.tizen.common.verrari.template.TemplateTransformer;
import org.tizen.common.verrari.template.TransformableTemplate;

public class FreemarkerTemplateProvider
  extends TemplateProviderDelegate
  implements TemplateLoader
{
  protected HashMap<Object, Reader> key2reader = new HashMap();
  protected TemplateTransformer transformer;
  
  public FreemarkerTemplateProvider(ITemplateProvider provider)
  {
    super(provider);
    
    transformer = new FreemarkerTemplateTransformer();
  }
  
  public void setTransformer(TemplateTransformer transformer)
  {
    this.transformer = transformer;
  }
  
  public ITemplate getTemplate(String key)
  {
    ITemplate raw = super.getTemplate(key);
    if (raw == null) {
      return raw;
    }
    return new TransformableTemplate(transformer, raw);
  }
  
  public Object findTemplateSource(String key)
    throws IOException
  {
    logger.info("Find template source for {}", key);
    ITemplate template = getTemplate(key);
    return template;
  }
  
  public long getLastModified(Object key)
  {
    return 0L;
  }
  
  /* Error */
  public Reader getReader(Object templateObj, String encoding)
    throws IOException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 59	org/tizen/common/verrari/engine/freemarker/FreemarkerTemplateProvider:logger	Lorg/slf4j/Logger;
    //   4: ldc 78
    //   6: aload_1
    //   7: invokeinterface 65 3 0
    //   12: aload_1
    //   13: checkcast 52	org/tizen/common/verrari/ITemplate
    //   16: astore_3
    //   17: new 80	java/io/InputStreamReader
    //   20: dup
    //   21: aload_3
    //   22: invokeinterface 82 1 0
    //   27: iconst_2
    //   28: anewarray 86	java/lang/String
    //   31: dup
    //   32: iconst_0
    //   33: aload_3
    //   34: invokeinterface 88 1 0
    //   39: aastore
    //   40: dup
    //   41: iconst_1
    //   42: aload_2
    //   43: aastore
    //   44: invokestatic 92	org/tizen/common/util/StringUtil:nvl	([Ljava/lang/String;)Ljava/lang/String;
    //   47: invokespecial 98	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   50: astore 4
    //   52: aload_0
    //   53: getfield 59	org/tizen/common/verrari/engine/freemarker/FreemarkerTemplateProvider:logger	Lorg/slf4j/Logger;
    //   56: invokeinterface 101 1 0
    //   61: ifeq +70 -> 131
    //   64: aload 4
    //   66: invokestatic 105	org/tizen/common/util/IOUtil:getString	(Ljava/io/Reader;)Ljava/lang/String;
    //   69: astore 5
    //   71: aload_0
    //   72: getfield 59	org/tizen/common/verrari/engine/freemarker/FreemarkerTemplateProvider:logger	Lorg/slf4j/Logger;
    //   75: ldc 111
    //   77: aload_1
    //   78: aload 5
    //   80: invokeinterface 113 4 0
    //   85: iconst_1
    //   86: anewarray 117	java/lang/Object
    //   89: dup
    //   90: iconst_0
    //   91: aload 4
    //   93: aastore
    //   94: invokestatic 119	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   97: new 123	java/io/StringReader
    //   100: dup
    //   101: aload 5
    //   103: invokespecial 125	java/io/StringReader:<init>	(Ljava/lang/String;)V
    //   106: astore 7
    //   108: iconst_1
    //   109: anewarray 117	java/lang/Object
    //   112: dup
    //   113: iconst_0
    //   114: aload_0
    //   115: getfield 23	org/tizen/common/verrari/engine/freemarker/FreemarkerTemplateProvider:key2reader	Ljava/util/HashMap;
    //   118: aload_1
    //   119: aload 4
    //   121: invokevirtual 128	java/util/HashMap:put	(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    //   124: aastore
    //   125: invokestatic 119	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   128: aload 7
    //   130: areturn
    //   131: aload 4
    //   133: astore 7
    //   135: iconst_1
    //   136: anewarray 117	java/lang/Object
    //   139: dup
    //   140: iconst_0
    //   141: aload_0
    //   142: getfield 23	org/tizen/common/verrari/engine/freemarker/FreemarkerTemplateProvider:key2reader	Ljava/util/HashMap;
    //   145: aload_1
    //   146: aload 4
    //   148: invokevirtual 128	java/util/HashMap:put	(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    //   151: aastore
    //   152: invokestatic 119	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   155: aload 7
    //   157: areturn
    //   158: astore 6
    //   160: iconst_1
    //   161: anewarray 117	java/lang/Object
    //   164: dup
    //   165: iconst_0
    //   166: aload_0
    //   167: getfield 23	org/tizen/common/verrari/engine/freemarker/FreemarkerTemplateProvider:key2reader	Ljava/util/HashMap;
    //   170: aload_1
    //   171: aload 4
    //   173: invokevirtual 128	java/util/HashMap:put	(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    //   176: aastore
    //   177: invokestatic 119	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   180: aload 6
    //   182: athrow
    // Line number table:
    //   Java source line #140	-> byte code offset #0
    //   Java source line #142	-> byte code offset #12
    //   Java source line #144	-> byte code offset #17
    //   Java source line #147	-> byte code offset #52
    //   Java source line #149	-> byte code offset #64
    //   Java source line #150	-> byte code offset #71
    //   Java source line #151	-> byte code offset #91
    //   Java source line #152	-> byte code offset #97
    //   Java source line #158	-> byte code offset #108
    //   Java source line #159	-> byte code offset #114
    //   Java source line #152	-> byte code offset #128
    //   Java source line #155	-> byte code offset #131
    //   Java source line #158	-> byte code offset #135
    //   Java source line #159	-> byte code offset #141
    //   Java source line #155	-> byte code offset #155
    //   Java source line #158	-> byte code offset #158
    //   Java source line #159	-> byte code offset #166
    //   Java source line #160	-> byte code offset #180
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	183	0	this	FreemarkerTemplateProvider
    //   0	183	1	templateObj	Object
    //   0	183	2	encoding	String
    //   16	18	3	template	ITemplate
    //   50	122	4	ret	Reader
    //   69	33	5	contents	String
    //   158	23	6	localObject1	Object
    //   106	50	7	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   52	108	158	finally
    //   131	135	158	finally
  }
  
  public void closeTemplateSource(Object templateObj)
    throws IOException
  {
    logger.info("Close template source for {}", templateObj);
    IOUtil.tryClose(new Object[] {key2reader.remove(templateObj) });
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.FreemarkerTemplateProvider
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.tizen.common.verrari.template.TemplateTransformer;

public class FreemarkerTemplateTransformer
  extends TemplateTransformer
{
  public String translateTransform(String contents)
  {
    Pattern pattern = Pattern.compile("(\\$\\$\\{)(.*?)(\\})");
    Matcher matcher = pattern.matcher(contents);
    String translatedContents = contents;
    while (matcher.find()) {
      translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$$", "$").replace('|', '!'));
    }
    return translatedContents;
  }
  
  public String translateFunction(String contents)
  {
    Pattern pattern = Pattern.compile("(\\$\\@\\{)(.*?)(\\})");
    Matcher matcher = pattern.matcher(contents);
    String translatedContents = contents;
    while (matcher.find())
    {
      String matchGroup = matcher.group();
      if (matchGroup.contains("="))
      {
        matchGroup = matchGroup.replace("$@{", "").replace("}", "");
        String[] arguments = matchGroup.split("=");
        String assignFunction = String.format("<#assign %s=\"${%s}\">${%s}", new Object[] { arguments[0].trim(), arguments[1].trim(), arguments[0].trim() });
        translatedContents = translatedContents.replace(matcher.group(), assignFunction);
      }
      else
      {
        translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$@", "$"));
      }
    }
    return translatedContents;
  }
  
  public String translateInclude(String contents)
  {
    Pattern pattern = Pattern.compile("(\\$\\$include)(.*?)(\\})");
    Matcher matcher = pattern.matcher(contents);
    String translatedContents = contents;
    while (matcher.find()) {
      translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$$", "<#").replace("{", " ").replace('}', '>'));
    }
    return translatedContents;
  }
  
  public String translateIf(String contents)
  {
    Pattern pattern = Pattern.compile("(\\$\\$if)(.*?)(\\})");
    Matcher matcher = pattern.matcher(contents);
    String translatedContents = contents;
    while (matcher.find()) {
      translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$$", "<#").replace("{", " ").replace("}", "").trim().concat("?exists>"));
    }
    pattern = Pattern.compile("(\\$\\$elseif)(.*?)(\\})");
    matcher = pattern.matcher(translatedContents);
    while (matcher.find()) {
      translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$$", "<#").replace("{", " ").replace("}", "").trim().concat("?exists>"));
    }
    pattern = Pattern.compile("(\\$\\$else)");
    matcher = pattern.matcher(translatedContents);
    while (matcher.find()) {
      translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$$else", "<#else>"));
    }
    pattern = Pattern.compile("(\\$\\$endif)");
    matcher = pattern.matcher(translatedContents);
    while (matcher.find()) {
      translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$$endif", "</#if>"));
    }
    return translatedContents;
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.FreemarkerTemplateTransformer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker.method;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;
import java.util.List;
import org.tizen.common.verrari.engine.method.AbstractTemplateEngineMethod;

public class FreemarkerTemplateEngineMethod$ApplicationID
  implements TemplateMethodModel
{
  public FreemarkerTemplateEngineMethod$ApplicationID(FreemarkerTemplateEngineMethod paramFreemarkerTemplateEngineMethod) {}
  
  public String exec(List arg0)
    throws TemplateModelException
  {
    return AbstractTemplateEngineMethod.getApplicationID();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.method.FreemarkerTemplateEngineMethod.ApplicationID
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker.method;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;
import java.util.List;
import org.tizen.common.verrari.engine.method.AbstractTemplateEngineMethod;

public class FreemarkerTemplateEngineMethod$Date
  implements TemplateMethodModel
{
  public FreemarkerTemplateEngineMethod$Date(FreemarkerTemplateEngineMethod paramFreemarkerTemplateEngineMethod) {}
  
  public String exec(List arg0)
    throws TemplateModelException
  {
    return AbstractTemplateEngineMethod.getDate();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.method.FreemarkerTemplateEngineMethod.Date
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker.method;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;
import java.util.List;
import org.tizen.common.verrari.engine.method.AbstractTemplateEngineMethod;

public class FreemarkerTemplateEngineMethod$Time
  implements TemplateMethodModel
{
  public FreemarkerTemplateEngineMethod$Time(FreemarkerTemplateEngineMethod paramFreemarkerTemplateEngineMethod) {}
  
  public String exec(List arg0)
    throws TemplateModelException
  {
    return AbstractTemplateEngineMethod.getTime();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.method.FreemarkerTemplateEngineMethod.Time
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker.method;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;
import java.util.List;
import org.tizen.common.verrari.engine.method.AbstractTemplateEngineMethod;

public class FreemarkerTemplateEngineMethod$User
  implements TemplateMethodModel
{
  public FreemarkerTemplateEngineMethod$User(FreemarkerTemplateEngineMethod paramFreemarkerTemplateEngineMethod) {}
  
  public String exec(List arg0)
    throws TemplateModelException
  {
    return AbstractTemplateEngineMethod.getUser();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.method.FreemarkerTemplateEngineMethod.User
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker.method;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;
import java.util.List;
import org.tizen.common.verrari.engine.method.AbstractTemplateEngineMethod;

public class FreemarkerTemplateEngineMethod$Year
  implements TemplateMethodModel
{
  public FreemarkerTemplateEngineMethod$Year(FreemarkerTemplateEngineMethod paramFreemarkerTemplateEngineMethod) {}
  
  public String exec(List arg0)
    throws TemplateModelException
  {
    return AbstractTemplateEngineMethod.getYear();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.method.FreemarkerTemplateEngineMethod.Year
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.freemarker.method;

import freemarker.template.TemplateMethodModel;
import freemarker.template.TemplateModelException;
import java.util.List;
import org.tizen.common.verrari.engine.method.AbstractTemplateEngineMethod;

public class FreemarkerTemplateEngineMethod
  extends AbstractTemplateEngineMethod
{
  public class Year
    implements TemplateMethodModel
  {
    public Year() {}
    
    public String exec(List arg0)
      throws TemplateModelException
    {
      return AbstractTemplateEngineMethod.getYear();
    }
  }
  
  public class Date
    implements TemplateMethodModel
  {
    public Date() {}
    
    public String exec(List arg0)
      throws TemplateModelException
    {
      return AbstractTemplateEngineMethod.getDate();
    }
  }
  
  public class Time
    implements TemplateMethodModel
  {
    public Time() {}
    
    public String exec(List arg0)
      throws TemplateModelException
    {
      return AbstractTemplateEngineMethod.getTime();
    }
  }
  
  public class User
    implements TemplateMethodModel
  {
    public User() {}
    
    public String exec(List arg0)
      throws TemplateModelException
    {
      return AbstractTemplateEngineMethod.getUser();
    }
  }
  
  public class ApplicationID
    implements TemplateMethodModel
  {
    public ApplicationID() {}
    
    public String exec(List arg0)
      throws TemplateModelException
    {
      return AbstractTemplateEngineMethod.getApplicationID();
    }
  }
  
  public Object getYearWrapper()
  {
    getClass();return new Year();
  }
  
  public Object getDateWrapper()
  {
    getClass();return new Date();
  }
  
  public Object getTimeWrapper()
  {
    getClass();return new Time();
  }
  
  public Object getUserWrapper()
  {
    getClass();return new User();
  }
  
  public Object getApplicationIDWrapper()
  {
    getClass();return new ApplicationID();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.freemarker.method.FreemarkerTemplateEngineMethod
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.jsoup;

import org.tizen.common.verrari.engine.AbstractTemplateEngine;

public class JsoupTemplateEngine
  extends AbstractTemplateEngine
{
  protected static final String BASE_URI = "http://www.tizen.org/sdk/ide/verrari";
  public static String DEFAULT_ENCODING = "UTF-8";
  
  public String getEngineVersion()
  {
    return "1.6.3";
  }
  
  /* Error */
  public void generate(String templateKey, org.tizen.common.verrari.IModelProvider modelProvider, java.io.OutputStream output)
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 34	org/tizen/common/verrari/engine/jsoup/JsoupTemplateEngine:logger	Lorg/slf4j/Logger;
    //   4: ldc 38
    //   6: aload_1
    //   7: aload_2
    //   8: invokeinterface 40 4 0
    //   13: aload_0
    //   14: aload_1
    //   15: invokevirtual 46	org/tizen/common/verrari/engine/jsoup/JsoupTemplateEngine:getTemplate	(Ljava/lang/String;)Lorg/tizen/common/verrari/ITemplate;
    //   18: astore 4
    //   20: aload_0
    //   21: getfield 34	org/tizen/common/verrari/engine/jsoup/JsoupTemplateEngine:logger	Lorg/slf4j/Logger;
    //   24: ldc 50
    //   26: aload 4
    //   28: invokeinterface 52 3 0
    //   33: aload 4
    //   35: new 56	java/lang/StringBuilder
    //   38: dup
    //   39: ldc 58
    //   41: invokespecial 60	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   44: aload_1
    //   45: invokevirtual 63	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   48: invokevirtual 67	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   51: invokestatic 70	org/tizen/common/util/Assert:notNull	(Ljava/lang/Object;Ljava/lang/String;)V
    //   54: aload 4
    //   56: invokeinterface 76 1 0
    //   61: astore 5
    //   63: aload 5
    //   65: ifnonnull +8 -> 73
    //   68: getstatic 16	org/tizen/common/verrari/engine/jsoup/JsoupTemplateEngine:DEFAULT_ENCODING	Ljava/lang/String;
    //   71: astore 5
    //   73: aconst_null
    //   74: astore 6
    //   76: aload 4
    //   78: invokeinterface 81 1 0
    //   83: astore 6
    //   85: aload 6
    //   87: aload 5
    //   89: ldc 8
    //   91: invokestatic 85	org/jsoup/Jsoup:parse	(Ljava/io/InputStream;Ljava/lang/String;Ljava/lang/String;)Lorg/jsoup/nodes/Document;
    //   94: astore 7
    //   96: aload 7
    //   98: invokevirtual 91	org/jsoup/nodes/Document:outputSettings	()Lorg/jsoup/nodes/Document$OutputSettings;
    //   101: iconst_0
    //   102: invokevirtual 97	org/jsoup/nodes/Document$OutputSettings:prettyPrint	(Z)Lorg/jsoup/nodes/Document$OutputSettings;
    //   105: pop
    //   106: aload_2
    //   107: invokeinterface 103 1 0
    //   112: invokeinterface 109 1 0
    //   117: astore 9
    //   119: goto +162 -> 281
    //   122: aload 9
    //   124: invokeinterface 115 1 0
    //   129: checkcast 121	java/lang/String
    //   132: astore 8
    //   134: aload 7
    //   136: aload 8
    //   138: invokevirtual 123	org/jsoup/nodes/Document:select	(Ljava/lang/String;)Lorg/jsoup/select/Elements;
    //   141: astore 10
    //   143: aload 10
    //   145: invokevirtual 127	org/jsoup/select/Elements:isEmpty	()Z
    //   148: ifne +133 -> 281
    //   151: aload 10
    //   153: iconst_0
    //   154: invokevirtual 133	org/jsoup/select/Elements:get	(I)Lorg/jsoup/nodes/Element;
    //   157: astore 11
    //   159: aload_2
    //   160: aload 8
    //   162: invokeinterface 137 2 0
    //   167: astore 12
    //   169: aload 12
    //   171: instanceof 141
    //   174: ifeq +28 -> 202
    //   177: aload 11
    //   179: aload 12
    //   181: checkcast 141	org/jsoup/nodes/Attribute
    //   184: invokevirtual 143	org/jsoup/nodes/Attribute:getKey	()Ljava/lang/String;
    //   187: aload 12
    //   189: checkcast 141	org/jsoup/nodes/Attribute
    //   192: invokevirtual 146	org/jsoup/nodes/Attribute:getValue	()Ljava/lang/String;
    //   195: invokevirtual 149	org/jsoup/nodes/Element:attr	(Ljava/lang/String;Ljava/lang/String;)Lorg/jsoup/nodes/Element;
    //   198: pop
    //   199: goto +82 -> 281
    //   202: aload 12
    //   204: instanceof 155
    //   207: ifeq +61 -> 268
    //   210: aload 12
    //   212: checkcast 155	org/jsoup/nodes/Attributes
    //   215: astore 13
    //   217: aload 13
    //   219: invokevirtual 157	org/jsoup/nodes/Attributes:iterator	()Ljava/util/Iterator;
    //   222: astore 15
    //   224: goto +31 -> 255
    //   227: aload 15
    //   229: invokeinterface 115 1 0
    //   234: checkcast 141	org/jsoup/nodes/Attribute
    //   237: astore 14
    //   239: aload 11
    //   241: aload 14
    //   243: invokevirtual 143	org/jsoup/nodes/Attribute:getKey	()Ljava/lang/String;
    //   246: aload 14
    //   248: invokevirtual 146	org/jsoup/nodes/Attribute:getValue	()Ljava/lang/String;
    //   251: invokevirtual 149	org/jsoup/nodes/Element:attr	(Ljava/lang/String;Ljava/lang/String;)Lorg/jsoup/nodes/Element;
    //   254: pop
    //   255: aload 15
    //   257: invokeinterface 158 1 0
    //   262: ifne -35 -> 227
    //   265: goto +16 -> 281
    //   268: aload 11
    //   270: aload 8
    //   272: aload 12
    //   274: checkcast 121	java/lang/String
    //   277: invokevirtual 149	org/jsoup/nodes/Element:attr	(Ljava/lang/String;Ljava/lang/String;)Lorg/jsoup/nodes/Element;
    //   280: pop
    //   281: aload 9
    //   283: invokeinterface 158 1 0
    //   288: ifne -166 -> 122
    //   291: aload_3
    //   292: aload 7
    //   294: invokevirtual 161	org/jsoup/nodes/Document:html	()Ljava/lang/String;
    //   297: aload 5
    //   299: invokevirtual 164	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   302: invokevirtual 168	java/io/OutputStream:write	([B)V
    //   305: aload_3
    //   306: invokevirtual 174	java/io/OutputStream:flush	()V
    //   309: goto +20 -> 329
    //   312: astore 16
    //   314: iconst_1
    //   315: anewarray 177	java/lang/Object
    //   318: dup
    //   319: iconst_0
    //   320: aload 6
    //   322: aastore
    //   323: invokestatic 179	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   326: aload 16
    //   328: athrow
    //   329: iconst_1
    //   330: anewarray 177	java/lang/Object
    //   333: dup
    //   334: iconst_0
    //   335: aload 6
    //   337: aastore
    //   338: invokestatic 179	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   341: return
    // Line number table:
    //   Java source line #86	-> byte code offset #0
    //   Java source line #87	-> byte code offset #13
    //   Java source line #88	-> byte code offset #20
    //   Java source line #90	-> byte code offset #33
    //   Java source line #92	-> byte code offset #54
    //   Java source line #93	-> byte code offset #63
    //   Java source line #94	-> byte code offset #68
    //   Java source line #96	-> byte code offset #73
    //   Java source line #98	-> byte code offset #76
    //   Java source line #99	-> byte code offset #85
    //   Java source line #100	-> byte code offset #96
    //   Java source line #102	-> byte code offset #106
    //   Java source line #103	-> byte code offset #134
    //   Java source line #104	-> byte code offset #143
    //   Java source line #105	-> byte code offset #151
    //   Java source line #106	-> byte code offset #159
    //   Java source line #107	-> byte code offset #169
    //   Java source line #108	-> byte code offset #177
    //   Java source line #109	-> byte code offset #202
    //   Java source line #110	-> byte code offset #210
    //   Java source line #111	-> byte code offset #217
    //   Java source line #112	-> byte code offset #239
    //   Java source line #111	-> byte code offset #255
    //   Java source line #115	-> byte code offset #268
    //   Java source line #102	-> byte code offset #281
    //   Java source line #120	-> byte code offset #291
    //   Java source line #121	-> byte code offset #305
    //   Java source line #122	-> byte code offset #312
    //   Java source line #123	-> byte code offset #320
    //   Java source line #124	-> byte code offset #326
    //   Java source line #122	-> byte code offset #329
    //   Java source line #123	-> byte code offset #335
    //   Java source line #125	-> byte code offset #341
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	342	0	this	JsoupTemplateEngine
    //   0	342	1	templateKey	String
    //   0	342	2	modelProvider	org.tizen.common.verrari.IModelProvider
    //   0	342	3	output	java.io.OutputStream
    //   18	59	4	template	org.tizen.common.verrari.ITemplate
    //   61	237	5	encoding	String
    //   74	262	6	input	java.io.InputStream
    //   94	199	7	doc	org.jsoup.nodes.Document
    //   132	139	8	key	String
    //   117	165	9	localIterator1	java.util.Iterator
    //   141	11	10	elements	org.jsoup.select.Elements
    //   157	112	11	element	org.jsoup.nodes.Element
    //   167	106	12	attr	Object
    //   215	3	13	attributes	org.jsoup.nodes.Attributes
    //   237	10	14	attribute	org.jsoup.nodes.Attribute
    //   222	34	15	localIterator2	java.util.Iterator
    //   312	15	16	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   76	312	312	finally
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.jsoup.JsoupTemplateEngine
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.engine.method;

import java.text.SimpleDateFormat;
import java.util.Date;
import org.tizen.common.AppIdGenerator;
import org.tizen.common.verrari.IModelManager;

public abstract class AbstractTemplateEngineMethod
{
  public void reigister(IModelManager manager)
  {
    manager.addModel("YEAR", getYearWrapper());
    manager.addModel("DATE", getDateWrapper());
    manager.addModel("TIME", getTimeWrapper());
    manager.addModel("USER", getUserWrapper());
    manager.addModel("APPLICATIONID", getApplicationIDWrapper());
  }
  
  public abstract Object getYearWrapper();
  
  public abstract Object getDateWrapper();
  
  public abstract Object getTimeWrapper();
  
  public abstract Object getUserWrapper();
  
  public abstract Object getApplicationIDWrapper();
  
  public static String getYear()
  {
    SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy");
    return yearFormat.format(new Date());
  }
  
  public static String getDate()
  {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd");
    return dateFormat.format(new Date());
  }
  
  public static String getTime()
  {
    SimpleDateFormat timeFormat = new SimpleDateFormat("k:mm:ss");
    return timeFormat.format(new Date());
  }
  
  public static String getUser()
  {
    return System.getProperty("user.name");
  }
  
  public static String getApplicationID()
  {
    return AppIdGenerator.getInstance().create();
  }
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.engine.method.AbstractTemplateEngineMethod
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.common.verrari.model;

import java.util.Map;
import org.tizen.common.verrari.IModelManager;

public class ModelManager
  extends ModelProvider
  implements IModelManager
{
  public ModelManager() {}
  
  public ModelManager(Map<String, Object> models)
  {
    super(models);
  }
  
  public void addModel(String key, Object model)
  {
    models.put(key, model);
  }
  
  public void removeMo
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd