Package com.tangosol.io.pof

Examples of com.tangosol.io.pof.PofSerializer


        return extractPojo(entry, target);
    }

    public Object extractFromBinary(PofContext ctx, Binary bin) {
        PofValue root = PofValueParser.parse(bin, ctx);
        PofSerializer codec = ctx.getPofSerializer(root.getTypeId());
        if (codec instanceof ReflectionPofSerializer) {
            Object[] holder = new Object[1];
            String reminder;
            try {
                reminder = ((ReflectionPofSerializer)codec).extract(root, path, holder);
View Full Code Here


                return path;
            }
            else {
                ComplexPofValue cv = (ComplexPofValue) cursor;
                if (cv.getTypeId() > 0) {
                    PofSerializer codec = cv.getPofContext().getPofSerializer(cursor.getTypeId());
                    if (codec instanceof ReflectionPofSerializer) {
                        return ((ReflectionPofSerializer) codec).extract(cursor, path, valueOut);
                    }
                    else {
                        valueOut[0] = cursor.getValue();
View Full Code Here

  private synchronized void initContextMap() {
     Map<Class<?>, SerializationContext> map = new HashMap<Class<?>, SerializationContext>();
     for(int i = 0; i != MAX_CONFIG_ID; ++i) {
       try {
         PofSerializer serializer = context.getPofSerializer(i);
         Class<?> cls = context.getClass(i);
         SerializationContext ctx = new SerializationContext();
         ctx.pofId = i;
         ctx.type = cls;
         ctx.serializer = serializer;
View Full Code Here

      userType = registerUserType(cls.getName());
    }
   
//    System.out.println("AUTOPOF: " + userType + "->" + cls.getName());
   
    PofSerializer serializer;
    Class<?> base = cls.getComponentType();
    if (base.isPrimitive()) {
      if (base == boolean.class) {
        serializer = new BooleanArraySerializer();
      }
View Full Code Here

      userType = registerUserType(cls.getName());
    }

    System.out.println("AUTOPOF: " + userType + "->" + cls.getName());
   
    PofSerializer serializer;
    if (PortableObject.class.isAssignableFrom(cls)) {
      serializer = new PortableObjectSerializer(userType);
    }
    else {
      try {
View Full Code Here

    }
  }

  private SerializationContext importPofSerializer(int id) {
    SerializationContext ctx;
    PofSerializer serializer = context.getPofSerializer(id);
    Class<?> cls = context.getClass(id);
    ctx = new SerializationContext();
    ctx.pofId = id;
    ctx.type = cls;
    ctx.serializer = serializer;
View Full Code Here

        Object result = internalDeserialize(in);
        return result;
    }

    protected Object internalDeserialize(PofReader in) throws IOException {
      PofSerializer format = null;
      try {
          Class<?> type = in.getPofContext().getClass(in.getUserTypeId());
      format = getClassCodec(type);
          Object result = resolve(format.deserialize(in));
          return result;
      }
      catch(IOException e) {
        throw new IOException("Deserialization failed, format " + format, e);
      }
View Full Code Here

    }

    protected void internalSerialize(PofWriter out, Object origValue) throws IOException {
        Object value = replace(origValue);
        Class<?> type = value.getClass();
        PofSerializer format = getClassCodec(type);
        format.serialize(out, value);
    }
View Full Code Here

    /**
     * Exposed to be used in AutoPofSerializer.
     */
    public PofSerializer getClassCodec(Class<?> type) throws IOException {
        PofSerializer format = formats.get(type);
        if (format == null) {
            try {
                format = createSerializer(type);
            } catch (Exception e) {
                throw new IOException("Failed to create reflection format for " + type.getName(), e);
View Full Code Here

TOP

Related Classes of com.tangosol.io.pof.PofSerializer

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.