コード例 #1
0
 public Resource marshallIds(String alias, Object id) {
   ResourceMapping resourceMapping = mapping.getRootMappingByAlias(alias);
   if (resourceMapping == null) {
     return null;
   }
   return marshallIds(resourceMapping, id);
 }
コード例 #2
0
 public Object unmarshall(Resource resource, MarshallingContext context) throws CompassException {
   ResourceMapping resourceMapping = mapping.getRootMappingByAlias(resource.getAlias());
   if (resourceMapping == null) {
     throw new MarshallingException(
         "No mapping is defined for alias [ " + resource.getAlias() + "]");
   }
   return resourceMapping.getConverter().unmarshall(resource, resourceMapping, context);
 }
コード例 #3
0
 public Resource marshall(String alias, Object root) {
   ResourceMapping resourceMapping = mapping.getRootMappingByAlias(alias);
   if (resourceMapping == null) {
     return null;
   }
   Resource resource = resourceFactory.createResource(alias);
   resourceMapping.getConverter().marshall(resource, root, resourceMapping, createContext());
   return resource;
 }
コード例 #4
0
 public Object[] unmarshallIds(String alias, Object id) {
   ResourceMapping resourceMapping = mapping.getRootMappingByAlias(alias);
   return unmarshallIds(resourceMapping, id, createContext());
 }