In MN8 every data type is a concept and is inherited from the basic
Concept data type or another data type which has it's roots in the
Concept data type.
DEFINE Person [
@handle TYPEOF String LABEL "nick"
first_name TYPEOF Element LABEL "First_Name"
last_name TYPEOF Element LABEL "Last_Name"
home_page TYPEOF Element
emails LABEL "email_addresses" [
email* [
@obsolete TYPEOF Logical
@address TYPEOF String
description
]
]
: validEmails [
$list TYPEOF Series
EACH $email IN /emails/email WHERE $email@obsolete == false do [
$list.add($email@address)
]
return $list
] TYPEOF Series
: init [
@handle="crow"
/first_name="Csaba"
/last_name="Szabo"
/emails/email.createNewEntry
/emails/email.lastEntry@obsolete = false
/emails/email.lastEntry@address = "crow@nolimits.ro"
/emails/email.createNewEntry
/emails/email.lastEntry@obsolete = true
/emails/email.lastEntry@address = "csaba@nolimits.ro"
/emails/email.createNewEntry
/emails/email.lastEntry@obsolete = false
/emails/email.lastEntry@address = "csabi@nolimits.ro"
]
static : main( $args typeof Series ) [
$p typeof Person
$p.init
print $p.validEmails
]
]
This represents the default constructor of the Concept data type, and
therefore every concept from MN8 has an implicit constructor which
create a new and empty instance of a concept.
Parameters: |
$nil : | To this will be compared this concept. |
|
Returns true if this concept equals with parameter or false otherwise.
Create a instance of this concept.
Parameters: |
$conceptType : | Concept type. |
|
Returns true if the signature of this concept matches the signature of
the concept type from parameter, false otherwise.
Attempts to create a concept from a XML stream.
Returns all inherited concepts by this concept.
Parameters: |
$attrName : | Attribute name. |
|
Exceptions: |
noSuchAttribute :
(Warning) | If the concept does not have such an Attribute. |
Returns the attribute value or nil if attribute with that name not
exist.
Parameters: |
$attrFieldName : | Attribute field name. |
|
Exceptions: |
noSuchField :
(Warning) | If the concept does not have such an Element or Attribute field. |
Returns the attribute field definition.
Returns a series with all attribute fields of this concept.
Returns a series containing elements of type Attribute with information
about the attributes defined in this concept.
Returns a series with this concept constructors.
Exceptions: |
noSuchElement :
(Warning) | If the concept does not have such an Element. |
Returns the element value or nil if element with that name not exist.
Parameters: |
$elemFieldName : | Element field name. |
|
Exceptions: |
noSuchField :
(Warning) | If the concept does not have such an Element or Attribute field. |
Returns the element field definition.
Returns a series with all element fields of this concept.
Returns a series containing elements of type String with the name of the
elements defined in this concept.
Returns the concept label.
Parameters: |
$methodName : | Method name (ex. Concept.getConceptMethod("getConceptLabel:")) |
|
Exceptions: |
noSuchMethod :
(Error) | If the concept does not have such an Method. |
Returns the method.
Returns a series containing elements of type Element with information
about the methods defined in this concept.
Returns a series which contains all operators of this concept.
Returns this concept type.
Parameters: |
$path : |
Navigational pattern. Represented by: / - element marker, if is the
first character also marks the root element, @ - attribute marker.
|
|
Returns a series containing zero or more concepts found inside the
actual concept. The selected concepts match the navigational pattern
specified by the parameter.
Returns the concept which error handler method is used by this concept
if it is set or nil if it is not.
Returns a series with inherited concepts.
Parameters: |
$attrName : | Attribute name. |
|
Returns true is this concept has a attribute with the name given as
parameter or false otherwise.
Returns true is this concept has a element with the name given as
parameter or false otherwise.
Parameters: |
$methodName : | Method name. |
|
Returns true is this concept has a method with the name given as
parameter or false otherwise.
Parameters: |
$path : |
Navigational pattern. Represented by: / - element marker, if is the
first character also marks the root element, @ - attribute marker.
|
|
Returns true if the path specified in parameter using standard MN8
navigational patterns can be found inside the actual concept. False
otherwise.
Returns true if this concept is marked hidden or false otherwise.
Parameters: |
$from : | Concept which attributes and elements will be loaded. |
|
Loads from the concept given as parameter to this concept, all those
attributes and elements value which name correspond with this concept
attributes or elements name.
Parameters: |
$label : | The new label to be set. |
|
Sets the label of this concept to the string specified in parameter.
Parameters: |
$errorHandler : | Concept in which the error handler methods will be searched. |
|
Sets the error handler for this concept.
Parameters: |
$isHidden : | If true the concept is hidden, otherwise it is not. |
|
Hide or unhide a concept, depending on the value of the parameter.
Parameters: |
$showEmpty : | The logical to be set. |
|
Sets the specified logical to indicate whether or not this concept
should be showEmpty. If the showEmpty is set to true then when the
concept is empty it is acting like a hidden concept.
Returns the logical indicating whether this concept is showEmpty or not.
Returns a stream representing the simple text rendering of this concept.
Returns a stream representing the XML rendering of this concept.