Attributes are the most primitive elements from the complex data types.
Their role is to associate a value with a name.
Create a 'name' named attribute with 'jon' value.
$a typeof Attribute
$a.setLabel("name")
$a.setValue("jon")
print $a
name: jon
print $a.toXML
name="jon"
print $a.getName
name
print $a.getvalue
jon
This example show how to set attribute value
define AttrAssign [
static @att1="test" typeof String
static :main ($args typeof Series) [
$current typeof AttrAssign
print $current.toXML
<AttrAssign att1="test"></AttrAssign>
AttrAssign@att1 = "hello"
print $current.toXML
<AttrAssign att1="hello"></AttrAssign>
$current@att1 = "oh boy"
print $current.toXML
<AttrAssign att1="oh boy"></AttrAssign>
]
]
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getConceptsAtPath, getErrorHandler, getInheritedConcepts, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML |
|
Parameters: |
: | The label of this Attribute. |
: | The value of this Attribute. |
|
Constructs a new Attribute concept with the specified value and label.
Returns a string concept representing this Attribute's label.
Returns a string concept representing this Attribute's name.
Returns a concept representing this Attribute's value.
Returns this concept's value type.
Parameters: |
$label : | The new label to be set. |
|
Sets the label of this Attribute concept to the specified text.
Parameters: |
$value : | The value to be set. |
|
Sets the value of this Attribute concept to the specified value.
Returns a stream representing the XML rendering of this concept.