Java 类org.apache.velocity.runtime.resource.ResourceManager 实例源码

项目:aliada-tool    文件:AliadaResourceFactory.java   
/**
 * Returns a resource according with given data.
 * 
 * @param resourceName the resource name.
 * @param resourceType the resource kind.
 * @return The resource described by name and type.
 */
public static Resource getResource(final String resourceName, final int resourceType) {
    switch (resourceType) {
        case ResourceManager.RESOURCE_TEMPLATE:
            return new AliadaTemplate();
        case ResourceManager.RESOURCE_CONTENT:
            return new ContentResource();
        default:
            throw new IllegalArgumentException("WARNIGN: Unknown resource type: " + resourceType);
    }
}