mn8 Language Reference | Index    

Attribute

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

Attributes are the most primitive elements from the complex data types. Their role is to associate a value with a name.

Usage

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>
                ]
            ]
        

Version: 0.1
Authors:Remus Pereni (http://neuro.nolimits.ro)
Inherits: Concept

Constructor List

create (String , Concept )
top

Method List

StringgetLabel
StringgetName
ConceptgetValue
StringgetValueType
setLabel (String $label)
setValue (Concept $value)
StringtoXML
top
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

Detailed Constructor Info

create (String , Concept )
Parameters:
:The label of this Attribute.
:The value of this Attribute.

Constructs a new Attribute concept with the specified value and label.

top

Detailed Method Info

getLabel
Returns: String

Returns a string concept representing this Attribute's label.

top
getName
Returns: String

Returns a string concept representing this Attribute's name.

top
getValue
Returns: Concept

Returns a concept representing this Attribute's value.

top
getValueType
Returns: String

Returns this concept's value type.

top
setLabel (String $label)
Parameters:
$label :The new label to be set.

Sets the label of this Attribute concept to the specified text.

top
setValue (Concept $value)
Parameters:
$value :The value to be set.

Sets the value of this Attribute concept to the specified value.

top
toXML
Returns: String

Returns a stream representing the XML rendering of this concept.

top