Package org.jresearch.flexess.client.mappers

Examples of org.jresearch.flexess.client.mappers.CreateObjectException


  }

  @Override
  public EObject createPObjectInstance(Object object, PObject po) throws CreateObjectException {
    if (!isApplicable(object)) {
      throw new CreateObjectException(MessageFormat.format("Can''t create instance of {0} protected object - this mapper isn't applicable.", po.getName()));
    }
    EFactory securityFactory = po.getEPackage().getEFactoryInstance();
    return securityFactory.create(po);
  }
View Full Code Here


          try {
            Object value = method.invoke(object, new Object[0]);
            poInstance.eSet(feature, value);
            LogFactory.getLog(JavaInstanceMapper.class).debug(MessageFormat.format("Set attibute {0}", name));
          } catch (Exception e) {
            throw new CreateObjectException(MessageFormat.format("Unable to set the feature {0}: {1}", name, e.getLocalizedMessage()));
          }
        }
      }
    }
    return poInstance;
View Full Code Here

        value = map.get(attrName);
      } else {
        if (attribute.getDefaultValueLiteral() != null) {
          value = attribute.getDefaultValue();
        } else {
          throw new CreateObjectException(MessageFormat.format("Can''t create instance of {0} protected object: the value of attribute {1} isn''t defined", po.getName(), attrName));
        }
      }
      try {
        poInstance.eSet(attribute, value);
      } catch (ClassCastException e) {
        throw new CreateObjectException(MessageFormat.format("Can''t create instance of {0} protected object: the value of attribute {1} has incorrect type: {2}", po.getName(), attrName, e.getLocalizedMessage()));
      }
    }
    return poInstance;
  }
View Full Code Here

TOP

Related Classes of org.jresearch.flexess.client.mappers.CreateObjectException

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.