Class ::xotcl::Attribute (public)
::xotcl::MetaSlot ::xotcl::Attribute
Defined in
- Testcases:
-
No testcase defined.
Source code:
:public alias value=set ::nsf::var::set
:property {substdefault}
:property -accessor public multivalued {
:public object method value=set {object property value} {
set mClass [expr {$value ? "0..n" : "1..1"}]
$object configure -incremental $value -multiplicity $mClass
}
:public object method value=get {object property} {
return [$object eval [list :isMultivalued]]
}
}
:protected method setterRedefinedOptions {} {
if {[:info lookup method value=set] ne "::nsf::classes::xotcl::Attribute::value=set"} {
return [list slot=[::nsf::self] slotset]
}
if {[:info lookup method value=get] ne "::nsf::classes::nx::VariableSlot::value=get"} {
return [list slot=[::nsf::self]]
}
}
:protected method defineIncrementalOperations {options_single options} {
if {[:info lookup method value=set] eq "::nsf::classes::xotcl::Attribute::value=set"} {
set args [list obj var [:namedParameterSpec {} value $options]]
:public object method value=set $args {::nsf::var::set $obj $var $value}
}
if {[:isMultivalued] && [:info lookup method value=add] eq "::nsf::classes::nx::VariableSlot::value=add"} {
lappend options_single slot=[::nsf::self]
set args [list obj prop [:namedParameterSpec {} value $options_single] {pos 0}]
:public object method value=add $args {::nsf::next}
} else {
}
}
:protected method needsForwarder {} {
if {[:info lookup method value=set] ne "::nsf::classes::xotcl::Attribute::value=set"} {return 1}
if {[:info lookup method value=add] ne "::nsf::classes::nx::VariableSlot::value=add"} {return 1}
if {[:info lookup method value=get] ne "::nsf::classes::nx::VariableSlot::value=get"} {return 1}
if {[info exists :settername]} {return 1}
if {!${:incremental}} {return 0}
return 1
}
:public method createForwarder {name domain} {
::nsf::method::forward $domain -per-object=${:per-object} $name -prefix value= ${:manager} "%1 {get set}" %self ${:forwardername}
}
:public method __object_configureparameter {} {
set slotObjects [nsf::directdispatch [self] ::nsf::methods::object::info::lookupslots -type ::nx::Slot]
set parameterDefinitions [::nsf::parameter::specs -nonposargs $slotObjects]
lappend parameterDefinitions args:alias,method=residualargs,args
return $parameterDefinitions
}
:method init args {
if {[info exists :default] && ![info exists :substdefault]} {
set :substdefault 0b111
}
nsf::next ""
}
:public alias proc ::nsf::classes::xotcl::Object::proc
:public method exists {var} {::nsf::var::exists [self] $var}
:public method istype {class} [::nx::Object info method body ::nsf::classes::xotcl::Object::istype]
:public alias set -frame object ::set
:public alias residualargs ::nsf::methods::object::residualargs
:public alias instvar ::nsf::methods::object::instvar
::nsf::method::setter [self] name
::nsf::method::setter [self] domain
::nsf::method::setter [self] default
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]