Class Ruleset
- java.lang.Object
-
- com.levigo.jadice.server.nodes.worker.rules.Ruleset
-
public class Ruleset extends Object
The Ruleset represents a rule definition used by theDynamicPipelineNode
and -Worker.
-
-
Constructor Summary
Constructors Constructor Description Ruleset()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Rule
findRule(MimeType providedType, String targetType)
String
getName()
static Ruleset
load(URI location)
Load the ruleset from the given location.
-
-
-
Method Detail
-
getName
public String getName()
-
findRule
public Rule findRule(MimeType providedType, String targetType)
Return the first rule in theRuleset
matching the givenMimeType
ornull
if there are no matching rules. Matching is performed according to the following algorithm:- If there is a <target> subsection matching the given targetType, rules from this section are examined first. If a matching rule is found, it is returned.
- If there is no matching target section or no rule from a matching target section is applicable, global rules are examined. If a matching global rule is found, it is returned.
- Otherwise
null
is returned.
- Parameters:
providedType
- the MIME type of source streamtargetType
- MIME type of the desired taret format- Returns:
- the first rule in the
Ruleset
matching the given MIME type
-
load
public static Ruleset load(URI location) throws JAXBException, IOException
Load the ruleset from the given location.- Parameters:
location
- location of the ruleset- Returns:
- a ruleset from the given location
- Throws:
JAXBException
- in case of XML errorsIOException
- if an I/O error occurs
-
-