Package com.cedarsoftware.util.io

Examples of com.cedarsoftware.util.io.JsonReader$ClassReader


        try
        {
            URL url = NCubeManager.class.getResource("/" + name);
            File arrayJsonCubes = new File(url.getFile());
            FileInputStream in = new FileInputStream(arrayJsonCubes);
            JsonReader reader = new JsonReader(in, true);
            JsonObject ncubes = (JsonObject) reader.readObject();
            Object[] cubes = ncubes.getArray();
            List<NCube> cubeList = new ArrayList<NCube>(cubes.length);

            for (Object cube : cubes)
            {
View Full Code Here


    /**
     * Still used in getNCubesFromResource
     */
    private static Object[] getJsonObjectFromResource(String name) throws IOException
    {
        JsonReader reader = null;
        try
        {
            URL url = NCubeManager.class.getResource("/" + name);
            File jsonFile = new File(url.getFile());
            InputStream in = new BufferedInputStream(new FileInputStream(jsonFile));
            reader = new JsonReader(in, true);
            return (Object[]) reader.readObject();
        }
        finally
        {
            IOUtilities.close(reader);
        }
View Full Code Here

    /**
     * Still used in getNCubesFromResource
     */
    private static Object[] getJsonObjectFromResource(String name) throws IOException
    {
        JsonReader reader = null;
        try
        {
            URL url = NCubeManager.class.getResource("/" + name);
            File jsonFile = new File(url.getFile());
            InputStream in = new BufferedInputStream(new FileInputStream(jsonFile));
            reader = new JsonReader(in, true);
            return (Object[]) reader.readObject();
        }
        finally
        {
            IOUtilities.close(reader);
        }
View Full Code Here

    /**
     * Still used in getNCubesFromResource
     */
    private static JsonObject getJsonObjectFromResource(String name) throws IOException
    {
        JsonReader reader = null;
        try
        {
            URL url = NCubeManager.class.getResource("/" + name);
            File jsonFile = new File(url.getFile());
            InputStream in = new BufferedInputStream(new FileInputStream(jsonFile));
            reader = new JsonReader(in, true);
            return (JsonObject) reader.readObject();
        }
        finally
        {
            IOUtilities.close(reader);
        }
View Full Code Here

        try
        {
            URL url = NCubeManager.class.getResource("/" + name);
            File arrayJsonCubes = new File(url.getFile());
            FileInputStream in = new FileInputStream(arrayJsonCubes);
            JsonReader reader = new JsonReader(in, true);
            JsonObject ncubes = (JsonObject) reader.readObject();
            Object[] cubes = ncubes.getArray();
            List<NCube> cubeList = new ArrayList<NCube>(cubes.length);

            for (Object cube : cubes)
            {
View Full Code Here

        try
        {
            URL url = NCubeManager.class.getResource("/" + name);
            File jsonFile = new File(url.getFile());
            FileInputStream in = new FileInputStream(jsonFile);
            JsonReader reader = new JsonReader(in, true);
            JsonObject jObj = (JsonObject) reader.readObject();
            reader.close();
            String json = JsonWriter.objectToJson(jObj);
            NCube ncube = NCube.fromSimpleJson(json);
            addCube(ncube, "file");
            return ncube;
        }
View Full Code Here

    /**
     * Still used in getNCubesFromResource
     */
    private static JsonObject getJsonObjectFromResource(String name) throws IOException
    {
        JsonReader reader = null;
        try
        {
            URL url = NCubeManager.class.getResource("/" + name);
            File jsonFile = new File(url.getFile());
            InputStream in = new BufferedInputStream(new FileInputStream(jsonFile));
            reader = new JsonReader(in, true);
            return (JsonObject) reader.readObject();
        }
        finally
        {
            IOUtilities.close(reader);
        }
View Full Code Here

    /**
     * Still used in getNCubesFromResource
     */
    private static Object[] getJsonObjectFromResource(String name) throws IOException
    {
        JsonReader reader = null;
        try
        {
            URL url = NCubeManager.class.getResource("/" + name);
            File jsonFile = new File(url.getFile());
            InputStream in = new BufferedInputStream(new FileInputStream(jsonFile));
            reader = new JsonReader(in, true);
            return (Object[]) reader.readObject();
        }
        finally
        {
            IOUtilities.close(reader);
        }
View Full Code Here

  protected void process() {
    if (targetInputStream == null) {
      throw new ProxettaException("Target missing");
    }
    // create class reader
    ClassReader classReader;
    try {
      classReader = new ClassReader(targetInputStream);
    } catch (IOException ioex) {
      throw new ProxettaException("Error reading class input stream", ioex);
    }

    // reads information
    TargetClassInfoReader targetClassInfoReader = new TargetClassInfoReader();
    classReader.accept(targetClassInfoReader, 0);

    this.destClassWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);

    // create proxy
    if (log.isDebugEnabled()) {
      log.debug("processing: " + classReader.getClassName());
    }
    WorkData wd = process(classReader, targetClassInfoReader);

    // store important data
    proxyApplied = wd.proxyApplied;
View Full Code Here

   */
  private ClassReader createAdviceClassReader(Class<? extends ProxyAdvice> advice) {
    InputStream inputStream = null;
    try {
      inputStream = ClassLoaderUtil.getClassAsStream(advice);
      return new ClassReader(inputStream);
    } catch (IOException ioex) {
      throw new ProxettaException(ioex);
    } finally {
      StreamUtil.close(inputStream);
    }
View Full Code Here

TOP

Related Classes of com.cedarsoftware.util.io.JsonReader$ClassReader

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.