Package helma.framework.demo

# Class SimplePathElement

java.lang.Object
helma.framework.demo.SimplePathElement

All Implemented Interfaces:
  `IPathElement`

public class SimplePathElement extends Object implements IPathElement
This is an example implementation for the helma.framework.IPathElement interface. It creates any child element which is requested on the fly without ever asking.

## Constructor Summary

Constructors
Constructor
Description
`SimplePathElement()`
Constructor for the root element.
`SimplePathElement(String n, IPathElement p)`
Constructor for non-root elements.

## Method Summary

Modifier and Type
Method
Description
`IPathElement`
`getChildElement(String n)`
Returns a child element for this object, creating it on the fly.
`String`
`getElementName()`
Returns the element name to be used for this object.
`IPathElement`
`getParentElement()`
Returns this object's parent element
`String`
`getPrototype()`
Returns the name of the scripting prototype to be used for this object.
`String`
`toString()`
Returns a string representation of this element.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SimplePathElement

public SimplePathElement()
Constructor for the root element.

### SimplePathElement

public SimplePathElement(String n, IPathElement p)
Constructor for non-root elements.

## Method Details

### getChildElement

public IPathElement getChildElement(String n)
Returns a child element for this object, creating it on the fly.

Specified by:
  `getChildElement` in interface `IPathElement`

### getParentElement

public IPathElement getParentElement()
Returns this object's parent element

Specified by:
  `getParentElement` in interface `IPathElement`

### getElementName

public String getElementName()
Returns the element name to be used for this object.

Specified by:
  `getElementName` in interface `IPathElement`

### getPrototype

public String getPrototype()
Returns the name of the scripting prototype to be used for this object. This will be "root" for the root element and "hopobject for everything else.

Specified by:
  `getPrototype` in interface `IPathElement`

### toString

public String toString()
Returns a string representation of this element.

Overrides:
  `toString` in class `Object`