Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers
Class Pattern

java.lang.Object
  extended by eu.esdihumboldt.hale.io.gml.writer.internal.geometry.writers.Pattern

public class Pattern
extends Object

Represents a pattern for matching an abstract path

Author:
Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Field Summary
static String GML_NAMESPACE_PLACEHOLDER
          Placeholder for the GML namespace that may be used in patterns
 
Method Summary
static Pattern and(Pattern... patterns)
          Create a pattern that combines multiple patterns with a logical AND.
 boolean isValid()
          Determines if the pattern is valid.
 DefinitionPath match(TypeDefinition type, DefinitionPath path, String gmlNs)
          Matches the type against the encoding pattern.
static Pattern or(Pattern... patterns)
          Create a pattern that combines multiple patterns with a logical OR.
static Pattern parse(String pattern)
          Parse a pattern from the given string.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GML_NAMESPACE_PLACEHOLDER

public static final String GML_NAMESPACE_PLACEHOLDER
Placeholder for the GML namespace that may be used in patterns

See Also:
Constant Field Values
Method Detail

parse

public static Pattern parse(String pattern)
Parse a pattern from the given string. Pattern elements must be separated by /. Valid elements are * (one XML element with any name), ** (any number of XML elements with any name) and an XML element name. An XML element name may also include a namespace, the namespace must be wrapped by quotes ("). If no namespace is specified the GML namespace is assumed.

Parameters:
pattern - the pattern string
Returns:
the parsed pattern

or

public static Pattern or(Pattern... patterns)
Create a pattern that combines multiple patterns with a logical OR. When matching, the path of the first pattern that matches is returned.

Parameters:
patterns - the sub-patterns
Returns:
the OR pattern

and

public static Pattern and(Pattern... patterns)
Create a pattern that combines multiple patterns with a logical AND. When matching, all patterns must match and the path of the first pattern is returned.

Parameters:
patterns - the sub-patterns
Returns:
the AND pattern

match

public DefinitionPath match(TypeDefinition type,
                            DefinitionPath path,
                            String gmlNs)
Matches the type against the encoding pattern.

Parameters:
type - the type definition
path - the definition path
gmlNs - the GML namespace
Returns:
the new path if there is a match, null otherwise

isValid

public boolean isValid()
Determines if the pattern is valid.

Returns:
if the pattern is valid

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d