org.tizen.common.verrari.realm_2.0.0.201310241620

16:49:56.170 INFO  jd.cli.Main - Decompiling org.tizen.common.verrari.realm_2.0.0.201310241620.jar
package org.tizen.common.verrari;

import java.util.Map;

public abstract interface AttributeConfiguable
{
  public abstract void setAttributes(Map<String, String> paramMap);
}

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

import java.util.Collection;

public abstract interface AttributeContainer
{
  public abstract Collection<String> getAttributeKeys();
  
  public abstract String getAttribute(String paramString);
}

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

public enum Condition$Operation
{
  Equals,  Contains,  CaseInsensitiveContains;
}

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

import java.io.Serializable;

public class Condition
  implements Serializable
{
  private static final long serialVersionUID = -1254191699371474861L;
  protected Object left;
  protected Object right;
  protected Operation operation;
  
  public static enum Operation
  {
    Equals,  Contains,  CaseInsensitiveContains;
  }
  
  public Condition(Operation op, Object left, Object right)
  {
    operation = op;
    this.left = left;
    this.right = right;
  }
  
  public Condition(Operation op, String right)
  {
    this(op, null, right);
  }
  
  public Operation getOperation()
  {
    return operation;
  }
  
  public Object getLeft()
  {
    return left;
  }
  
  public Object getRight()
  {
    return right;
  }
}

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

import java.io.IOException;

public abstract interface Realm
  extends AttributeContainer
{
  public abstract Template getTemplate(String paramString)
    throws IOException;
}

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

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.FactoryWithArgument;
import org.tizen.common.util.IOUtil;

public class RealmFactory
  implements FactoryWithArgument<Realm, URL>
{
  protected static final RealmFactory instance = new RealmFactory();
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  
  public static RealmFactory getInstance()
  {
    return instance;
  }
  
  protected Map<String, String> parseRealm(InputStream in, String contentType)
    throws IOException
  {
    HashMap<String, String> attrs = null;
    
    byte[] bytes = IOUtil.getBytes(in);
    logger.debug("Realm config :\n{}", new String(bytes));
    
    ByteArrayInputStream byteIn = new ByteArrayInputStream(bytes);
    
    attrs = new HashMap();
    ObjectMapper mapper = new ObjectMapper();
    JsonNode node = (JsonNode)mapper.readValue(byteIn, JsonNode.class);
    for (Iterator<String> iter = node.getFieldNames(); iter.hasNext();)
    {
      String key = (String)iter.next();
      attrs.put(key, node.get(key).asText());
    }
    logger.debug("Realm Attributes :{}", attrs);
    
    return attrs;
  }
  
  /* Error */
  public Realm create(URL url)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokevirtual 132	java/net/URL:openConnection	()Ljava/net/URLConnection;
    //   4: astore_2
    //   5: aload_2
    //   6: invokevirtual 138	java/net/URLConnection:connect	()V
    //   9: aload_2
    //   10: invokevirtual 143	java/net/URLConnection:getInputStream	()Ljava/io/InputStream;
    //   13: astore_3
    //   14: iconst_2
    //   15: anewarray 52	java/lang/String
    //   18: dup
    //   19: iconst_0
    //   20: aload_2
    //   21: invokevirtual 147	java/net/URLConnection:getContentType	()Ljava/lang/String;
    //   24: aastore
    //   25: dup
    //   26: iconst_1
    //   27: ldc -106
    //   29: aastore
    //   30: invokestatic 152	org/tizen/common/util/StringUtil:nvl	([Ljava/lang/String;)Ljava/lang/String;
    //   33: astore 4
    //   35: aload_0
    //   36: getfield 32	org/tizen/common/verrari/RealmFactory:logger	Lorg/slf4j/Logger;
    //   39: ldc -98
    //   41: aload 4
    //   43: invokeinterface 57 3 0
    //   48: aload_0
    //   49: aload_3
    //   50: aload 4
    //   52: invokevirtual 160	org/tizen/common/verrari/RealmFactory:parseRealm	(Ljava/io/InputStream;Ljava/lang/String;)Ljava/util/Map;
    //   55: astore 5
    //   57: aload 5
    //   59: ifnonnull +32 -> 91
    //   62: new 162	java/lang/IllegalArgumentException
    //   65: dup
    //   66: new 164	java/lang/StringBuilder
    //   69: dup
    //   70: ldc -90
    //   72: invokespecial 168	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   75: aload_1
    //   76: invokevirtual 171	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   79: ldc -81
    //   81: invokevirtual 177	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   84: invokevirtual 180	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   87: invokespecial 183	java/lang/IllegalArgumentException:<init>	(Ljava/lang/String;)V
    //   90: athrow
    //   91: invokestatic 184	org/tizen/common/verrari/util/QueryFactory:getInstance	()Lorg/tizen/common/verrari/util/QueryFactory;
    //   94: aload 5
    //   96: ldc -67
    //   98: invokeinterface 191 2 0
    //   103: checkcast 52	java/lang/String
    //   106: new 66	java/util/HashMap
    //   109: dup
    //   110: invokespecial 68	java/util/HashMap:<init>	()V
    //   113: invokevirtual 196	org/tizen/common/verrari/util/QueryFactory:query	(Ljava/lang/String;Ljava/util/Map;)Ljava/lang/String;
    //   116: astore 6
    //   118: aload_0
    //   119: getfield 32	org/tizen/common/verrari/RealmFactory:logger	Lorg/slf4j/Logger;
    //   122: ldc -56
    //   124: aload 6
    //   126: invokeinterface 57 3 0
    //   131: new 202	org/tizen/common/classloader/JarClassSource
    //   134: dup
    //   135: aload 6
    //   137: invokespecial 204	org/tizen/common/classloader/JarClassSource:<init>	(Ljava/lang/String;)V
    //   140: astore 7
    //   142: aload_0
    //   143: getfield 32	org/tizen/common/verrari/RealmFactory:logger	Lorg/slf4j/Logger;
    //   146: ldc -51
    //   148: aload 7
    //   150: invokeinterface 57 3 0
    //   155: invokestatic 207	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   158: invokevirtual 213	java/lang/Thread:getContextClassLoader	()Ljava/lang/ClassLoader;
    //   161: astore 8
    //   163: aload_0
    //   164: getfield 32	org/tizen/common/verrari/RealmFactory:logger	Lorg/slf4j/Logger;
    //   167: ldc -39
    //   169: aload 8
    //   171: invokeinterface 57 3 0
    //   176: new 219	org/tizen/common/classloader/CustomClassLoader
    //   179: dup
    //   180: invokestatic 207	java/lang/Thread:currentThread	()Ljava/lang/Thread;
    //   183: invokevirtual 213	java/lang/Thread:getContextClassLoader	()Ljava/lang/ClassLoader;
    //   186: iconst_1
    //   187: anewarray 221	org/tizen/common/classloader/ClassSource
    //   190: dup
    //   191: iconst_0
    //   192: aload 7
    //   194: aastore
    //   195: invokespecial 223	org/tizen/common/classloader/CustomClassLoader:<init>	(Ljava/lang/ClassLoader;[Lorg/tizen/common/classloader/ClassSource;)V
    //   198: astore 9
    //   200: aload_0
    //   201: aload 9
    //   203: aload 5
    //   205: invokevirtual 226	org/tizen/common/verrari/RealmFactory:load	(Ljava/lang/ClassLoader;Ljava/util/Map;)Lorg/tizen/common/verrari/Realm;
    //   208: astore 10
    //   210: aload 10
    //   212: ifnonnull +16 -> 228
    //   215: aload_0
    //   216: getfield 32	org/tizen/common/verrari/RealmFactory:logger	Lorg/slf4j/Logger;
    //   219: ldc -26
    //   221: aload 6
    //   223: invokeinterface 232 3 0
    //   228: aload 10
    //   230: astore 12
    //   232: iconst_1
    //   233: anewarray 3	java/lang/Object
    //   236: dup
    //   237: iconst_0
    //   238: aload_3
    //   239: aastore
    //   240: invokestatic 235	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   243: aload 12
    //   245: areturn
    //   246: astore 11
    //   248: iconst_1
    //   249: anewarray 3	java/lang/Object
    //   252: dup
    //   253: iconst_0
    //   254: aload_3
    //   255: aastore
    //   256: invokestatic 235	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   259: aload 11
    //   261: athrow
    //   262: astore_2
    //   263: new 162	java/lang/IllegalArgumentException
    //   266: dup
    //   267: aload_2
    //   268: invokespecial 239	java/lang/IllegalArgumentException:<init>	(Ljava/lang/Throwable;)V
    //   271: athrow
    //   272: astore_2
    //   273: new 242	java/lang/IllegalStateException
    //   276: dup
    //   277: aload_2
    //   278: invokespecial 244	java/lang/IllegalStateException:<init>	(Ljava/lang/Throwable;)V
    //   281: athrow
    //   282: astore_2
    //   283: new 242	java/lang/IllegalStateException
    //   286: dup
    //   287: aload_2
    //   288: invokespecial 244	java/lang/IllegalStateException:<init>	(Ljava/lang/Throwable;)V
    //   291: athrow
    //   292: astore_2
    //   293: new 242	java/lang/IllegalStateException
    //   296: dup
    //   297: aload_2
    //   298: invokespecial 244	java/lang/IllegalStateException:<init>	(Ljava/lang/Throwable;)V
    //   301: athrow
    // Line number table:
    //   Java source line #141	-> byte code offset #0
    //   Java source line #142	-> byte code offset #5
    //   Java source line #143	-> byte code offset #9
    //   Java source line #148	-> byte code offset #14
    //   Java source line #149	-> byte code offset #20
    //   Java source line #151	-> byte code offset #35
    //   Java source line #153	-> byte code offset #48
    //   Java source line #155	-> byte code offset #57
    //   Java source line #157	-> byte code offset #62
    //   Java source line #159	-> byte code offset #91
    //   Java source line #160	-> byte code offset #118
    //   Java source line #161	-> byte code offset #131
    //   Java source line #162	-> byte code offset #142
    //   Java source line #163	-> byte code offset #155
    //   Java source line #164	-> byte code offset #163
    //   Java source line #165	-> byte code offset #176
    //   Java source line #167	-> byte code offset #200
    //   Java source line #169	-> byte code offset #210
    //   Java source line #171	-> byte code offset #215
    //   Java source line #173	-> byte code offset #228
    //   Java source line #177	-> byte code offset #232
    //   Java source line #178	-> byte code offset #238
    //   Java source line #173	-> byte code offset #243
    //   Java source line #177	-> byte code offset #246
    //   Java source line #178	-> byte code offset #254
    //   Java source line #179	-> byte code offset #259
    //   Java source line #181	-> byte code offset #262
    //   Java source line #183	-> byte code offset #263
    //   Java source line #185	-> byte code offset #272
    //   Java source line #187	-> byte code offset #273
    //   Java source line #189	-> byte code offset #282
    //   Java source line #191	-> byte code offset #283
    //   Java source line #193	-> byte code offset #292
    //   Java source line #195	-> byte code offset #293
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	302	0	this	RealmFactory
    //   0	302	1	url	URL
    //   4	17	2	con	java.net.URLConnection
    //   262	6	2	e	IOException
    //   272	6	2	e	ClassNotFoundException
    //   282	6	2	e	InstantiationException
    //   292	6	2	e	IllegalAccessException
    //   13	242	3	in	InputStream
    //   33	18	4	contentType	String
    //   55	149	5	attrs	Map<String, String>
    //   116	106	6	loader	String
    //   140	53	7	source	org.tizen.common.classloader.ClassSource
    //   161	9	8	old	ClassLoader
    //   198	4	9	cl	org.tizen.common.classloader.CustomClassLoader
    //   208	21	10	realm	Realm
    //   246	14	11	localObject	Object
    //   230	14	12	localRealm1	Realm
    // Exception table:
    //   from	to	target	type
    //   14	232	246	finally
    //   0	243	262	java/io/IOException
    //   246	262	262	java/io/IOException
    //   0	243	272	java/lang/ClassNotFoundException
    //   246	262	272	java/lang/ClassNotFoundException
    //   0	243	282	java/lang/InstantiationException
    //   246	262	282	java/lang/InstantiationException
    //   0	243	292	java/lang/IllegalAccessException
    //   246	262	292	java/lang/IllegalAccessException
  }
  
  /* Error */
  protected Realm load(ClassLoader cl, Map<String, String> attrs)
    throws IOException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 32	org/tizen/common/verrari/RealmFactory:logger	Lorg/slf4j/Logger;
    //   4: ldc_w 277
    //   7: aload_1
    //   8: invokeinterface 279 3 0
    //   13: aload_1
    //   14: ldc_w 282
    //   17: invokevirtual 284	java/lang/ClassLoader:getResources	(Ljava/lang/String;)Ljava/util/Enumeration;
    //   20: astore_3
    //   21: goto +130 -> 151
    //   24: aload_3
    //   25: invokeinterface 288 1 0
    //   30: checkcast 133	java/net/URL
    //   33: astore 4
    //   35: aload 4
    //   37: invokevirtual 293	java/net/URL:openStream	()Ljava/io/InputStream;
    //   40: astore 5
    //   42: aload 5
    //   44: ifnonnull +6 -> 50
    //   47: goto +104 -> 151
    //   50: aload_0
    //   51: aload 5
    //   53: invokevirtual 296	org/tizen/common/verrari/RealmFactory:getRealmName	(Ljava/io/InputStream;)Ljava/lang/String;
    //   56: astore 6
    //   58: aload 6
    //   60: ifnonnull +18 -> 78
    //   63: iconst_1
    //   64: anewarray 3	java/lang/Object
    //   67: dup
    //   68: iconst_0
    //   69: aload 5
    //   71: aastore
    //   72: invokestatic 235	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   75: goto +76 -> 151
    //   78: aload_1
    //   79: aload 6
    //   81: invokevirtual 300	java/lang/ClassLoader:loadClass	(Ljava/lang/String;)Ljava/lang/Class;
    //   84: astore 7
    //   86: aload 7
    //   88: invokevirtual 304	java/lang/Class:newInstance	()Ljava/lang/Object;
    //   91: checkcast 272	org/tizen/common/verrari/Realm
    //   94: astore 8
    //   96: aload 8
    //   98: instanceof 309
    //   101: ifeq +14 -> 115
    //   104: aload 8
    //   106: checkcast 309	org/tizen/common/verrari/AttributeConfiguable
    //   109: aload_2
    //   110: invokeinterface 311 2 0
    //   115: aload 8
    //   117: astore 10
    //   119: iconst_1
    //   120: anewarray 3	java/lang/Object
    //   123: dup
    //   124: iconst_0
    //   125: aload 5
    //   127: aastore
    //   128: invokestatic 235	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   131: aload 10
    //   133: areturn
    //   134: astore 9
    //   136: iconst_1
    //   137: anewarray 3	java/lang/Object
    //   140: dup
    //   141: iconst_0
    //   142: aload 5
    //   144: aastore
    //   145: invokestatic 235	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   148: aload 9
    //   150: athrow
    //   151: aload_3
    //   152: invokeinterface 315 1 0
    //   157: ifne -133 -> 24
    //   160: aconst_null
    //   161: areturn
    // Line number table:
    //   Java source line #220	-> byte code offset #0
    //   Java source line #221	-> byte code offset #13
    //   Java source line #223	-> byte code offset #21
    //   Java source line #225	-> byte code offset #24
    //   Java source line #227	-> byte code offset #35
    //   Java source line #228	-> byte code offset #42
    //   Java source line #230	-> byte code offset #47
    //   Java source line #235	-> byte code offset #50
    //   Java source line #236	-> byte code offset #58
    //   Java source line #252	-> byte code offset #63
    //   Java source line #253	-> byte code offset #69
    //   Java source line #238	-> byte code offset #75
    //   Java source line #240	-> byte code offset #78
    //   Java source line #242	-> byte code offset #86
    //   Java source line #245	-> byte code offset #96
    //   Java source line #246	-> byte code offset #104
    //   Java source line #249	-> byte code offset #115
    //   Java source line #252	-> byte code offset #119
    //   Java source line #253	-> byte code offset #125
    //   Java source line #249	-> byte code offset #131
    //   Java source line #252	-> byte code offset #134
    //   Java source line #253	-> byte code offset #142
    //   Java source line #254	-> byte code offset #148
    //   Java source line #223	-> byte code offset #151
    //   Java source line #257	-> byte code offset #160
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	162	0	this	RealmFactory
    //   0	162	1	cl	ClassLoader
    //   0	162	2	attrs	Map<String, String>
    //   20	132	3	manifestUrls	java.util.Enumeration<URL>
    //   33	3	4	url	URL
    //   40	103	5	manifestIn	InputStream
    //   56	24	6	realmName	String
    //   84	3	7	clazz	Class<?>
    //   94	22	8	realm	Realm
    //   134	15	9	localObject	Object
    //   117	15	10	localRealm1	Realm
    // Exception table:
    //   from	to	target	type
    //   50	63	134	finally
    //   78	119	134	finally
  }
  
  /* Error */
  public String getRealmName(InputStream in)
    throws IOException
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 44	org/tizen/common/util/IOUtil:getBytes	(Ljava/io/InputStream;)[B
    //   4: astore_2
    //   5: new 326	java/util/jar/Manifest
    //   8: dup
    //   9: new 63	java/io/ByteArrayInputStream
    //   12: dup
    //   13: aload_2
    //   14: invokespecial 65	java/io/ByteArrayInputStream:<init>	([B)V
    //   17: invokespecial 328	java/util/jar/Manifest:<init>	(Ljava/io/InputStream;)V
    //   20: astore_3
    //   21: aload_3
    //   22: invokevirtual 331	java/util/jar/Manifest:getMainAttributes	()Ljava/util/jar/Attributes;
    //   25: astore 4
    //   27: aload 4
    //   29: ldc_w 335
    //   32: invokevirtual 337	java/util/jar/Attributes:getValue	(Ljava/lang/String;)Ljava/lang/String;
    //   35: invokestatic 343	org/tizen/common/util/StringUtil:trim	(Ljava/lang/String;)Ljava/lang/String;
    //   38: astore 5
    //   40: aload 5
    //   42: ifnull +17 -> 59
    //   45: aload_0
    //   46: getfield 32	org/tizen/common/verrari/RealmFactory:logger	Lorg/slf4j/Logger;
    //   49: ldc_w 346
    //   52: aload 5
    //   54: invokeinterface 348 3 0
    //   59: aload 5
    //   61: astore 7
    //   63: iconst_1
    //   64: anewarray 3	java/lang/Object
    //   67: dup
    //   68: iconst_0
    //   69: aload_1
    //   70: aastore
    //   71: invokestatic 235	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   74: aload 7
    //   76: areturn
    //   77: astore 6
    //   79: iconst_1
    //   80: anewarray 3	java/lang/Object
    //   83: dup
    //   84: iconst_0
    //   85: aload_1
    //   86: aastore
    //   87: invokestatic 235	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   90: aload 6
    //   92: athrow
    // Line number table:
    //   Java source line #278	-> byte code offset #0
    //   Java source line #279	-> byte code offset #5
    //   Java source line #280	-> byte code offset #21
    //   Java source line #281	-> byte code offset #27
    //   Java source line #282	-> byte code offset #40
    //   Java source line #284	-> byte code offset #45
    //   Java source line #286	-> byte code offset #59
    //   Java source line #289	-> byte code offset #63
    //   Java source line #290	-> byte code offset #69
    //   Java source line #286	-> byte code offset #74
    //   Java source line #289	-> byte code offset #77
    //   Java source line #290	-> byte code offset #85
    //   Java source line #291	-> byte code offset #90
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	93	0	this	RealmFactory
    //   0	93	1	in	InputStream
    //   4	10	2	contents	byte[]
    //   20	2	3	m	java.util.jar.Manifest
    //   25	3	4	attrs	java.util.jar.Attributes
    //   38	22	5	realmName	String
    //   77	14	6	localObject	Object
    //   61	14	7	str1	String
    // Exception table:
    //   from	to	target	type
    //   0	63	77	finally
  }
}

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

import java.io.IOException;
import java.util.Collection;

public abstract interface SearchableRealm
{
  public abstract Collection<AttributeContainer> search(Condition paramCondition)
    throws IOException;
}

/* Location:
 * Qualified Name:     org.tizen.common.verrari.SearchableRealm
 * 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;
import java.io.OutputStream;

public abstract interface Storage
{
  public abstract OutputStream getTarget(String paramString)
    throws IOException;
  
  public abstract InputStream getSource(String paramString)
    throws IOException;
}

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

public abstract interface Template
  extends AttributeContainer
{
  public abstract void template(IModelProvider paramIModelProvider, Storage paramStorage)
    throws TemplateException;
}

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

import org.tizen.common.verrari.TemplateException;

public class InvalidMapperException
  extends TemplateException
{
  private static final long serialVersionUID = 3697025810808668703L;
  
  public InvalidMapperException() {}
  
  public InvalidMapperException(String msg)
  {
    super(msg);
  }
}

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

import org.tizen.common.verrari.TemplateException;

public class UnsupportedVersionException
  extends TemplateException
{
  private static final long serialVersionUID = 6945520707261158918L;
}

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

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.verrari.AttributeConfiguable;
import org.tizen.common.verrari.Realm;
import org.tizen.common.verrari.util.QueryFactory;

public abstract class CommonRealm
  implements Realm, AttributeConfiguable
{
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  protected HashMap<String, String> attributes;
  
  public static String[] separate(String value)
  {
    if (value == null) {
      return null;
    }
    Pattern p = Pattern.compile("[,;]+");
    return p.split(value);
  }
  
  public Collection<String> getAttributeKeys()
  {
    return attributes.keySet();
  }
  
  public String getAttribute(String key)
  {
    String value = (String)attributes.get(key);
    logger.debug("Key :{}, Value :{}", key, value);
    if (value == null) {
      return null;
    }
    return QueryFactory.getInstance().query(value, new HashMap());
  }
  
  public void setAttributes(Map<String, String> attrs)
  {
    if (attributes == null) {
      attributes = new HashMap(attrs);
    } else {
      throw new IllegalStateException("Setting attributes is duplicated");
    }
  }
  
  public void setAttributes(String key, String value)
  {
    if (attributes == null) {
      attributes = new HashMap();
    }
    attributes.put(key, value);
  }
  
  protected Query getTemplateQuery(Realm realm)
  {
    QueryFactory factory = QueryFactory.getInstance();
    return factory.createTemplateQuery(realm);
  }
}

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

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tizen.common.verrari.Realm;
import org.tizen.common.verrari.Template;

public class CompositeRealm
  implements Realm
{
  protected final Logger logger = LoggerFactory.getLogger(getClass());
  protected final ArrayList<Realm> chain = new ArrayList();
  
  public void addRealm(Realm realm)
  {
    chain.add(realm);
  }
  
  public Realm[] getRealm()
  {
    if (chain.isEmpty()) {
      return null;
    }
    return (Realm[])chain.toArray(new Realm[0]);
  }
  
  public Collection<String> getAttributeKeys()
  {
    throw new UnsupportedOperationException();
  }
  
  public String getAttribute(String key)
  {
    throw new UnsupportedOperationException();
  }
  
  public Template getTemplate(String id)
    throws IOException
  {
    for (Realm realm : chain) {
      try
      {
        Template template = realm.getTemplate(id);
        if (template != null) {
          return template;
        }
      }
      catch (IOException e)
      {
        logger.debug("Realm : {} in {} ", realm, e.getMessage());
      }
    }
    return null;
  }
}

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

import java.io.File;
import java.io.IOException;
import java.net.URI;
import org.tizen.common.verrari.Template;
import org.tizen.common.verrari.TemplateException;
import org.tizen.common.verrari.template.DirectoryTemplate;

public class DirectoryRealm
  extends CommonRealm
{
  /* Error */
  public Template getTemplate(String id)
    throws IOException
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_0
    //   2: invokevirtual 19	org/tizen/common/verrari/realm/DirectoryRealm:getTemplateQuery	(Lorg/tizen/common/verrari/Realm;)Lorg/tizen/common/verrari/realm/Query;
    //   5: astore_2
    //   6: iconst_1
    //   7: anewarray 23	[Ljava/lang/Object;
    //   10: dup
    //   11: iconst_0
    //   12: iconst_2
    //   13: anewarray 25	java/lang/Object
    //   16: dup
    //   17: iconst_0
    //   18: ldc 27
    //   20: aastore
    //   21: dup
    //   22: iconst_1
    //   23: aload_1
    //   24: aastore
    //   25: aastore
    //   26: invokestatic 29	org/tizen/common/util/MapUtil:asMap	([[Ljava/lang/Object;)Ljava/util/Map;
    //   29: astore_3
    //   30: aload_0
    //   31: getfield 35	org/tizen/common/verrari/realm/DirectoryRealm:logger	Lorg/slf4j/Logger;
    //   34: ldc 39
    //   36: aload_3
    //   37: invokeinterface 41 3 0
    //   42: aload_2
    //   43: aload_3
    //   44: invokeinterface 47 2 0
    //   49: astore 4
    //   51: aload_0
    //   52: getfield 35	org/tizen/common/verrari/realm/DirectoryRealm:logger	Lorg/slf4j/Logger;
    //   55: ldc 53
    //   57: aload 4
    //   59: invokeinterface 41 3 0
    //   64: new 55	java/net/URL
    //   67: dup
    //   68: aload 4
    //   70: invokespecial 57	java/net/URL:<init>	(Ljava/lang/String;)V
    //   73: astore 5
    //   75: aconst_null
    //   76: astore 6
    //   78: aload_0
    //   79: aload 5
    //   81: invokevirtual 60	java/net/URL:toURI	()Ljava/net/URI;
    //   84: invokevirtual 64	org/tizen/common/verrari/realm/DirectoryRealm:getURItoFile	(Ljava/net/URI;)Ljava/io/File;
    //   87: astore 6
    //   89: aload_0
    //   90: aload 6
    //   92: invokevirtual 68	org/tizen/common/verrari/realm/DirectoryRealm:getTemplate	(Ljava/io/File;)Lorg/tizen/common/verrari/Template;
    //   95: astore 8
    //   97: iconst_1
    //   98: anewarray 25	java/lang/Object
    //   101: dup
    //   102: iconst_0
    //   103: aload 6
    //   105: aastore
    //   106: invokestatic 71	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   109: aload 8
    //   111: areturn
    //   112: pop
    //   113: new 17	java/io/IOException
    //   116: dup
    //   117: new 77	java/lang/StringBuilder
    //   120: dup
    //   121: ldc 79
    //   123: invokespecial 81	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   126: aload_1
    //   127: invokevirtual 82	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   130: ldc 86
    //   132: invokevirtual 82	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   135: invokevirtual 88	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   138: invokespecial 92	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   141: athrow
    //   142: astore 7
    //   144: iconst_1
    //   145: anewarray 25	java/lang/Object
    //   148: dup
    //   149: iconst_0
    //   150: aload 6
    //   152: aastore
    //   153: invokestatic 71	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   156: aload 7
    //   158: athrow
    // Line number table:
    //   Java source line #66	-> byte code offset #0
    //   Java source line #67	-> byte code offset #6
    //   Java source line #68	-> byte code offset #30
    //   Java source line #69	-> byte code offset #42
    //   Java source line #71	-> byte code offset #51
    //   Java source line #72	-> byte code offset #64
    //   Java source line #74	-> byte code offset #75
    //   Java source line #78	-> byte code offset #78
    //   Java source line #79	-> byte code offset #89
    //   Java source line #86	-> byte code offset #97
    //   Java source line #87	-> byte code offset #103
    //   Java source line #79	-> byte code offset #109
    //   Java source line #81	-> byte code offset #112
    //   Java source line #83	-> byte code offset #113
    //   Java source line #86	-> byte code offset #142
    //   Java source line #87	-> byte code offset #150
    //   Java source line #88	-> byte code offset #156
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	159	0	this	DirectoryRealm
    //   0	159	1	id	String
    //   5	38	2	templateQuery	Query
    //   29	15	3	modelMap	java.util.Map<?, ?>
    //   49	20	4	query	String
    //   73	7	5	url	java.net.URL
    //   76	75	6	file	File
    //   142	15	7	localObject	Object
    //   95	15	8	localTemplate	Template
    //   112	1	9	localURISyntaxException	java.net.URISyntaxException
    // Exception table:
    //   from	to	target	type
    //   78	97	112	java/net/URISyntaxException
    //   78	97	142	finally
    //   112	142	142	finally
  }
  
  public Template getTemplate(File file)
    throws IOException
  {
    try
    {
      return new DirectoryTemplate(file);
    }
    catch (TemplateException e)
    {
      throw new IOException(e);
    }
  }
  
  protected File getURItoFile(URI uri)
  {
    return new File(uri);
  }
}

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

import org.tizen.common.verrari.SearchableRealm;

public class DirectorySearchableRealm
  extends DirectoryRealm
  implements SearchableRealm
{
  /* Error */
  public java.util.Collection<org.tizen.common.verrari.AttributeContainer> search(org.tizen.common.verrari.Condition condition)
    throws java.io.IOException
  {
    // Byte code:
    //   0: new 25	java/util/HashSet
    //   3: dup
    //   4: invokespecial 27	java/util/HashSet:<init>	()V
    //   7: astore_2
    //   8: aload_0
    //   9: ldc 28
    //   11: invokevirtual 30	org/tizen/common/verrari/realm/DirectorySearchableRealm:getAttribute	(Ljava/lang/String;)Ljava/lang/String;
    //   14: astore_3
    //   15: aload_0
    //   16: ldc 34
    //   18: invokevirtual 30	org/tizen/common/verrari/realm/DirectorySearchableRealm:getAttribute	(Ljava/lang/String;)Ljava/lang/String;
    //   21: astore 4
    //   23: aload_0
    //   24: getfield 36	org/tizen/common/verrari/realm/DirectorySearchableRealm:logger	Lorg/slf4j/Logger;
    //   27: ldc 40
    //   29: aload_3
    //   30: aload 4
    //   32: invokeinterface 42 4 0
    //   37: ldc 48
    //   39: aload_3
    //   40: invokevirtual 50	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   43: ifeq +473 -> 516
    //   46: new 56	java/net/URL
    //   49: dup
    //   50: aload 4
    //   52: invokespecial 58	java/net/URL:<init>	(Ljava/lang/String;)V
    //   55: astore 5
    //   57: goto +32 -> 89
    //   60: astore 6
    //   62: new 61	java/lang/IllegalArgumentException
    //   65: dup
    //   66: new 63	java/lang/StringBuilder
    //   69: dup
    //   70: ldc 65
    //   72: invokespecial 67	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   75: aload 4
    //   77: invokevirtual 68	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   80: invokevirtual 72	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   83: aload 6
    //   85: invokespecial 76	java/lang/IllegalArgumentException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   88: athrow
    //   89: ldc 79
    //   91: aload 5
    //   93: invokevirtual 81	java/net/URL:getProtocol	()Ljava/lang/String;
    //   96: invokevirtual 50	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   99: ifne +13 -> 112
    //   102: new 84	java/lang/UnsupportedOperationException
    //   105: dup
    //   106: ldc 86
    //   108: invokespecial 88	java/lang/UnsupportedOperationException:<init>	(Ljava/lang/String;)V
    //   111: athrow
    //   112: aload_1
    //   113: invokevirtual 89	org/tizen/common/verrari/Condition:getOperation	()Lorg/tizen/common/verrari/Condition$Operation;
    //   116: astore 6
    //   118: aload_1
    //   119: invokevirtual 95	org/tizen/common/verrari/Condition:getRight	()Ljava/lang/Object;
    //   122: checkcast 51	java/lang/String
    //   125: astore 7
    //   127: aload 5
    //   129: invokevirtual 99	java/net/URL:getFile	()Ljava/lang/String;
    //   132: astore 8
    //   134: new 102	java/io/File
    //   137: dup
    //   138: aload 8
    //   140: invokespecial 104	java/io/File:<init>	(Ljava/lang/String;)V
    //   143: astore 9
    //   145: aload_0
    //   146: getfield 36	org/tizen/common/verrari/realm/DirectorySearchableRealm:logger	Lorg/slf4j/Logger;
    //   149: ldc 105
    //   151: aload 8
    //   153: invokeinterface 107 3 0
    //   158: aload 9
    //   160: invokevirtual 110	java/io/File:listFiles	()[Ljava/io/File;
    //   163: astore 10
    //   165: aload 10
    //   167: dup
    //   168: astore 14
    //   170: arraylength
    //   171: istore 13
    //   173: iconst_0
    //   174: istore 12
    //   176: goto +333 -> 509
    //   179: aload 14
    //   181: iload 12
    //   183: aaload
    //   184: astore 11
    //   186: aload 11
    //   188: invokevirtual 114	java/io/File:isDirectory	()Z
    //   191: ifne +6 -> 197
    //   194: goto +312 -> 506
    //   197: aload_0
    //   198: getfield 36	org/tizen/common/verrari/realm/DirectorySearchableRealm:logger	Lorg/slf4j/Logger;
    //   201: ldc 118
    //   203: aload 11
    //   205: invokevirtual 120	java/io/File:getCanonicalPath	()Ljava/lang/String;
    //   208: invokeinterface 107 3 0
    //   213: aload_0
    //   214: aload 11
    //   216: invokevirtual 123	org/tizen/common/verrari/realm/DirectorySearchableRealm:getTemplate	(Ljava/io/File;)Lorg/tizen/common/verrari/Template;
    //   219: astore 15
    //   221: aload 15
    //   223: instanceof 127
    //   226: ifeq +35 -> 261
    //   229: aload 15
    //   231: checkcast 127	org/tizen/common/verrari/template/DirectoryTemplate
    //   234: aload 11
    //   236: invokevirtual 129	org/tizen/common/verrari/template/DirectoryTemplate:loadManifestRecursively	(Ljava/io/File;)V
    //   239: goto +22 -> 261
    //   242: astore 16
    //   244: aload_0
    //   245: getfield 36	org/tizen/common/verrari/realm/DirectorySearchableRealm:logger	Lorg/slf4j/Logger;
    //   248: aload 16
    //   250: invokevirtual 133	org/tizen/common/verrari/TemplateException:toString	()Ljava/lang/String;
    //   253: invokeinterface 136 2 0
    //   258: goto +248 -> 506
    //   261: aload 15
    //   263: invokeinterface 139 1 0
    //   268: astore 16
    //   270: invokestatic 145	org/tizen/common/verrari/realm/DirectorySearchableRealm:$SWITCH_TABLE$org$tizen$common$verrari$Condition$Operation	()[I
    //   273: aload 6
    //   275: invokevirtual 148	org/tizen/common/verrari/Condition$Operation:ordinal	()I
    //   278: iaload
    //   279: tableswitch	default:+227->506, 2:+21->300, 3:+121->400
    //   300: aload 16
    //   302: invokeinterface 154 1 0
    //   307: astore 18
    //   309: goto +46 -> 355
    //   312: aload 18
    //   314: invokeinterface 160 1 0
    //   319: checkcast 51	java/lang/String
    //   322: astore 17
    //   324: aload 15
    //   326: aload 17
    //   328: invokeinterface 165 2 0
    //   333: astore 19
    //   335: aload 19
    //   337: aload 7
    //   339: invokevirtual 166	java/lang/String:contains	(Ljava/lang/CharSequence;)Z
    //   342: ifeq +13 -> 355
    //   345: aload_2
    //   346: aload 15
    //   348: invokevirtual 170	java/util/HashSet:add	(Ljava/lang/Object;)Z
    //   351: pop
    //   352: goto +33 -> 385
    //   355: aload 18
    //   357: invokeinterface 173 1 0
    //   362: ifne -50 -> 312
    //   365: goto +20 -> 385
    //   368: astore 20
    //   370: iconst_1
    //   371: anewarray 176	java/lang/Object
    //   374: dup
    //   375: iconst_0
    //   376: aload 11
    //   378: aastore
    //   379: invokestatic 178	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   382: aload 20
    //   384: athrow
    //   385: iconst_1
    //   386: anewarray 176	java/lang/Object
    //   389: dup
    //   390: iconst_0
    //   391: aload 11
    //   393: aastore
    //   394: invokestatic 178	org/tizen/common/util/IOUtil:tryClose	([Ljava/lang/Object;)V
    //   397: goto +109 -> 506
    //   400: aload 16
    //   402: invokeinterface 154 1 0
    //   407: astore 18
    //   409: goto +52 -> 461
    //   412: aload 18
    //   414: invokeinterface 160 1 0
    //   419: checkcast 51	java/lang/String
    //   422: astore 17
    //   424: aload 15
    //   426: aload 17
    //   428: invokeinterface 165 2 0
    //   433: astore 19
    //   435: aload 19
    //   437: invokevirtual 184	java/lang/String:toLowerCase	()Ljava/lang/String;
    //   440: aload 7
    //   442: invokevirtual 184	java/lang/String:toLowerCase	()Ljava/lang/String;
    //   445: invokevirtual 166	java/lang/String:contains	(Ljava/lang/CharSequence;)Z
    //   448: ifeq +13 -> 461
    //   451: aload_2
    //   452: aload 15
    //   454: invokevirtual 170	java/util/HashSet:add	(Ljava/lang/Object;)Z
    //   457: pop
    //   458: goto +33 -> 491
    //   461: aload 18
    //   463: invokeinterface 173 1 0
    //   468: ifne -56 -> 4
1 2 3 4

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