org.weborganic.ox.core
Class Model

java.lang.Object
  extended by org.weborganic.ox.core.Model
All Implemented Interfaces:
XMLWritable

public final class Model
extends Object
implements XMLWritable

Version:
31 October 2013
Author:
Christophe Lauret

Constructor Summary
Model(String name)
          Create a new model.
 
Method Summary
static Model getDefault()
          Returns the default model (if only one defined)
 File getFile(String path)
          Returns a file given a path relative to this model.
 Properties getProperties(String path)
          Load a properties file from the package.
 Templates getTemplates(String path)
          Returns templates from this model, falling back on the built-in templates.
static boolean isDefined(String name)
          Indicates whether the model exists.
 void load()
          Loads the model definition to know what the pipelines, steps and parameters are.
static void main(String[] args)
           
 String name()
           
 void toXML(XMLWriter xml)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model(String name)
Create a new model.

Method Detail

name

public String name()
Returns:
the name of this model

load

public void load()
          throws IOException,
                 OXException
Loads the model definition to know what the pipelines, steps and parameters are.

Throws:
IOException
OXException

getFile

public File getFile(String path)
Returns a file given a path relative to this model.

Parameters:
path - the relative path a file within the model
Returns:
The corresponding file.

getProperties

public Properties getProperties(String path)
Load a properties file from the package.

Parameters:
path - the path to the properties file.
Returns:
the properties loaded from the model or null.

getTemplates

public Templates getTemplates(String path)
                       throws IOException,
                              TransformerConfigurationException
Returns templates from this model, falling back on the built-in templates.

Parameters:
path - the path to the template
Returns:
the templates loaded from the model or null.
Throws:
IOException
TransformerConfigurationException

toXML

public void toXML(XMLWriter xml)
           throws IOException
Specified by:
toXML in interface XMLWritable
Throws:
IOException

isDefined

public static boolean isDefined(String name)
Indicates whether the model exists.

Parameters:
name -
Returns:

getDefault

public static Model getDefault()
Returns the default model (if only one defined)


main

public static void main(String[] args)
                 throws Exception
Throws:
Exception