Package net.sf.joafip.store.entity.kept

Examples of net.sf.joafip.store.entity.kept.SubstituteOfEnum


      throws ObjectIOException {
    final String enumClassName = originalObject.getClass().getName();
    final Enum<?> enumObject = (Enum<?>) originalObject;
    final String enumName = enumObject.name();
    // create the substitute: a key based on enum class name and enum name
    final SubstituteOfEnum substitute = new SubstituteOfEnum(enumClassName,
        enumName);
    // return the substitute of original enum
    return substitute;
  }
View Full Code Here


  @Override
  public Object originalObject(final Object substitute)
      throws ObjectIOException {
    try {
      final SubstituteOfEnum enumSubstitute = (SubstituteOfEnum) substitute;
      final String enumClassName = enumSubstitute.getEnumClassName();
      final String enumName = enumSubstitute.getEnumName();
      final Class<?> enumClass = Class.forName(enumClassName);
      return helperReflect.newEnumInstance(enumClass, enumName);
    } catch (ReflectInvalidClassException exception) {
      throw new ObjectIOException(exception);
    } catch (ClassNotFoundException exception) {
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.entity.kept.SubstituteOfEnum

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.