Package au.net.causal.projo.prefs

Examples of au.net.causal.projo.prefs.UnsupportedDataTypeException


      else if (TypeToken.of(byte[].class).equals(dataType))
        return((T)valueToBytes(regValue));
      else if (LIST_OF_STRING_TYPE.equals(dataType))
        return((T)valueToStringList(regValue));
      else
        throw new UnsupportedDataTypeException(metadata.getDataType());
    }
    catch (Win32Exception e)
    {
      throw new PreferencesException(e.getMessage(), e);
    }
View Full Code Here


        Advapi32Util.registrySetStringArray(root, winRegKey, key, arrayValue);
      }
      else if (TypeToken.of(byte[].class).equals(dataType))
        Advapi32Util.registrySetBinaryValue(root, winRegKey, key, (byte[])value);
      else
        throw new UnsupportedDataTypeException(metadata.getDataType());
    }
    catch (Win32Exception e)
    {
      throw new PreferencesException(e.getMessage(), e);
    }
View Full Code Here

      else if (TypeToken.of(byte[].class).equals(dataType))
        return((T)valueToBytes(regValue));
      else if (LIST_OF_STRING_TYPE.equals(dataType))
        return((T)valueToStringList(regValue));
      else
        throw new UnsupportedDataTypeException(metadata.getDataType());
    }
    catch (Win32Exception e)
    {
      throw new PreferencesException(e.getMessage(), e);
    }
View Full Code Here

        Advapi32Util.registrySetStringArray(root, winRegKey, key, arrayValue);
      }
      else if (TypeToken.of(byte[].class).equals(dataType))
        Advapi32Util.registrySetBinaryValue(root, winRegKey, key, (byte[])value);
      else
        throw new UnsupportedDataTypeException(metadata.getDataType());
    }
    catch (Win32Exception e)
    {
      throw new PreferencesException(e.getMessage(), e);
    }
View Full Code Here

   
    @Override
    public <T> void putValue(String key, T value, PreferenceKeyMetadata<T> keyMetadata) throws UnsupportedDataTypeException, PreferencesException
    {
      if (!byte[].class.equals(keyMetadata.getDataType().getRawType()))
        throw new UnsupportedDataTypeException(keyMetadata.getDataType());
     
      byte[] bValue = (byte[])value;
      bValue = encrypt(bValue);
     
      originalChain.putValue(key, bValue, keyMetadata.withDataType(byte[].class));
View Full Code Here

      return((T)Double.valueOf(pref.getDouble(key, 0.0)));
    else if (Boolean.class.equals(rawType))
      return((T)Boolean.valueOf(pref.getBoolean(key, false)));
   
    //If we get here, some other data type was used
    throw new UnsupportedDataTypeException(dataType, dataType + " is not supported by Java preferences.");
  }
View Full Code Here

    if (key == null)
      throw new NullPointerException("key == null");
    if (metadata == null)
      throw new NullPointerException("metadata == null");
    if (!isDataTypeSupported(metadata.getDataType()))
      throw new UnsupportedDataTypeException(metadata.getDataType());
   
    String fullKey = keyPrefix + key;
    String value = properties.getProperty(fullKey);
   
    //We know T is for String since that is the only supported data type
View Full Code Here

    if (key == null)
      throw new NullPointerException("key == null");
    if (metadata == null)
      throw new NullPointerException("metadata == null");
    if (!isDataTypeSupported(metadata.getDataType()))
      throw new UnsupportedDataTypeException(metadata.getDataType());
   
    String fullKey = keyPrefix + key;

    properties.setProperty(fullKey, (String)value);
  }
View Full Code Here

    if (key == null)
      throw new NullPointerException("key == null");
    if (metadata == null)
      throw new NullPointerException("metadata == null");
    if (!isDataTypeSupported(metadata.getDataType()))
      throw new UnsupportedDataTypeException(metadata.getDataType());
   
    String fullKey = keyPrefix + key;

    properties.remove(fullKey);
  }
View Full Code Here

  @Override
  protected <T> T getValueImpl(String key, PreferenceKeyMetadata<T> metadata) throws UnsupportedDataTypeException, PreferencesException
  {
    if (!isDataTypeSupported(metadata))
      throw new UnsupportedDataTypeException(metadata.getDataType());
   
    D value = getNativeValue(key);
   
    //Cast is safe because we only support one data type
    return((T)value);
View Full Code Here

TOP

Related Classes of au.net.causal.projo.prefs.UnsupportedDataTypeException

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.