}
public <T extends ResourceInfo> T getResourceByName(String ns, String name, Class<T> clazz) {
NamespaceInfo namespace = null;
if ("".equals(ns)) {
ns = null;
}
if (ns == null) {
// if namespace was null, try the default namespace
if (getDefaultNamespace() != null) {
namespace = getDefaultNamespace();
}
} else {
namespace = getNamespaceByPrefix(ns);
if (namespace == null) {
namespace = getNamespaceByURI(ns);
}
}
if (namespace != null) {
ResourceInfo resource = catalogDAO.getResourceByName(namespace.getName(), name, clazz);
if (resource != null) {
resolve(resource);
// return ModificationProxy.create( (T) resource, clazz );
return createProxy((T) resource, (Class<T>) mapResourceClass(resource));
}