Package siena.embed

Examples of siena.embed.Embedded.mode()


      } else if (type == byte[].class) {
        return Base64.encodeBytes((byte[]) val);
      }
      else if (ClassInfo.isEmbedded(field)) {
        Embedded embed = field.getAnnotation(Embedded.class);
        switch(embed.mode()){
        case SERIALIZE_JSON:
          return JsonSerializer.serialize(val).toString();
        case SERIALIZE_JAVA:
          // this embedding mode doesn't manage @EmbedIgnores
          try {
View Full Code Here


    return false;
  }
 
  public static boolean isEmbeddedNative(Field field) {
    Embedded embed = field.getAnnotation(Embedded.class);
    if(embed != null && embed.mode() == Embedded.Mode.NATIVE){
      return true;
    }
    return false;
  }
 
View Full Code Here

      }
    }
   
    Embedded embed = field.getAnnotation(Embedded.class);
    if(embed != null) {
      switch(embed.mode()){
      case SERIALIZE_JSON:
        if(String.class.isAssignableFrom(value.getClass())) {
          Json data = Json.loads((String) value);
          return JsonSerializer.deserialize(field, data);
        }
View Full Code Here

            else
              value = new Blob(Arrays.copyOf(arr, 1000000));
          }
          else if (ClassInfo.isEmbedded(field)) {
            Embedded embed = field.getAnnotation(Embedded.class);
            switch(embed.mode()){
            case SERIALIZE_JSON:
              value = JsonSerializer.serialize(value).toString();
              String s = (String) value;
              if (s.length() > 500)
                value = new Text(s);
View Full Code Here

          value = ((Blob) value).getBytes();
        }
        else {
          Embedded embed = f.getAnnotation(Embedded.class);
          if(embed != null) {
            switch(embed.mode()){
            case SERIALIZE_JSON:
              break;
            case SERIALIZE_JAVA:
              value = ((Blob) value).getBytes();
              break;
View Full Code Here

          else
            propValue = new Blob(Arrays.copyOf(arr, 1000000));
        }
        else if (ClassInfo.isEmbedded(f)) {
          Embedded embed = f.getAnnotation(Embedded.class);
          switch(embed.mode()){
          case SERIALIZE_JSON:
            propValue = JsonSerializer.serialize(propValue).toString();
            String s = (String) propValue;
            if (s.length() > 500)
              propValue = new Text(s);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.