Package org.objectweb.joram.shared.excepts

Examples of org.objectweb.joram.shared.excepts.MessageValueException


    if (value instanceof Boolean)
      return ((Boolean) value).booleanValue();
    else if (value instanceof String)
      return Boolean.valueOf((String) value).booleanValue();
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to Boolean.");
  }
View Full Code Here


    if (value instanceof Byte )
      return ((Byte) value).byteValue();
    else if (value instanceof String)     
      return Byte.valueOf((String) value).byteValue();
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to Byte.");
  }
View Full Code Here

    if (value instanceof Byte || value instanceof Short)
      return ((Number) value).shortValue();
    else if (value instanceof String)
      return Short.valueOf((String) value).shortValue();
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to Short.");
  }
View Full Code Here

        || value instanceof Integer)
      return ((Number) value).intValue();
    else if (value instanceof String)
      return Integer.valueOf((String) value).intValue();
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to Integer.");
  }
View Full Code Here

        || value instanceof Integer || value instanceof Long)
      return ((Number) value).longValue();
    else if (value instanceof String)
      return Long.valueOf((String) value).longValue();
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to Long.");
  }
View Full Code Here

    if (value instanceof Float)
      return ((Float) value).floatValue();
    else if (value instanceof String)
      return Float.valueOf((String) value).floatValue();
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to Float.");
  }
View Full Code Here

    if (value instanceof Float || value instanceof Double)
      return ((Number) value).doubleValue();
    else if (value instanceof String)
      return Double.valueOf((String) value).doubleValue();
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to Double.");
  }
View Full Code Here

    if (value == null)
      throw new NullPointerException();
    else if (value instanceof Character)
      return ((Character) value).charValue();
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to Character.");
  }
View Full Code Here

    if (value == null)
      return (byte[]) value;
    else if (value instanceof byte[])
      return (byte[]) value;
    else
      throw new MessageValueException("Type " + value.getClass().getName()
                                      + " can't be converted to byte[].");
  }
View Full Code Here

TOP

Related Classes of org.objectweb.joram.shared.excepts.MessageValueException

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.