Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.io.gml.writer.internal.geometry
Class DefinitionPath

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

public class DefinitionPath
extends Object

Represents a path in a type definition hierarchy (regarding subtypes and properties)

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

Constructor Summary
DefinitionPath(DefinitionPath basePath)
          Create a definition path beginning with the given base path
DefinitionPath(List<PathElement> elements)
          Create a path with at least one element.
DefinitionPath(TypeDefinition firstType, QName elementName, boolean unique)
          Create an empty definition path
 
Method Summary
 DefinitionPath add(ChildDefinition<?> child)
          Add a child to the path
 DefinitionPath addDowncast(TypeDefinition subtype)
          Add a downcast
 DefinitionPath addGroup(GroupPropertyDefinition groupDef)
          Add a group to the path
 DefinitionPath addProperty(PropertyDefinition property)
          Add a property
 GeometryWriter<?> getGeometryWriter()
           
 PathElement getLastElement()
          Get the last path element
 QName getLastName()
          Get the last name of the path.
 TypeDefinition getLastType()
          Get the last type of the path.
 List<PathElement> getSteps()
           
 boolean isEmpty()
          Determines if the path is empty
 boolean isLastUnique()
          Get if the last element in the path is unique, which means that it cannot be repeated XXX not if last is a group
 void setGeometryWriter(GeometryWriter<?> geometryWriter)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefinitionPath

public DefinitionPath(DefinitionPath basePath)
Create a definition path beginning with the given base path

Parameters:
basePath - the base path

DefinitionPath

public DefinitionPath(TypeDefinition firstType,
                      QName elementName,
                      boolean unique)
Create an empty definition path

Parameters:
firstType - the type starting the path
elementName - the corresponding element name
unique - if the element starting the path cannot be repeated

DefinitionPath

public DefinitionPath(List<PathElement> elements)
Create a path with at least one element.

Parameters:
elements - the path elements
Method Detail

addDowncast

public DefinitionPath addDowncast(TypeDefinition subtype)
Add a downcast

Parameters:
subtype - the definition of the sub-type that is to be cast to
Returns:
this path for chaining

addGroup

public DefinitionPath addGroup(GroupPropertyDefinition groupDef)
Add a group to the path

Parameters:
groupDef - the group definition
Returns:
this path for chaining

add

public DefinitionPath add(ChildDefinition<?> child)
Add a child to the path

Parameters:
child - the child, either a group or property
Returns:
this path for chaining

addProperty

public DefinitionPath addProperty(PropertyDefinition property)
Add a property

Parameters:
property - the property definition
Returns:
this path for chaining

getGeometryWriter

public GeometryWriter<?> getGeometryWriter()
Returns:
the geometryWriter

setGeometryWriter

public void setGeometryWriter(GeometryWriter<?> geometryWriter)
Parameters:
geometryWriter - the geometryWriter to set

getSteps

public List<PathElement> getSteps()
Returns:
the steps

isEmpty

public boolean isEmpty()
Determines if the path is empty

Returns:
if the path is empty

getLastType

public TypeDefinition getLastType()
Get the last type of the path. For empty paths this will be the type specified on creation XXX not for groups

Returns:
the last type

getLastName

public QName getLastName()
Get the last name of the path. For empty paths this will be the name specified on creation XXX not if last is a group

Returns:
the last type

isLastUnique

public boolean isLastUnique()
Get if the last element in the path is unique, which means that it cannot be repeated XXX not if last is a group

Returns:
if the last element in the path is unique, which means that it cannot be repeated

toString

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

getLastElement

public PathElement getLastElement()
Get the last path element

Returns:
the last path element or null if it's empty

Humboldt Alignment Editor 2.5.0

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