public MetaValue buildMetaValue(String value) throws Exception { return SimpleValueSupport.wrap(value); } }
/** * Create a simple value * * @param type the type * @param value the value * @return the simple value */ public static SimpleValue createSimpleValue(SimpleMetaType type, Serializable value) { if (value == null) return null; return new SimpleValueSupport(type, value); }
/** * Create a new SimpleValueSupport. * * @param metaType the simple meta type * @param value the value * @throws IllegalArgumentException for a null simpleMetaType */ public SimpleValueSupport(SimpleMetaType<T> metaType, T value) { if (metaType == null) throw new IllegalArgumentException("Null simple meta type"); this.metaType = metaType; setValue(value); }
if(getMetaType() == SimpleMetaType.BIGINTEGER && sv.getMetaType() == SimpleMetaType.BIGINTEGER) else if(getMetaType() == SimpleMetaType.BIGDECIMAL && sv.getMetaType() == SimpleMetaType.BIGDECIMAL) else if(getMetaType() == SimpleMetaType.BOOLEAN && sv.getMetaType() == SimpleMetaType.BOOLEAN) else if(getMetaType() == SimpleMetaType.BOOLEAN_PRIMITIVE && sv.getMetaType() == SimpleMetaType.BOOLEAN_PRIMITIVE) else if(getMetaType() == SimpleMetaType.BYTE && sv.getMetaType() == SimpleMetaType.BYTE) else if(getMetaType() == SimpleMetaType.CHARACTER && sv.getMetaType() == SimpleMetaType.CHARACTER) else if(getMetaType() == SimpleMetaType.CHARACTER_PRIMITIVE && sv.getMetaType() == SimpleMetaType.CHARACTER_PRIMITIVE) else if(getMetaType() == SimpleMetaType.DATE && sv.getMetaType() == SimpleMetaType.DATE) else if(getMetaType() == SimpleMetaType.DOUBLE && sv.getMetaType() == SimpleMetaType.DOUBLE) else if(getMetaType() == SimpleMetaType.FLOAT && sv.getMetaType() == SimpleMetaType.FLOAT) else if(getMetaType() == SimpleMetaType.INTEGER && sv.getMetaType() == SimpleMetaType.INTEGER) else if(getMetaType() == SimpleMetaType.LONG && sv.getMetaType() == SimpleMetaType.LONG) else if(getMetaType() == SimpleMetaType.SHORT && sv.getMetaType() == SimpleMetaType.SHORT) else if(getMetaType() == SimpleMetaType.STRING && sv.getMetaType() == SimpleMetaType.STRING) else if(getMetaType() == SimpleMetaType.NAMEDOBJECT && sv.getMetaType() == SimpleMetaType.NAMEDOBJECT)
public static SimpleValue wrap(float value) { return wrap(value, float.class.getName()); } public static SimpleValue wrap(double value)
/** * Create a simple value * * @param <T> the simple type * @param type the type * @param value the value * @return the simple value */ public static <T extends Serializable> SimpleValue<T> createSimpleValue(SimpleMetaType<T> type, T value) { if (value == null) return null; return new SimpleValueSupport<T>(type, value); }
/** * Create a new SimpleValueSupport. * * @param metaType the simple meta type * @param value the value * @throws IllegalArgumentException for a null simpleMetaType */ public SimpleValueSupport(SimpleMetaType metaType, Serializable value) { if (metaType == null) throw new IllegalArgumentException("Null simple meta type"); this.metaType = metaType; setValue(value); }
@Override public MetaValue createMetaValue(MetaType metaType, File object) { return SimpleValueSupport.wrap(object.getAbsolutePath()); }
private static SimpleValue wrap(Serializable object, String className) { SimpleMetaType metaType = SimpleMetaType.resolve(className); return new SimpleValueSupport(metaType, object); } public static SimpleValue wrap(boolean value)
public MetaValue buildMetaValue(String value) throws Exception { Double jvalue = Double.valueOf(value); MetaValue mvalue = SimpleValueSupport.wrap(jvalue); return mvalue; }
/** * Wrap a simple object in simple value * * @param <T> the underlying type * @param object the simple object * @return the simple value */ @SuppressWarnings("unchecked") public static <T extends Serializable> SimpleValue<T> wrap(T object) { if (object == null) return null; String className = object.getClass().getName(); SimpleMetaType<T> metaType = SimpleMetaType.resolve(className); return new SimpleValueSupport<T>(metaType, object); }
public MetaValue buildMetaValue(String value) throws Exception { char primitive = value.charAt(0); MetaValue mvalue = SimpleValueSupport.wrap(primitive); return mvalue; }
return new SimpleValueSupport(metaType, converted);
public MetaValue buildMetaValue(String value) throws Exception { Short jvalue = Short.valueOf(value); MetaValue mvalue = SimpleValueSupport.wrap(jvalue); return mvalue; }
public MetaValue buildMetaValue(String value) throws Exception { Long jvalue = Long.valueOf(value); MetaValue mvalue = SimpleValueSupport.wrap(jvalue); return mvalue; }
@Override public MetaValue createMetaValue(MetaType metaType, File object) { return SimpleValueSupport.wrap(object.getAbsolutePath()); } @Override
public static SimpleValue wrap(short value) { return wrap(value, short.class.getName()); } public static SimpleValue wrap(int value)
public MetaValue buildMetaValue(String value) throws Exception { Integer jvalue = Integer.valueOf(value); MetaValue mvalue = SimpleValueSupport.wrap(jvalue); return mvalue; }
public static SimpleValue wrap(char value) { return wrap(value, char.class.getName()); } public static SimpleValue wrap(short value)
@Override public MetaValue createMetaValue(MetaType metaType, ObjectName object) { String str = object.getCanonicalName(); return SimpleValueSupport.wrap(str); }