Package Peach :: Package Engine :: Module dom :: Class Relation
[hide private]

Class Relation

source code



Specifies relations between data

- size-of
- (when a flag indicates something exists)
- Zero or more
- 1 or more

Instance Methods [hide private]
 
__init__(self, name, parent) source code
 
getValue(self, default=False)
For a size-of relation get the size of the referenced value.
source code
 
setValue(self, value)
For a size-of relation get the size of the referenced value.
source code
 
getOfElement(self)
Resolve of reference.
source code
 
getFromElement(self)
Resolve of reference.
source code

Inherited from Element: copy, genElementsByType, getFullDataName, getFullname, getRoot, hasChildNode, nextSibling, previousSibling, printDomMap, toXmlDom, updateFromXmlDom

Static Methods [hide private]

Inherited from Element: getUniqueName

Class Variables [hide private]

Inherited from Element: GuidRegex

Instance Variables [hide private]
  type
Type of relation (size, count, when)
  of
Reference to target
  From
Reference to target
  expressionGet
Expression to apply to relation when getting value
  expressionSet
Expression to apply to relation when setting value

Inherited from Element: elementType, hasChildren, name, node, parent, ref

Method Details [hide private]

__init__(self, name, parent)
(Constructor)

source code 
Overrides: Element.__init__

getValue(self, default=False)

source code 

For a size-of relation get the size of the referenced value. Apply expression to the value if needed.

Parameters:
  • default (Boolean) - Should we try for .defaultValue first? (defaults False)

setValue(self, value)

source code 

For a size-of relation get the size of the referenced value. Apply expression to the value if needed.

getOfElement(self)

source code 

Resolve of reference. We want todo this at runtime in case we are copied around.

getFromElement(self)

source code 

Resolve of reference. We want todo this at runtime in case we are copied around.