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 Resource marshall(Object root) {
   if (root instanceof AliasedObject) {
     return marshall(((AliasedObject) root).getAlias(), root);
   }
   ResourceMapping resourceMapping = mapping.getRootMappingByClass(root.getClass());
   if (resourceMapping == null) {
     return null;
   }
   Resource resource = resourceFactory.createResource(resourceMapping.getAlias());
   resourceMapping.getConverter().marshall(resource, root, resourceMapping, createContext());
   return resource;
 }
 public Resource marshallIds(ResourceMapping resourceMapping, Object id) {
   Resource idResource = resourceFactory.createResource(resourceMapping.getAlias());
   marshallIds(idResource, resourceMapping, id, createContext());
   return idResource;
 }