Package bar :: Module base :: Class barMetadataElement
[hide private]
[frames] | no frames]

Class barMetadataElement


Basic class representing metadata objects.

Nested Classes [hide private]
Instance Methods [hide private]
 
__init__(self, name, value)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
str
_getContentString(self)
Generate string representation of content of metadata.
 
_validateValue(self, NewValue)
Validates given value.
 
_getValue(self)
Returns: content of metadata element
 
_setValue(self, NewValue)
Assign the content of the metadata element if valid.
str
_getName(self)
Returns: name of the metadata element
xml.dom.minidom.Node
getXMLelement(self)
An alias for barAtlasSlideElement.getXMLelement(self, useBarNS = True).
 
getMetadataTuple(self)
Generate tuple containing name and value of medatada object.

Inherited from barAtlasSlideElement: affineTransform

Inherited from barAtlasSlideElement (private): _getTextNodeXMLelement

Inherited from barObject: __str__, getElementById, writeXMLtoFile

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]
barMetadataElement
fromXML(cls, svgMetadataElement)
Create metadata element from XML representation of 3dBAR metadata element.
Static Methods [hide private]

Inherited from barObject (private): _getAttributesDict

Class Variables [hide private]
str _elementName = 'data'
name of the represented XML element

Inherited from barAtlasSlideElement (private): _attributes, _attributesNS

Properties [hide private]
  value
Content of the metadata element.
str name
Name of the metadata element.

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, value)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • name (str) - name of given metadata element
  • value - content of metadata
Overrides: object.__init__

fromXML(cls, svgMetadataElement)
Class Method

 

Create metadata element from XML representation of 3dBAR metadata element. Determine which type of metadata is parsed and return proper subclass for barMetadataElement.

Parameters:
  • svgMetadataElement (xml.dom.minidom.Node) - XML representation of 3dBAR metadata element
Returns: barMetadataElement
created metadata element
Overrides: barAtlasSlideElement.fromXML

_getContentString(self)

 

Generate string representation of content of metadata. Such representation may by used in XML element as is required because metadata content may be not only string but also list, dictionary, etc.

Default string represenataion is str() but, in general, it is overided by subclases.

Returns: str
string representation of metadata content

_validateValue(self, NewValue)

 

Validates given value. Should be overriden and reimplemented in every subclass.

Parameters:
  • NewValue - value to be validated

_getValue(self)

 
Returns:
content of metadata element

_setValue(self, NewValue)

 

Assign the content of the metadata element if valid.

Parameters:
  • NewValue - new content of the metadata element

_getName(self)

 
Returns: str
name of the metadata element

getXMLelement(self)

 

An alias for barAtlasSlideElement.getXMLelement(self, useBarNS = True).

Parameters:
  • useBarNS - determines, if element uses 3dBAR XML namespace
Returns: xml.dom.minidom.Node
XML representation of the object
Overrides: barObject.getXMLelement

getMetadataTuple(self)

 

Generate tuple containing name and value of medatada object.

Returns:
generated tuple @rtype (str, ?)

Property Details [hide private]

value

Content of the metadata element.

Get Method:
_getValue(self) - Returns: content of metadata element
Set Method:
_setValue(self, NewValue) - Assign the content of the metadata element if valid.

name

Name of the metadata element.

Get Method:
_getName(self) - Returns: name of the metadata element
Type:
str