class obix::ObixObj
sys::Obj obix::ObixObj
ObixObj models an obix:obj element.
- add
-
@Operator
This add(ObixObj kid)Add a child object. Throw ArgErr if this child is already parented or has a duplicate name. Return this.
- clear
-
This clear()Remove all children objects. Return this.
- contract
-
Contract contract := Contract.emptyThe list of contract URIs this object implemented as specified by
isattribute. - display
-
Str? displayLocalized human readable string summary of the object.
- displayName
-
Str? displayNameLocalized human readable version of the name attribute.
- each
-
Iterate each of the children objects.
- elemName
-
Str elemName := "obj"The XML element name to use for this object. If not one of the valid oBIX element names then throw ArgErr. Valid element names are:
obj, bool, int, real, str, enum, uri, abstime, reltime, date, time, list, op, feed, ref, err
- first
-
ObixObj? first()Get the first child returned by
listor null. - get
-
@Operator
ObixObj? get(Str name, Bool checked := true)Get a child by name. If not found and checked is true then throw NameErr, otherwise null.
- has
-
Return if there is child object by the specified name.
- href
-
Uri? hrefURI of this object. The root object of a document must have an absolute URI, other objects may have a URI relative to the document root. See
normalizedHrefto get this href normalized against the root object. - icon
-
Uri? iconReference to the graphical icon.
- in
-
Contract? inThe
incontract for operations and feeds. - isEmpty
-
Bool isEmpty()Return is size is zero.
- isNull
-
Bool isNullThe null flag indicates the absense of a value.
- last
-
ObixObj? last()Get the last child returned by
listor null. - list
-
ObixObj[] list()Get a readonly list of the children objects or empty list if no children. If iterating the children it is more efficient to use
each. - max
-
Obj? maxInclusive maximum for value.
- min
-
Obj? minInclusive minium for value.
- name
-
Str? nameProgramatic name of the object which defines role of this object in its parent. Throw UnsupportedErr if an attempt is made to set the name once mounted under a parent.
- normalizedHref
-
Uri? normalizedHref()Get this objects
hrefnormalized against the root object's URI. Return null no href defined. - of
-
Contract? ofThe
ofcontract for lists and feeds. - out
-
Contract? outThe
outcontract for operations. - parent
-
ObixObj? parent { private set }Parent object or null if unparented.
- precision
-
Int? precisionNumber of decimal places to use for a real value.
- range
-
Uri? rangeReference to the range definition of an enum or bool value.
- readXml
-
static ObixObj readXml(InStream in, Bool close := true)Parse an XML document into memory as a tree of ObixObj. If close is true, then the input stream is guaranteed to be closed.
- remove
-
Remove the specified child object by reference. Throw ArgErr if not my child. Return this
- root
-
ObixObj root()Get the root ancestor of this object, or return
thisif no parent. - size
-
Int size()Return number of child objects.
- status
-
Status status := Status.okStatus facet indicates quality and state.
- toStr
-
virtual override Str toStr()Return string representation.
- trap
-
virtual override Obj? trap(Str name, Obj?[]? args := null)If the name maps to a child object, then return that child's value. Otherwise route to
Obj.trap. - tz
-
TimeZone? tzTimeZone facet assocaited with abstime, date, and time objects. This field is automatically updated when
valis assigned a DateTime unless its timezone is UTC or starts with "Etc/". After decoding this field is set only if an explicit "tz" attribute was specified. - unit
-
Unit? unitUnit of measurement for int and real values. We only support units which are predefind in the oBIX unit database and specified using the URI "obix:units/". These units are mapped to the
UnitAPI. If an unknown unit URI is decoded, then it is silently ignored and this field will be null. - val
-
Obj? valObject value for value object types:
- obix:bool => sys::Bool
- obix:int => sys::Int
- obix:real => sys::Float
- obix:str => sys::Str
- obix:enum => sys::Str
- obix:uri => sys::Uri
- obix:abstime => sys::DateTime
- obix:reltime => sys::Duration
- obix:date => sys::Date
- obix:time => sys::Time
If the value is not one of the types listed above, then ArgErr is thrown. If the value is set to non-null, then the
elemNameis automatically updated. - valToStr
-
Str valToStr()Get the value encoded as a string. The string is not XML escaped. If value is null return "null".
- valType
-
Type? valType()Return this element type's Fantom value type or null if this is a non-value type such as
obj. - writable
-
Bool writableSpecifies is this object can be written, or false if readonly.
- writeXml
-
virtual Void writeXml(OutStream out, Int indent := 0)Write this ObixObj as an XML document to the specified stream. No XML prolog is specified so that this method can used to write a snippet of the overall document.