/** * Returns a {@link FactoryConfiguration} including all default * "GenericTools" available and no others. * @return the generic tools default {@link FactoryConfiguration} */ public static FactoryConfiguration getGenericTools() { FileFactoryConfiguration config = new XmlFactoryConfiguration("ConfigurationUtils.getGenericTools()"); config.read(GENERIC_DEFAULTS_PATH); // defaults should *always* be clean! clean(config); return config; }
/** * <p>Returns a {@link FactoryConfiguration} including all default * "VelocityView" tools available as well as the default "GenericTools".</p> * @return all default tools {@link FactoryConfiguration} * @throws ConfigurationException if a tools.xml is not found at the {@link #VIEW_DEFAULTS_PATH}. */ public static FactoryConfiguration getVelocityView() { FileFactoryConfiguration config = new XmlFactoryConfiguration("ConfigurationUtils.getVelocityView()"); config.read(GENERIC_DEFAULTS_PATH); config.read(VIEW_DEFAULTS_PATH); // defaults should *always* be clean! clean(config); return config; }
/** * Returns the "default" {@link FactoryConfiguration}. This includes * all the standard tools developed by this project and available in * the jar being used. In other words, if the velocity-tools-generic-2.x.jar * is being used, then only the generic tools will be included. If * the velocity-tools-struts-2.x.jar is being used, then all VelocityTools * will be available. This also means that subclasses in the larger jars * will override their superclasses. So, if you are using the VelocityStruts * jar, then your $link reference will be a StrutsLinkTool. If you are using * the VelocityView jar, it will be a standard LinkTool. * @return the default {@link FactoryConfiguration} */ public static FactoryConfiguration getDefaultTools() { FileFactoryConfiguration config = new XmlFactoryConfiguration("ConfigurationUtils.getDefaultTools()"); config.read(GENERIC_DEFAULTS_PATH); // view tools may not be available config.read(VIEW_DEFAULTS_PATH, false); // defaults should *always* be clean! clean(config); return config; }