public Resource marshallIds(String alias, Object id) { ResourceMapping resourceMapping = mapping.getRootMappingByAlias(alias); if (resourceMapping == null) { return null; } return marshallIds(resourceMapping, id); }
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); }
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; }
public Object[] unmarshallIds(String alias, Object id) { ResourceMapping resourceMapping = mapping.getRootMappingByAlias(alias); return unmarshallIds(resourceMapping, id, createContext()); }