/[suikacvs]/messaging/manakai/lib/Message/Util/DIS.dis
Suika

Contents of /messaging/manakai/lib/Message/Util/DIS.dis

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Sat Feb 26 11:35:51 2005 UTC (20 years, 4 months ago) by wakaba
Branch: MAIN
Changes since 1.3: +530 -48 lines
lib/Message/Util/DIS.dis: More methods implemented; bin/dac.pl: New script (not work yet)

1 wakaba 1.1 Module:
2     @QName:
3     Util:DIS
4     @FullName:
5     @@lang: en
6     @@@:
7     <QUOTE::DIS> Object Model
8     @Namespace:
9     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
10    
11     @Description:
12     @@lang:en
13     @@@:
14     This module provides an object model for <QUITE::dis> document format.
15    
16     @Author:
17     @@FullName: Wakaba
18     @@Mail: w@suika.fam.cx
19     @License:
20     @@@:
21     license:Perl+MPL
22     @@Original:
23     @@@FullName:
24     manakai <CODE::lib/manakai/dis.pl>
25     @@@Year:2004
26     @@@Author:
27     @@@@FullName:Wakaba
28     @@@@Mail:w@suika.fam.cx
29     @Date:
30     @@@:
31 wakaba 1.4 $Date: 2005/02/25 07:32:35 $
32 wakaba 1.1 @@ContentType:
33     dis:Date.RCS
34    
35     @Require:
36     @@Module:
37     @@@Name: SuikaWikiConfig21
38     @@@WithFor:
39 wakaba 1.3 swcfg21:ForLatest
40     @@Module:
41     @@@Name: DIS
42     @@@WithFor:
43     DIS:ForLatest
44    
45     @DefaultFor:
46     DIS:ForLatest
47 wakaba 1.1
48     Namespace:
49     @DIS:
50     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
51     @dis:
52     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
53     @dis2pm:
54     http://suika.fam.cx/~wakaba/archive/2004/11/8/dis2pm#
55 wakaba 1.3 @DOMCore:
56     http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
57     @DOMLS:
58     http://suika.fam.cx/~wakaba/archive/2004/dom/ls#
59     @DOMMain:
60     http://suika.fam.cx/~wakaba/archive/2004/dom/main#
61     @infoset:
62     http://www.w3.org/2001/04/infoset#
63 wakaba 1.1 @lang:
64     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
65     @license:
66     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
67     @ManakaiDOM:
68     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
69 wakaba 1.3 @MDOMX:
70     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
71 wakaba 1.1 @owl:
72     http://www.w3.org/2002/07/owl#
73     @Perl:
74     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#Perl--
75     @rdf:
76     http://www.w3.org/1999/02/22-rdf-syntax-ns#
77     @rdfs:
78     http://www.w3.org/2000/01/rdf-schema#
79 wakaba 1.3 @swcfg21:
80     http://suika.fam.cx/~wakaba/archive/2005/swcfg21#
81 wakaba 1.1 @TreeCore:\
82     @Util:
83     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/
84    
85     ## -- "For" definitions
86    
87     ForDef:
88     @QName:
89     DIS:ForLatest
90     @Description:
91     @@lang:en
92     @@@:
93     For latest version of the <Module::Util:DIS> module implementation
94     @ISA:
95     ManakaiDOM:Perl
96    
97     ## -- Features
98    
99     ElementTypeBinding:
100     @Name: FeatureDef
101     @ElementType:
102     dis:ResourceDef
103     @ShadowContent:
104     @@rdf:type:
105     DOMMain:DOMFeature
106     @@AliasFor:
107     @@@@:
108     ::ManakaiDOM:all
109     @@@For:
110     !=ManakaiDOM:all
111    
112     ElementTypeBinding:
113     @Name: FeatureVerDef
114     @ElementType:
115     dis:ResourceDef
116     @ShadowContent:
117     @@rdf:type:
118     DOMMain:DOMFeature
119    
120     ElementTypeBinding:
121     @Name: featureQName
122     @ElementType:
123     dis:AppName
124     @ShadowContent:
125     @@ContentType:
126     dis:TypeQName
127    
128     FeatureDef:
129     @QName: Core
130     @FeatureVerDef:
131     @@QName: CoreFeature10
132     @@Version: 1.0
133     @@ISA: Core
134     @@FullName:
135     @@@lang:en
136     @@@@:
137     The <QUOTE::dis> object model, version 1.0
138     @@Description:
139     @@@lang:en
140     @@@@:
141     The <QUOTE::dis> object model, version 1.0.
142     @@DOMMain:requireFeature:
143     swcfg21:CoreFeature21
144    
145     ## -- SuikaWikiConfig/2.1 extended classes
146    
147     ClsDef:
148     @ClsQName: ManakaiDISImplementation
149     @ClsISA:
150 wakaba 1.3 swcfg21:ManakaiSWCFGImplementation::swcfg21:ForLatest
151 wakaba 1.1 @Description:
152     @@lang:en
153     @@@:
154     A <QUOTE::dis> implementation object.
155    
156     @Method:
157     @@Name: createDISDocument
158     @@Description:
159     @@@lang:en
160     @@@@:
161     Creates an empty <Class::ManakaiDISDocument> object.
162     @@Return:
163     @@@Type:ManakaiDISDocument
164     @@@Description:
165     @@@@lang:en
166     @@@@@:
167     The newly created <QUOTE::dis> document object.
168     @@@PerlDef:
169 wakaba 1.3 $r = $self-><M::swcfg21:SWCFGImplementation::swcfg21:ForLatest
170     .createSWCFGDocument>;
171     $r-><AS::swcfg21:SWCFGDocument::swcfg21:ForLatest
172     .defaultElementTypeNamespaceURI>
173 wakaba 1.1 (<Q::dis:>);
174    
175     @Method:
176 wakaba 1.2 @@Name: createDISParser
177     @@Description:
178     @@@lang:en
179     @@@@:
180 wakaba 1.1 Creates a <Class::ManakaiDISParser> object.
181 wakaba 1.2 @@Return:
182     @@@Type: ManakaiDISParser
183     @@@Description:
184     @@@@lang:en
185     @@@@@:
186 wakaba 1.1 A newly created <QUOTE::dis> parser.
187 wakaba 1.2 @@@PerlDef:
188 wakaba 1.3 $r = bless $self-><M::swcfg21:SWCFGImplementation::swcfg21:ForLatest
189     .createSWCFGParser>,
190 wakaba 1.1 <ClassName::ManakaiDISParser>;
191    
192     @Method:
193 wakaba 1.2 @@Name: createDISDatabase
194 wakaba 1.1 @@Description:
195     @@@lang:en
196     @@@@:
197 wakaba 1.2 Creates a new <QUOTE::dis> database.
198 wakaba 1.1 @@Return:
199 wakaba 1.2 @@@Type:ManakaiDISDatabase
200 wakaba 1.4 @@@Description:
201     @@@@lang:en
202     @@@@@:
203 wakaba 1.2 A newly created <QUOTE::dis> parser.
204 wakaba 1.4 @@@PerlDef:
205 wakaba 1.2 $r = bless {
206     forDef => {
207     <Q::ManakaiDOM:all> => {
208     uri => <Q::ManakaiDOM:all>,
209     isa => {<Q::ManakaiDOM:all> => 1},
210     revISA => {},
211     },
212     },
213     resDef => {},
214 wakaba 1.3 }, <ClassName::ManakaiDISDatabase>;
215    
216     @Method:
217     @@Name: tfurisToURI
218     @@Description:
219     @@@lang:en
220     @@@@:
221     Converts a pair of name URI reference and <QUOTE::for> URI reference
222     into a <TYPE::dis:TFQNames>-expanded URI reference.
223     @@Param:
224     @@@Name: typeURI
225     @@@Type: NameURI
226     @@@Description:
227     @@@@lang:en
228     @@@@@:
229     A URI reference to identify a resource.
230     @@@InCase:
231     @@@@Value:
232     @@@@@is-null:1
233     @@@@Description:
234     @@@@@lang:en
235     @@@@@@:
236     Equivalent to <Q::DOMMain:any> (for historical reason).
237     @@Param:
238     @@@Name: forURI
239     @@@Type: ForURI
240     @@@Description:
241     @@@@lang:en
242     @@@@@:
243     A <QUOTE::for> URI reference.
244     @@@InCase:
245     @@@@Value:
246     @@@@@is-null:1
247     @@@@Description:
248     @@@@@lang:en
249     @@@@@@:
250     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
251     @@Return:
252     @@@Type:
253     DISCore:TFURI::ManakaiDOM:all
254     @@@Description:
255     @@@@lang:en
256     @@@@@:
257     The <TYPE::dis:TFQNames>-expanded URI references.
258     @@@PerlDef:
259     $typeURI = <Q::DOMMain:any> unless defined $typeURI;
260     $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
261 wakaba 1.4 __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__;
262    
263     @ResourceDef:
264     @@QName: tfurisToURI
265     @@rdf:type:
266     dis2pm:BlockCode
267     @@enDesc:
268     Converts a pair of name URI reference and <QUOTE::for> URI reference
269     into a <TYPE::dis:TFQNames>-expanded URI reference.
270     @@PerlDef:
271     if ($furi eq <Q::ManakaiDOM:all>) {
272     $uri = $turi;
273 wakaba 1.3 } else {
274     ## NOTE: [RFC 3986]
275     ## fragment := *(pchar / "/" / "?")
276     ## pchar := unreserved / pct-encoded / sub-delims / [:@]
277     ## unreserved := ALPHA / DIGIT / [._~-]
278     ## sub-delims := [!$&'()*+,;=]
279     ## NOTE: [XPointer Framework]
280     ## SchemeData := *EscapedData
281     ## EscapedData := NormalChar / "^(" / "^)" / "^^"
282     ## / "(" SchemeData ")"
283     ## NormalChar := UnicodeChar - [()^]
284 wakaba 1.4 for my $__uri ($turi, $furi) {
285     $__uri =~ s{([^0-9A-Za-z:;?=_./-])}{sprintf '%%%02X', ord $1}ge;
286 wakaba 1.3 }
287 wakaba 1.4 $uri = qq<data:,200411tf#xmlns(t=data:,200411tf%23)>.
288     qq<t:tf($turi,$furi)>;
289 wakaba 1.3 }
290 wakaba 1.2
291 wakaba 1.1 ##DISImplementation
292    
293     ClsDef:
294     @ClsQName: ManakaiDISParser
295     @ClsISA:
296 wakaba 1.3 swcfg21:ManakaiSWCFGParser::swcfg21:ForLatest
297 wakaba 1.1 @Description:
298     @@lang:en
299     @@@:
300     A SuikaWikiConfig/2.1 parser that returns <QUOTE::dis> object.
301     @Method:
302 wakaba 1.3 @@Name: parse
303     @@Description:
304     @@@lang:en
305     @@@@:
306 wakaba 1.1 Parses a <QUOTE::dis> document and returns it as an object tree.
307 wakaba 1.3 @@Param:
308     @@@Name: input
309     @@@Type:
310     DOMLS:LSInput::ManakaiDOM:ManakaiDOM3
311     @@@Description:
312     @@@@lang:en
313     @@@@@:
314 wakaba 1.1 The input source.
315 wakaba 1.3 @@Return:
316     @@@Type: ManakaiDISDocument
317     @@@Description:
318     @@@@lang:en
319     @@@@@:
320 wakaba 1.1 The <QUOTE::dis> document object created from the <P::input>.
321     @@@RaiseException:
322     @@@@@:
323     swcfg21:SWCFG_PARSE_ERR
324     @@@@Description:
325     @@@@@lang:en
326     @@@@@@:
327     The <IF::swcfg21:SWCFGParser> was unable to load the SuikaWikiConfig
328     document.
329     @@@PerlDef:
330     __DEEP{
331 wakaba 1.3 $r = $self-><M::swcfg21:ManakaiSWCFGParser
332     ::swcfg21:ForLatest.parse> ($input);
333 wakaba 1.1 }__;
334     if (defined $r) {
335     $r = bless $r, <ClassName::ManakaiDISDocument>;
336 wakaba 1.4 $r-><AS::swcfg21:SWCFGDocument::swcfg21:ForLatest
337     .defaultElementTypeNamespaceURI>
338     (<Q::dis:>);
339 wakaba 1.1 }
340     ##DISParser
341    
342     ClsDef:
343     @ClsQName: ManakaiDISNode
344     @ClsISA:
345 wakaba 1.3 swcfg21:ManakaiSWCFGNode::swcfg21:ForLatest
346 wakaba 1.1 @Description:
347     @@lang:en
348     @@@:
349     <QUOTE::dis> node objects.
350    
351     @MethodRedef:
352     @@Name:lookupNamespacePrefix
353     @@Description:
354     @@@lang:en
355     @@@@:
356     Looks up the namespace prefix associated to the given
357     namespace URI. The default namespaces are ignored.
358     @@Param:
359     @@@Name:namespaceURI
360 wakaba 1.3 @@@Type: AnyURI
361 wakaba 1.1 @@@Description:
362     @@@@lang:en
363     @@@@@:
364     The namespace URI to look for.
365     @@@InCase:
366     @@@@Value:
367     @@@@@is-null:1
368     @@@@Description:
369     @@@@@lang:en
370     @@@@@@:
371     The <DOM::null> namespace.
372     @@NamedParam:
373     @@@Name: makeNewBinding
374     @@@Type:
375     DOMMain:boolean
376     @@@Description:
377     @@@@lang:en
378     @@@@@:
379     Whether a new namespace prefix should be bound when
380     no namespace URI has been associated yet.
381     @@@InCase:
382     @@@@Value:true
383     @@@@Description:
384     @@@@@lang:en
385     @@@@@@:
386     New binding is made if no prefix associated.
387     @@@InCase:
388     @@@@Value:false
389     @@@@Description:
390     @@@@@lang:en
391     @@@@@@:
392     Simply returns the <DOM::null> if no prefix associated.
393     @@Return:
394     @@@Type:
395 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
396 wakaba 1.1 @@@Description:
397     @@@@lang:en
398     @@@@@:
399     An associated namespace prefix. If more than one prefix
400     are associated to the namespace URI, the returned prefix
401     is implementation dependent.
402     @@@InCase:
403     @@@@Value:
404     @@@@@is-null:1
405     @@@@Description:
406     @@@@@lang:en
407     @@@@@@:
408     No associated namespace prefix found.
409     @@@PerlDef:
410     $r = null;
411 wakaba 1.3 my $od = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
412     .ownerDocument> || $self;
413 wakaba 1.1 my $binds = $od->{<Q::TreeCore:node>}->{<Q::nsBinding>};
414     if (defined $namespaceURI) {
415     FIND: {
416     for my $prefix (keys %$binds) {
417     if (defined $binds->{$prefix} and
418     $binds->{$prefix} eq $namespaceURI) {
419     $r = $prefix;
420     last FIND;
421     }
422     }
423     last FIND unless $makeNewBinding;
424     ## Not found
425     if ($namespaceURI =~ /(\w+)$/) {
426     my $prefix = $1;
427     unless (exists $binds->{$prefix}) {
428     $binds->{$prefix} = $namespaceURI;
429     $r = $prefix;
430     last FIND;
431     }
432     }
433     my $i = 1;
434     {
435     unless (exists $binds->{'ns'.$i}) {
436     $binds->{$r = 'ns'.$i} = $namespaceURI;
437     last FIND;
438     }
439     $i++;
440     redo;
441     }
442     } # FIND
443     } else { ## Null namespace
444     FIND: {
445     if (exists $binds->{'nu'.'ll'} and not defined $binds->{'nu'.'ll'}) {
446     $r = 'nu'.'ll';
447     last FIND;
448     }
449     for my $prefix (keys %$binds) {
450     if (not defined $prefix) {
451     $r = $prefix;
452     last FIND;
453     }
454     }
455     last FIND unless $makeNewBinding;
456     ## Not found
457     my $i = '';
458     {
459     unless (exists $binds->{'nu'.'ll'.$i}) {
460     $binds->{$r = 'nu'.'ll'.$i} = null;
461     last FIND;
462     }
463     $i++;
464     redo;
465     }
466     }
467     }
468     ## TODO: Module ns support
469    
470     @MethodRedef:
471     @@Name:lookupNamespaceURI
472     @@Description:
473     @@@lang:en
474     @@@@:
475     Looks up the namespace URI associated to the given prefix.
476     @@Param:
477     @@@Name:prefix
478     @@@Type:
479 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
480 wakaba 1.1 @@@Description:
481     @@@@lang:en
482     @@@@@:
483     The namespace URI to look for.
484     @@NamedParam:
485     @@@Name: makeNewBinding
486     @@@Type:
487     DOMMain:boolean
488     @@@Description:
489     @@@@lang:en
490     @@@@@:
491     Whether a new binding should be created if no namespace URI
492     is associated with the <P::prefix> or not.
493     @@@InCase:
494     @@@@Value:true
495     @@@@Description:
496     @@@@@lang:en
497     @@@@@@:
498     A new binding to the temporary namespace URI
499     exactly same as <P::prefix> is created
500     if no binding found.
501     @@@InCase:
502     @@@@Value:false
503     @@@@Description:
504     @@@@@lang:en
505     @@@@@@:
506     No new binding is created if no binding found. Note that
507     even if no association newly created, this method
508     returns the <DOM::null> value.
509     @@Return:
510 wakaba 1.3 @@@Type: AnyURI
511 wakaba 1.1 @@@Description:
512     @@@@lang:en
513     @@@@@:The associated namespace URI.
514     @@@InCase:
515     @@@@Value:
516     @@@@@is-null:1
517     @@@@Description:
518     @@@@@lang:en
519     @@@@@@:
520 wakaba 1.3 No namespace URI is associated to the prefix or
521 wakaba 1.1 the <DOM::null> namespace is associated.
522     @@@PerlDef:
523 wakaba 1.3 my $od = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
524     .ownerDocument> || $self;
525 wakaba 1.1 my $binds = $od->{<Q::TreeCore:node>}->{<Q::nsBinding>};
526     if (exists $binds->{$prefix}) {
527     $r = $binds->{$prefix};
528     } elsif ($makeNewBinding) {
529     $r = $binds->{$prefix} = $prefix;
530     } else {
531     $r = null;
532     }
533     ## TODO: Module ns support
534    
535     @IntMethod:
536     @@Name:getNodeReference
537     @@Description:
538     @@@lang:en
539     @@@@:
540     Returns a new reference to the node object.
541     @@ManakaiDOM:isStatic:1
542     @@Param:
543     @@@Name:object
544     @@@Type:
545     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
546     @@@Description:
547     @@@@lang:en
548     @@@@@:
549     The node object to be referred.
550     @@Return:
551     @@@Type: ManakaiDISNode
552     @@@Description:
553     @@@@lang:en
554     @@@@@:
555     A newly created reference.
556     @@@PerlDef:
557     my $class;
558     if ($object->{<Q::nodeType>} eq '#element') {
559     $class = <ClassName::ManakaiDISElement>;
560     } elsif ($object->{<Q::nodeType>} eq '#comment') {
561     $class = <ClassName::ManakaiDISComment>;
562     } elsif ($object->{<Q::nodeType>} eq '#document') {
563     $class = <ClassName::ManakaiDISDocument>;
564     } elsif ($object->{<Q::nodeType>} eq '#fragment') {
565     $class = <ClassName::ManakaiDISDocumentFragment>;
566     } else {
567     __ASSERT{DISPerl:invariant::
568     msg => {qq[Node type: "$object->{<Q::nodeType>}" ].
569     qq[(ref: "@{[ref $object]}")]},
570     }__;
571     }
572     $r = $object-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
573     .newReference> ($class);
574    
575 wakaba 1.2 @Attr:
576     @@Name:ownerDISDocument
577     @@Description:
578     @@@lang:en
579     @@@@:
580     The <QUOTE::dis> document object associated with this node.
581     @@Get:
582 wakaba 1.3 @@@Type:ManakaiDISDocument
583 wakaba 1.2 @@@Description:
584     @@@@lang:en
585     @@@@@:
586     The document object associated with this node.
587     @@@InCase:
588     @@@@Value:
589     @@@@@is-null:1
590     @@@@Description:
591     @@@@@lang:en
592     @@@@@@:
593     This node is a document node.
594     @@@PerlDef:
595     $r = <ClassM::ManakaiDISNode.getNodeReference>
596     ($self->{<Q::TreeCore:node>}->{<Q::DOMCore:ownerDocument>})
597     if $self->{<Q::TreeCore:node>}->{<Q::DOMCore:ownerDocument>};
598 wakaba 1.1 ##DISNode
599    
600     ClsDef:
601     @ClsQName: ManakaiDISElement
602     @ClsISA:
603 wakaba 1.3 swcfg21:ManakaiSWCFGElement::swcfg21:ForLatest
604 wakaba 1.1 @ClsISA: ManakaiDISNode
605     @Description:
606     @@lang:en
607     @@@:
608     <QUOTE::dis> element node objects.
609    
610     @Method:
611     @@Name: forMatch
612     @@Description:
613     @@@lang:en
614     @@@@:
615     Tests whether this element is for a <QUOTE::for> or not.
616     @@Param:
617     @@@Name: forArg
618     @@@Type: ForURI
619     @@@Description:
620     @@@@lang:en
621     @@@@@:
622     The <QUOTE::For> URI reference to test against.
623     @@Param:
624     @@@Name: forpArg
625     @@@Type: ForURIList
626     @@@Description:
627     @@@@lang:en
628     @@@@@:
629     The <QUOTE::For+> URI references to test against.
630     @@@InCase:
631     @@@@Value:
632     @@@@@is-null:1
633     @@@@Description:
634     @@@@@lang:en
635     @@@@@@:
636     No additional <QUOTE::For> URI reference.
637 wakaba 1.3 Equivalent to an empty array reference.
638 wakaba 1.1 @@Return:
639     @@@Type:
640     DOMMain:boolean
641     @@@Description:
642     @@@@lang:en
643     @@@@@:
644     Whether this element is for <P::forArg> and <P::forpArg> or not.
645 wakaba 1.2 @@@UndeclaredPrefixException:
646     @@@NoDBException:
647     @@@PerlDef:
648 wakaba 1.3 $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
649     $forpArg ||= [];
650 wakaba 1.2
651     FORMATCH: {
652     __DEEP{
653 wakaba 1.4 my @ce = @{$self-><M::ManakaiDISElement.disChildElements>};
654 wakaba 1.2 for my $ce (@ce) {
655 wakaba 1.3 my $et = $ce-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
656     .expandedURI>;
657 wakaba 1.2 if ($et eq <Q::dis:ForCheck>) {
658 wakaba 1.3 my $for = [split /\s+/, $ce-><AG::swcfg21:SWCFGNode
659     ::swcfg21:ForLatest.value>];
660 wakaba 1.2 FCs: for my $f (@$for) {
661     if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
662     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
663     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
664     -><AG::ManakaiDISDocument.disDatabase>
665     -><M::ManakaiDISDatabase.getFor> ($uri);
666     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
667 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
668 wakaba 1.2 if ($uri eq $arg_uri) {
669     $r = false;
670     last FORMATCH;
671     }
672     }
673     } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
674     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
675     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
676     -><AG::ManakaiDISDocument.disDatabase>
677     -><M::ManakaiDISDatabase.getFor> ($uri);
678     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
679 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
680 wakaba 1.2 if ($f-><M::ManakaiDISForDefinition.isaURI> ($arg_uri)) {
681     $r = false;
682     last FORMATCH;
683     }
684     }
685     } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
686     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
687     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
688     -><AG::ManakaiDISDocument.disDatabase>
689     -><M::ManakaiDISDatabase.getFor> ($uri);
690     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
691 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
692 wakaba 1.2 if ($arg_uri eq $uri) {
693     next FCs;
694     }
695     }
696     $r = false;
697     last FORMATCH;
698     } else { ## -- ISA
699     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
700     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
701     -><AG::ManakaiDISDocument.disDatabase>
702     -><M::ManakaiDISDatabase.getFor> ($uri);
703     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
704 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
705 wakaba 1.2 if ($f-><M::ManakaiDISForDefinition.isaURI> ($arg_uri)) {
706     next FCs;
707     }
708     }
709     $r = false;
710     last FORMATCH;
711     }
712     } # FCs
713     } # dis:ForCheck
714     } # children
715    
716     my $has_for = false;
717     for my $ce (@ce) {
718 wakaba 1.3 if ($self-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
719     .expandedURI> eq
720 wakaba 1.2 <Q::dis:For>) {
721 wakaba 1.3 my $for = [split /\s+/, $ce-><AG::swcfg21:SWCFGNode
722     ::swcfg21:ForLatest.value>];
723 wakaba 1.2 my $ok = true;
724     $has_for = true;
725     AFOR: for my $f (@$for) {
726     if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
727     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
728     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
729     -><AG::ManakaiDISDocument.disDatabase>
730     -><M::ManakaiDISDatabase.getFor> ($uri);
731     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
732 wakaba 1.3 if ($uri eq $forArg) {
733 wakaba 1.2 $ok = false;
734     last AFOR;
735     }
736     } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
737     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
738     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
739     -><AG::ManakaiDISDocument.disDatabase>
740     -><M::ManakaiDISDatabase.getFor> ($uri);
741     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
742 wakaba 1.3 if ($f-><M::ManakaiDISForDefinition.isaURI> ($forArg)) {
743 wakaba 1.2 $ok = false;
744     last AFOR;
745     }
746     } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
747     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
748     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
749     -><AG::ManakaiDISDocument.disDatabase>
750     -><M::ManakaiDISDatabase.getFor> ($uri);
751     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
752 wakaba 1.3 unless ($uri eq $forArg) {
753 wakaba 1.2 $ok = false;
754     last AFOR;
755     }
756     } else { ## -- ISA
757     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
758     my $f = $self-><AG::ManakaiDISNode.ownerDISDocument>
759     -><AG::ManakaiDISDocument.disDatabase>
760     -><M::ManakaiDISDatabase.getFor> ($uri);
761     $f-><AG::ManakaiDISForDefinition.isReferred> ($ce);
762 wakaba 1.3 unless ($f-><M::ManakaiDISForDefinition.isaURI> ($forArg)) {
763 wakaba 1.2 $ok = false;
764     last AFOR;
765     }
766     }
767     } # AFOR
768 wakaba 1.3 if ($ok) {
769     $r = true;
770     last FORMATCH;
771     }
772 wakaba 1.2 } # dis:For
773     } # $ce
774     $r = $has_for ? false : true;
775     }__;
776     } # FORMATCH
777 wakaba 1.1
778     @Method:
779     @@Name: mediaTypeMatch
780     @@Description:
781     @@@lang:en
782     @@@@:
783     Tests whether the content media type of this element matches to
784     a type or not.
785     @@Param:
786     @@@Name: mediaType
787     @@@Type: MediaTypeURI
788     @@@Description:
789     @@@@lang:en
790     @@@@@:
791     A media type URI reference to test against.
792     @@Param:
793 wakaba 1.3 @@@Name: defaultMediaType
794 wakaba 1.1 @@@Type: MediaTypeURI
795     @@@Description:
796     @@@@lang:en
797     @@@@@:
798     The default media type for this element.
799     @@@InCase:
800     @@@@Value:
801     @@@@@is-null:1
802     @@@@Description:
803     @@@@@lang:en
804     @@@@@@:
805     No default type provided. All <P::mediaType> will match.
806     @@Return:
807     @@@Type:
808     DOMMain:boolean
809     @@@Description:
810     @@@@lang:en
811     @@@@@:
812     Whether this element is of <P::mediaType> or not.
813 wakaba 1.2 @@@PerlDef:
814     if (defined $mediaType) {
815     __DEEP{
816     my $ctn = $self-><M::ManakaiDISElement.disGetAttribute>
817     (<Q::dis:ContentType>);
818     my $ct;
819     $ct = $ctn-><AG::ManakaiDISElement.qnameValueURI> if $ctn;
820     $ct = $defaultMediaType unless defined $ct;
821     my $res = $self-><AG::ManakaiDISNode.ownerDISDocument>
822     -><AG::ManakaiDISDocument.disDatabase>
823     -><M::ManakaiDISDatabase.getResource> ($ct);
824     $res-><AS::ManakaiDISResourceDefinition.isReferred> ($ctn or $self);
825     unless ($res-><M::ManakaiDISResourceDefinition.subsetOfURI> ($ct)) {
826     $r = false;
827     } else {
828     $r = true;
829     }
830     }__;
831     } else {
832     $r = true;
833     }
834 wakaba 1.1
835     @Method:
836     @@Name: prefixToURI
837     @@Description:
838     @@@lang:en
839     @@@@:
840     Converts a namespace prefix into associated URI reference.
841     @@Param:
842     @@@Name: prefix
843     @@@Type:
844 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
845 wakaba 1.1 @@@Description:
846     @@@@lang:en
847     @@@@@:
848     A namespace prefix to look for.
849     @@@InCase:
850     @@@@Value:
851     @@@@@is-null:1
852     @@@@Description:
853     @@@@@lang:en
854     @@@@@@:
855     Returns the default namespace URI.
856     @@NodeParam:
857     @@Return:
858 wakaba 1.3 @@@Type: AnyURI
859 wakaba 1.1 @@@Description:
860     @@@@lang:en
861     @@@@@: The URI references associated.
862     @@@UndeclaredPrefixException:
863     @@@PerlDef:
864 wakaba 1.3 if (defined $prefix) {
865 wakaba 1.1 __DEEP{
866 wakaba 1.3 $r = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
867     .lookupNamespaceURI> ($prefix);
868 wakaba 1.1 }__;
869     unless (defined $r) {
870     __EXCEPTION{UNDECLARED_NS_PREFIX_ERR::
871     infoset:prefix => {$prefix},
872     MDOMX:param-name => 'prefix',
873     DIS:sourceNode => {$node},
874     }__;
875     }
876     } else {
877     ## TODO: default namespace
878     }
879    
880     @Method:
881     @@QName: qnameToURI
882     @@Description:
883     @@@lang:en
884     @@@@:
885     Converts a qualified name (<TYPE::dis:TypeQName>) to
886     an expanded URI reference.
887     @@Param:
888     @@@Name: qname
889     @@@Type:
890     dis:TypeQName
891     @@@Description:
892     @@@@lang:en
893     @@@@@:
894     A qualified name.
895     @@NodeParam:
896     @@Return:
897     @@@Type: AnyURI
898     @@@Description:
899     @@@@lang:en
900     @@@@@:
901     The expanded URI reference.
902     @@@UndeclaredPrefixException:
903     @@@PerlDef:
904     $qname =~ s/^\s+//; $qname =~ s/\s+$//;
905     my ($prefix, $lname) = split /:/, $qname;
906     __DEEP{
907     if (defined $lname) {
908     $r = $self-><M::ManakaiDISElement.prefixToURI> ($prefix) . $lname;
909     } else { ## In default namespace
910     $r = $self-><M::ManakaiDISElement.prefixToURI> (null) . $prefix;
911     }
912 wakaba 1.4 }__;
913 wakaba 1.1
914     @Method:
915     @@QName: qnameToPair
916     @@Description:
917     @@@lang:en
918     @@@@:
919     Converts a qualified name (<TYPE::dis:TypeQName>) to
920     a pair of namespace URI and local name.
921     @@Param:
922     @@@Name: qname
923     @@@Type:
924     dis:TypeQName
925     @@@Description:
926     @@@@lang:en
927     @@@@@:
928     A qualified name.
929     @@NodeParam:
930     @@Return:
931     @@@Type:
932     Perl:ARRAY
933     @@@Description:
934     @@@@lang:en
935     @@@@@:
936     A list of namespace URI and local name.
937     @@@UndeclaredPrefixException:
938     @@@PerlDef:
939     $qname =~ s/^\s+//; $qname =~ s/\s+$//;
940     my ($prefix, $lname) = split /:/, $qname;
941     __DEEP{
942     if (defined $lname) {
943     $r = [$self-><M::ManakaiDISElement.prefixToURI> ($prefix), $lname];
944     } else { ## In default namespace
945     $r = [$self-><M::ManakaiDISElement.prefixToURI> (null), $prefix];
946     }
947 wakaba 1.4 }__;
948 wakaba 1.1
949     @Method:
950 wakaba 1.3 @@Name: tfqnamesToURI
951 wakaba 1.1 @@Description:
952     @@@lang:en
953     @@@@:
954 wakaba 1.3 Converts a <TYPE::dis:TFQNames>
955 wakaba 1.1 into an expanded URI reference.
956     @@Param:
957     @@@Name: tfqnames
958     @@@Type:
959 wakaba 1.3 dis:TFQNames
960 wakaba 1.1 @@@Description:
961     @@@@lang:en
962     @@@@@:
963 wakaba 1.3 A <TYPE::dis:TFQNames> to identify a resource.
964 wakaba 1.1 @@Param:
965     @@@Name: defaultTypeURI
966     @@@Type: NameURI
967     @@@Description:
968     @@@@lang:en
969     @@@@@:
970     A name URI reference used if it is missing from
971     <P::tfqnames>.
972     @@@InCase:
973     @@@@Value:
974     @@@@@is-null:1
975     @@@@Description:
976     @@@@@lang:en
977     @@@@@@:
978     Equivalent to <Q::DOMMain:any>.
979     @@Param:
980     @@@Name: defaultForURI
981     @@@Type: ForURI
982     @@@Description:
983     @@@@lang:en
984     @@@@@:
985     A <QUOTE::for> URI reference used if it is missing from
986     <P::tfqnames>.
987     @@@InCase:
988     @@@@Value:
989     @@@@@is-null:1
990     @@@@Description:
991     @@@@@lang:en
992     @@@@@@:
993     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
994     @@NodeParam:
995     @@Return:
996     @@@Type:
997 wakaba 1.3 DISCore:TFURI::ManakaiDOM:all
998 wakaba 1.1 @@@Description:
999     @@@@lang:en
1000     @@@@@:
1001 wakaba 1.3 The <TYPE::dis:TFQNames>-expanded URI references.
1002 wakaba 1.1 @@@UndeclaredPrefixException:
1003     @@@PerlDef:
1004     my ($typeq, $forq) = split /\s*::\s*/, $tfqnames, 2;
1005     my ($typeURI, $forURI);
1006     if (defined $forq) {
1007     __DEEP{
1008     $typeURI = $typeq eq ''
1009     ? defined $defaultTypeURI ? $defaultTypeURI
1010     : <Q::DOMMain:any>
1011     : $self-><M::ManakaiDISElement.qnameToURI> ($typeq, %opt);
1012     }__;
1013     if (length $forq) {
1014     $forURI = $self-><M::ManakaiDISElement.qnameToURI> ($forq, %opt);
1015     } else {
1016     $forURI = <Q::ManakaiDOM:all>;
1017     }
1018     } else { ## "For" omitted
1019     __DEEP{
1020     $typeURI = $typeq eq ''
1021     ? defined $defaultTypeURI ? $defaultTypeURI
1022     : <Q::DOMMain:any>
1023     : $self-><M::ManakaiDISElement.qnameToURI> ($typeq, %opt);
1024     }__;
1025 wakaba 1.3 $forURI = defined $defaultForURI ? $defaultForURI
1026     : <Q::ManakaiDOM:all>;
1027 wakaba 1.1 }
1028 wakaba 1.4 __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__;
1029 wakaba 1.2
1030     @Method:
1031     @@Name: disGetAttribute
1032     @@enDesc:
1033     Gets an attribute node.
1034     @@Param:
1035     @@@Name: attrName
1036     @@@Type: AnyURI
1037     @@@enDesc:
1038     The name expanded URI of the node to retrieve.
1039     @@ForParam:
1040     @@ForpParam:
1041     @@MediaTypeParam:
1042     @@MediaTypeDefaultParam:
1043     @@Return:
1044     @@@Type: ManakaiDISElement
1045     @@@enDesc:
1046     The attribute (property) element node.
1047     @@@nullCase:
1048     @@@@enDesc:
1049     No attribute node found.
1050     @@@PerlDef:
1051 wakaba 1.4 for my $c (@{$self->{src}-><M::ManakaiDISElement.disChildElements>}) {
1052 wakaba 1.3 if ($c-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1053     .expandedURI> eq $attrName and
1054 wakaba 1.2 $c-><AG::ManakaiDISElement.forMatch> ($forArg, $forpArg) and
1055     $c-><AG::ManakaiDISElement.mediaTypeMatch>
1056 wakaba 1.3 ($mediaType, $defaultMediaType)) {
1057 wakaba 1.2 $r = $c;
1058     last;
1059     }
1060     }
1061    
1062     @Method:
1063     @@Name: disGetAttributeList
1064     @@enDesc:
1065     Gets attribute nodes.
1066 wakaba 1.3 @@Param:
1067     @@@Name: attrName
1068     @@@Type: AnyURI
1069     @@@enDesc:
1070     The name expanded URI of the node to retrieve.
1071 wakaba 1.2 @@ForParam:
1072     @@ForpParam:
1073     @@MediaTypeParam:
1074     @@MediaTypeDefaultParam:
1075     @@Return:
1076     @@@Type: ManakaiDISElementList
1077     @@@enDesc:
1078     The attribute (property) element nodes.
1079     @@@PerlDef:
1080     $r = bless [], <ClassName::ManakaiDISElementList>;
1081 wakaba 1.4 for my $c (@{$self->{src}-><M::ManakaiDISElement.disChildElements>}) {
1082 wakaba 1.3 if ($c-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1083     .expandedURI> eq $attrName and
1084 wakaba 1.2 $c-><AG::ManakaiDISElement.forMatch> ($forArg, $forpArg) and
1085     $c-><AG::ManakaiDISElement.mediaTypeMatch>
1086 wakaba 1.3 ($mediaType, $defaultMediaType)) {
1087 wakaba 1.2 push @$r, $c;
1088     }
1089     }
1090    
1091 wakaba 1.4 @Method:
1092 wakaba 1.2 @@Name: disChildElements
1093     @@enDesc:
1094     A list of child elements.
1095 wakaba 1.4 @@ForParam:
1096     @@ForpParam:
1097     @@Return:
1098     @@@Type: ManakaiDISElementList
1099 wakaba 1.2 @@@enDesc:
1100     The current snapshot of child nodes.
1101     @@@PerlDef:
1102 wakaba 1.4 $r = bless [], <ClassName::ManakaiDISElementList>;
1103     __DEEP{
1104     for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1105     .childNodes>}) {
1106     ## $cn is an #element.
1107     my $dn = $cn->{<Q::TreeCore:node>}
1108     -><M::ManakaiDOM:ManakaiDOMNodeObject
1109     ::ManakaiDOM:Perl.newReference>
1110     (<ClassName::ManakaiDISElement>);
1111     next unless $dn-><M::ManakaiDISElement.forMatch> ($forArg, $forpArg);
1112     push @$r, $dn;
1113     }
1114     }__;
1115 wakaba 1.2 @Attr:
1116     @@Name: qnameValueURI
1117     @@enDesc:
1118     The element value (written as <TYPE::dis:TypeQName>), as URI reference.
1119     \
1120     {NOTE:: What should be if list value?
1121     \
1122     }
1123     @@Get:
1124     @@@Type:AnyURI
1125     @@@nullCase:
1126     @@@@enDesc:
1127     No value.
1128     @@@UndeclaredPrefixException:
1129 wakaba 1.3 @@@PerlDef:
1130 wakaba 1.4 __DEEP{
1131     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1132     if (defined $v and not ref $v eq 'ARRAY') {
1133     $r = $self-><AG::ManakaiDISElement.qnameToURI> ($v, node => $self);
1134     } else {
1135     $r = null;
1136     }
1137     }__;
1138    
1139     @Attr:
1140     @@Name: qnameValueLocalName
1141     @@enDesc:
1142     The local name part of the element value (assumed as
1143     written as <TYPE::dis:TypeQName>).
1144     \
1145     {NOTE:: What should be if list value?
1146     \
1147     }
1148     @@Get:
1149     @@@Type:
1150     DISCore:LocalName
1151     @@@nullCase:
1152     @@@@enDesc:
1153     No value.
1154     @@@PerlDef:
1155     __DEEP{
1156     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1157     if (defined $v and not ref $v eq 'ARRAY') {
1158     my ($n, $v) = split /:/, $v, 2;
1159     $r = defined $v ? $v : $n;
1160     } else {
1161     $r = null;
1162     }
1163     }__;
1164    
1165     @Attr:
1166     @@Name: qnameValueNamespaceURI
1167     @@enDesc:
1168     The namespace URI of the element value (assumed as written
1169     in <TYPE::dis:TypeQName>).
1170     \
1171     {NOTE:: What should be if list value?
1172     \
1173     }
1174     @@Get:
1175     @@@Type:AnyURI
1176     @@@nullCase:
1177     @@@@enDesc:
1178     No value.
1179     @@@UndeclaredPrefixException:
1180     @@@PerlDef:
1181     __DEEP{
1182     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1183     if (defined $v and not ref $v eq 'ARRAY') {
1184     my ($p, $v) = split /:/, $v, 2;
1185     $r = $self-><AG::ManakaiDISElement.prefixToURI>
1186     (defined $v ? $p : null);
1187     } else {
1188     $r = null;
1189     }
1190     }__;
1191 wakaba 1.2
1192     @Attr:
1193 wakaba 1.3 @@Name: tfqnamesValueURI
1194 wakaba 1.2 @@enDesc:
1195 wakaba 1.3 The element value (written as <TYPE::dis:TFQNames>),
1196 wakaba 1.2 as URI reference.
1197     \
1198     {NOTE:: What should be if list value?
1199     \
1200     }
1201     @@Get:
1202     @@@Type:ResourceURI
1203     @@@nullCase:
1204     @@@@enDesc:
1205     No value.
1206     @@@UndeclaredPrefixException:
1207 wakaba 1.3 @@@PerlDef:
1208     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1209 wakaba 1.2 if (defined $v and not ref $v eq 'ARRAY') {
1210     __DEEP{
1211 wakaba 1.3 $r = $self-><AG::ManakaiDISElement.tfqnamesToURI> ($v);
1212 wakaba 1.2 }__;
1213     } else {
1214     $r = null;
1215     }
1216 wakaba 1.1 ##DISElement
1217    
1218     ClsDef:
1219 wakaba 1.4 @ClsQName: ManakaiDISModuleElement
1220     @ClsISA: ManakaiDISElement
1221     @enDesc:
1222     The <Q::dis:Module> elements.
1223    
1224     @Attr:
1225     @@Name: requireElement
1226     @@enDesc:
1227     The <Q::dis:Require> child element. The element is
1228     newly created if not exist.
1229     @@Type: ManakaiDISElement
1230     @@Get:
1231     @@@PerlDef:
1232     __DEEP{
1233     $r = $self-><M::swcfg21:SWCFGNode
1234     ::swcfg21:ForLatest.getAttributeNS>
1235     (<Q::dis:>, 'Require', make_new_node => true);
1236     }__;
1237    
1238     @Attr:
1239     @@Name: defaultForURI
1240     @@enDesc:
1241     The value of <Q::dis:DefaultFor> attribute.
1242     @@Type: ForURI
1243     @@Get:
1244     @@@enDesc:
1245     The value of <Q::dis:DefaultFor> child element. If missing,
1246     <Q::ManakaiDOM:all> is returned.
1247     @@@PerlDef:
1248     __DEEP{
1249     my $df = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
1250     .getAttributeNS>
1251     (<Q::dis:>, 'DefaultFor');
1252     if ($df) {
1253     $r = $df-><AG::ManakaiDISElement.qnameValueURI>
1254     || <Q::ManakaiDOM:all>;
1255     } else {
1256     $r = <Q::ManakaiDOM:all>;
1257     }
1258     }__;
1259     @@Set:
1260     @@@PerlDef:
1261     __DEEP{
1262     $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.setAttributeNS>
1263     (<Q::dis:>, 'DefaultFor' => $given);
1264     }__;
1265     ##DISModuleElement
1266    
1267     ClsDef:
1268 wakaba 1.2 @ClsQName: ManakaiDISElementList
1269     @enDesc:
1270     @@lang:en
1271     @@@:
1272     Lists of elements.
1273     \
1274     {NOTE:: <Class::ManakaiDISElementList> is <QUOTE::dead>;
1275     later changes to the tree does not affect this type of objects.
1276     \
1277     }
1278     ##DISElementList
1279    
1280     ClsDef:
1281 wakaba 1.1 @ClsQName: ManakaiDISComment
1282     @ClsISA:
1283 wakaba 1.3 swcfg21:ManakaiSWCFGComment::swcfg21:ForLatest
1284 wakaba 1.1 @ClsISA: ManakaiDISNode
1285     @Description:
1286     @@lang:en
1287     @@@:
1288     <QUOTE::dis> comment node objects.
1289     ##DISComment
1290    
1291     ClsDef:
1292     @ClsQName: ManakaiDISDocumentFragment
1293     @ClsISA:
1294 wakaba 1.3 swcfg21:ManakaiSWCFGDocumentFragment::swcfg21:ForLatest
1295 wakaba 1.1 @ClsISA: ManakaiDISNode
1296     @Description:
1297     @@lang:en
1298     @@@:
1299     <QUOTE::dis> document fragment node objects.
1300     ##DISDocumentFragment
1301    
1302     ClsDef:
1303     @ClsQName: ManakaiDISDocument
1304     @ClsISA:
1305 wakaba 1.3 swcfg21:ManakaiSWCFGDocument::swcfg21:ForLatest
1306 wakaba 1.1 @ClsISA: ManakaiDISNode
1307     @Description:
1308     @@lang:en
1309     @@@:
1310     <QUOTE::dis> document node objects.
1311 wakaba 1.2
1312     @Attr:
1313 wakaba 1.4 @@Name: moduleElement
1314     @@enDesc:
1315     The <Q::dis:Module> element in this document. The element is
1316     newly created if not exist.
1317     @@Type: ManakaiDISModuleElement
1318     @@Get:
1319     @@@PerlDef:
1320     __DEEP{
1321     $r = $self-><M::swcfg21:SWCFGNode
1322     ::swcfg21:ForLatest.getAttributeNS>
1323     (<Q::dis:>, 'Module', make_new_node => true);
1324     }__;
1325     $r = bless $r, <ClassName::ManakaiDISModuleElement>;
1326    
1327     @Attr:
1328 wakaba 1.2 @@Name: disDatabase
1329     @@enDesc:
1330     Associated <QUOTE::dis> database.
1331    
1332     @@Type: ManakaiDISDatabase
1333     @@Get:
1334     @@@NoDBException:
1335     @@@PerlDef:
1336     if ($self->{<Q::TreeCore:node>}->{<Q::db>}) {
1337     $self = $self->{<Q::TreeCore:node>}->{<Q::db>};
1338     } else {
1339     __EXCEPTION{NO_ASSOCIATED_DB_ERR}__;
1340     }
1341     @@Set:
1342     @@@PerlDef:
1343     $self->{<Q::TreeCore:node>}->{<Q::db>} = $given;
1344     require Scalar::Util;
1345     Scalar::Util::weaken ($self->{<Q::TreeCore:node>}->{<Q::db>});
1346 wakaba 1.1 ##DISDocument
1347 wakaba 1.2
1348     PropDef:
1349     @QName: db
1350     @enDesc:
1351     Associated <QUOTE::dis> database.
1352     @rdfs:domain: ManakaiDISDocument
1353     @rdfs:range: ManakaiDISDatabase
1354    
1355     ## -- Definition object database
1356    
1357     ClsDef:
1358     @ClsQName: ManakaiDISDatabase
1359     @enDesc:
1360     Resource database created from <QUOTE::dis> source data.
1361 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
1362 wakaba 1.2
1363     @Method:
1364     @@Name: getModule
1365     @@Description:
1366     @@@lang:en
1367     @@@@:
1368     Returns a <QUOTE::dis> module definition.
1369     @@Param:
1370     @@@Name: modURI
1371     @@@Type: ModuleURI
1372     @@@Description:
1373     @@@@lang:en
1374     @@@@@:
1375     A <QUOTE::dis> module URI reference.
1376     @@Return:
1377     @@@Type: ManakaiDISModuleDefinition
1378     @@@Description:
1379     @@@@lang:en
1380     @@@@@:
1381     The module definition.
1382     @@@PerlDef:
1383     if (defined $self->{modDef}->{$modURI}) {
1384     $r = $self->{modDef}->{$modURI};
1385     } else {
1386     $r = $self->{modDef}->{$modURI}
1387     = bless {
1388     uri => $modURI,
1389     db => $self,
1390     for => <Q::ManakaiDOM:all>,
1391     forp => [],
1392     }, <ClassName::ManakaiDISModuleDefinition>;
1393     require Scalar::Util;
1394     Scalar::Util::weaken ($r->{db});
1395     }
1396    
1397     @Method:
1398     @@Name: getFor
1399     @@Description:
1400     @@@lang:en
1401     @@@@:
1402     Returns a <QUOTE::for> definition object.
1403     @@Param:
1404     @@@Name: forURI
1405     @@@Type: ForURI
1406     @@@Description:
1407     @@@@lang:en
1408     @@@@@:
1409     A <QUOTE::for> URI reference.
1410     @@@InCase:
1411     @@@@Value:
1412     @@@@@is-null:1
1413     @@@@Description:
1414     @@@@@lang:en
1415     @@@@@@:
1416     Defaulted to <Q::ManakaiDOM:all>.
1417     @@Return:
1418     @@@Type: ManakaiDISForDefinition
1419     @@@PerlDef:
1420     $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
1421     if (defined $self->{forDef}->{$forURI}) {
1422     $r = $self->{forDef}->{$forURI};
1423     } else {
1424     $r = $self->{forDef}->{$forURI}
1425     = bless {
1426     uri => $forURI,
1427     isa => {<Q::ManakaiDOM:all> => true},
1428     revISA => {},
1429     db => $self,
1430     }, <ClassName::ManakaiDISForDefinition>;
1431     $self->{forDef}->{<Q::ManakaiDOM:all>}->{revISA}->{$forURI} = true;
1432     require Scalar::Util;
1433     Scalar::Util::weaken ($r->{db});
1434     }
1435    
1436     @Method:
1437     @@Name: getResource
1438     @@Description:
1439     @@@lang:en
1440     @@@@:
1441     Returns a <QUOTE::dis> resource definition.
1442     @@Param:
1443     @@@Name: resURI
1444     @@@Type: ResourceURI
1445     @@@Description:
1446     @@@@lang:en
1447     @@@@@:
1448     A <QUOTE::dis> resource URI reference.
1449 wakaba 1.3 @@@nullCase:
1450 wakaba 1.2 @@@@Description:
1451     @@@@@lang:en
1452     @@@@@@:
1453     Defaulted to <Q::DOMMain:any>.
1454     @@Return:
1455     @@@Type: ManakaiDISResourceDefinition
1456     @@@Description:
1457     @@@@lang:en
1458     @@@@@:
1459     The resource definition.
1460     @@@PerlDef:
1461     $resURI = <Q::DOMMain:any> unless defined $resURI;
1462     if (defined $self->{resDef}->{$resURI}) {
1463     $r = $self->{resDef}->{$resURI};
1464     } else {
1465     $r = $self->{resDef}->{$resURI}
1466     = bless {
1467     uri => $resURI,
1468     subOf => {},
1469     supOf => {},
1470     db => $self,
1471     for => <Q::ManakaiDOM:all>,
1472     forp => [],
1473     }, <ClassName::ManakaiDISResourceDefinition>;
1474     require Scalar::Util;
1475     Scalar::Util::weaken ($r->{db});
1476     }
1477 wakaba 1.3
1478     @Method:
1479     @@Name: getSourceFile
1480     @@enDesc:
1481     Gets <QUOTE::dis> source document.
1482     @@Param:
1483     @@@Name: fileName
1484     @@@Type: FileURI
1485     @@@enDesc:
1486     A URI reference identifying a file.
1487     @@Return:
1488     @@@Type: ManakaiDISDocument
1489     @@@enDesc:
1490     The <QUOTE::dis> source document.
1491     @@@nullCase:
1492     @@@@enDesc:
1493     No document associated with that <P::fileName>.
1494     @@@PerlDef:
1495     $r = $self->{<Q::sourceFile>}->{$fileName};
1496     @Method:
1497     @@Name: setSourceFile
1498     @@enDesc:
1499     Puts <QUOTE::dis> source document object.
1500     @@Param:
1501     @@@Name: fileName
1502     @@@Type: FileURI
1503     @@@enDesc:
1504 wakaba 1.4 A URI reference identifying a file. If there is already a
1505 wakaba 1.3 source document, then the association has been updated.
1506     @@Param:
1507     @@@Name: doc
1508     @@@Type: ManakaiDISDocument
1509     @@@enDesc:
1510     The document object to set.
1511     @@Return:
1512     @@@PerlDef:
1513     $self->{<Q::sourceFile>}->{$fileName} = $doc;
1514 wakaba 1.4
1515     @Method:
1516     @@Name: loadModule
1517     @@enDesc:
1518     Loads definitions from a <QUOTE::dis> document.
1519     @@Param:
1520     @@@Name: doc
1521     @@@Type:ManakaiDISDocument
1522     @@@enDesc:
1523     The source <QUOTE::dis> document object. Its
1524     <A::ManakaiDISDocument.disDatabase> must be this database.
1525     @@Param:
1526     @@@Name: resolver
1527     @@@Type: DISModuleResolver
1528     @@@enDesc:
1529     The resolver to convert module name into <QUOTE::dis> document object.
1530     @@ForParam:
1531     @@Return:
1532     @@@RaiseException:
1533     @@@@@: NO_MODULE_QNAME_ERR
1534     @@@@enDesc:
1535     The <Q::dis:Module> element must have a <Q::dis:QName> attribute.
1536     @@@RaiseException:
1537     @@@@@: UNABLE_TO_GET_MODULE_ERR
1538     @@@@enDesc:
1539     The implementation is unable to get a module source.
1540     @@@PerlDef:
1541     $resolver = bless $resolver, <ClassName::ManakaiDISModuleResolver>
1542     if ref $resolver eq 'CODE';
1543     ## -- Module Name, URI
1544     $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
1545     my $mod_node;
1546     my $mod_name_node;
1547     __DEEP{
1548     $mod_node = $doc-><AG::ManakaiDISDocument.moduleElement>;
1549     $mod_name_node = $mod_node-><M::swcfg21:SWCFGNode
1550     ::swcfg21:ForLatest.getAttributeNS>
1551     (<Q::dis:>, 'QName');
1552     unless ($mod_name_node) {
1553     __UNDEEP{
1554     __EXCEPTION{NO_MODULE_QNAME_ERR::
1555     DIS:sourceNode => {$mod_node},
1556     }__;
1557     }__;
1558     }
1559     my $mod_name_uri;
1560     my $mod_uri;
1561     my $mod;
1562     $mod_name_uri = $mod_name_node-><AG::ManakaiDISElement.qnameValueURI>;
1563     __CODE{tfurisToURI:: $turi => $mod_name_uri, $furi => $forArg,
1564     $uri => $mod_uri}__;
1565     $mod = $self-><M::ManakaiDISDatabase.getModule> ($mod_uri);
1566    
1567     unless ($mod-><M::ManakaiDISModuleDefinition.isDefined>) {
1568     ## -- Initializes Module Definition Object
1569     $mod->{nameURI} = $mod_name_uri;
1570     $mod->{localName} = $mod_name_node-><AG::ManakaiDISElement
1571     .qnameValueLocalName>;
1572     $mod->{namespaceURI} = $mod_name_node-><AG::ManakaiDISElement
1573     .qnameValueNamespaceURI>;
1574     $mod->{for} = $forArg;
1575     $mod->{src} = $mod_node;
1576     $mod-><M::ManakaiDISModuleDefinition.isDefined> (true);
1577     $self-><M::ManakaiDISDatabase.setSourceFile>
1578     ($mod->{nameURI} => $mod->{src});
1579    
1580     ## -- Loads Required Modules
1581     my $req_node = $mod_node-><AG::ManakaiDISModuleElement
1582     .requireElement>;
1583     for my $rm (@{$req_node-><M::ManakaiDISElement.disChildElements>}) {
1584     next unless $rm-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1585     .expandedURI> eq <Q::dis:Module>;
1586     my ($uri, $nuri, $ln, $for);
1587     my $mqn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1588     .getAttributeNS> (<Q::dis:>, 'QName');
1589     if ($mqn) {
1590     my $mqv = $mqn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1591     .value>;
1592     my $mqp = $mqn-><AG::ManakaiDISElement.qnameToPair>
1593     ($mqv, node => $mqn);
1594     ($nuri, $ln) = @$mqp;
1595     } else {
1596     my $mn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1597     .getAttributeNS> (<Q::dis:>, 'Name');
1598     if ($mn) {
1599     $nuri = $mod->{namespaceURI};
1600     $ln = $mn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1601     } else {
1602     $nuri = $mod->{namespaceURI};
1603     $ln = $mod->{localName};
1604     }
1605     }
1606     my $wfn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1607     .getAttributeNS> (<Q::dis:>, 'WithFor');
1608     if ($wfn) {
1609     $for = $wfn-><AG::ManakaiDISElement.qnameValueURI>;
1610     } else {
1611     $for = $mod->{for};
1612     }
1613     my $xuri = $nuri . $ln;
1614     __CODE{tfurisToURI:: $turi => $xuri, $furi => $for,
1615     $uri => $uri}__;
1616     my $rmod = $self-><M::ManakaiDISDatabase.getModule> ($uri);
1617     unless ($rmod-><AG::ManakaiDISModuleDefinition.isDefined>) {
1618     my $rdoc = $resolver-><M::ManakaiDISModuleResolver.uriToDocument>
1619     ($self, $uri, $nuri, $ln, $for);
1620     unless ($rdoc) {
1621     __UNDEEP{
1622     __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
1623     DIS:uri => {$uri},
1624     DIS:namespaceURI => {$nuri},
1625     DIS:localName => {$ln},
1626     DIS:for => {$for},
1627     DIS:sourceNode => {$rm},
1628     }__;
1629     }__;
1630     }
1631     $self-><M::ManakaiDISDatabase.loadModule>
1632     ($rdoc, $resolver, for_arg => $for);
1633     }
1634     } # Child Module elements
1635    
1636     ## -- Loads "for all"
1637     my $nuri = $mod->{NameURI};
1638     my $forall = <Q::ManakaiDOM:all>;
1639     my $uri;
1640     __CODE{tfurisToURI:: $turi => $nuri, $furi => $forall,
1641     $uri => $uri}__;
1642     my $rmod = $self-><M::ManakaiDISDatabase.getModule> ($uri);
1643     unless ($rmod-><AG::ManakaiDISModuleDefinition.isDefined>) {
1644     my $rdoc = $resolver-><M::ManakaiDISModuleResolver.uriToDocument>
1645     ($self, $uri, $nuri, $mod->{localName}, $forall);
1646     unless ($rdoc) {
1647     __UNDEEP{
1648     __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
1649     DIS:uri => {$uri},
1650     DIS:namespaceURI => {$nuri},
1651     DIS:localName => {$mod->{localName}},
1652     DIS:for => {$forall},
1653     DIS:sourceNode => {$mod->{src}},
1654     }__;
1655     }__;
1656     }
1657     $self-><M::ManakaiDISDatabase.loadModule>
1658     ($rdoc, $resolver, for_arg => $forall);
1659     }
1660     }
1661     }__;
1662 wakaba 1.2 ##DISDatabase
1663    
1664 wakaba 1.4 IFClsDef:
1665     @QName:
1666     @@@: DISModuleResolver
1667     @@ForCheck: ForIF
1668     @QName:
1669     @@@: ManakaiDISModuleResolver
1670     @@ForCheck: ForClass
1671     @enDesc:
1672     Objects implementing <IF::DISModuleResolver> interface
1673     are used to convert module name into <QUOTE::dis> document object.
1674     \
1675     {NOTE:: It is also acceptable to pass a <Perl::CODE> reference
1676     as a method parameter where <IF::DISModuleResolver> is
1677     expected.
1678     \
1679     }
1680     @Method:
1681     @@Name: uriToDocument
1682     @@enDesc:
1683     Returns a <QUOTE::dis> document from module name information.
1684     @@Param:
1685     @@@Name: disDB
1686     @@@Type: ManakaiDISDatabase
1687     @@@enDesc:
1688     The <QUOTE::dis> database.
1689     @@Param:
1690     @@@Name: moduleURI
1691     @@@Type: ModuleURI
1692     @@@enDesc:
1693     The URI reference of the module.
1694     \
1695     {NOTE:: This parameter is redundant, since it can be
1696     composed from other three parameters.
1697     \
1698     }
1699     @@Param:
1700     @@@Name: moduleNamespaceURI
1701     @@@Type: AnyURI
1702     @@@enDesc:
1703     The namespace URI of the module name.
1704     @@Param:
1705     @@@Name: moduleLocalName
1706     @@@Type:
1707     DISCore:LocalName
1708     @@@enDesc:
1709     The local name of the module name.
1710     @@Param:
1711     @@@Name: moduleFor
1712     @@@Type: ForURI
1713     @@@enDesc:
1714     The <QUOTE::for> URI reference for which the module is defined.
1715     @@Return:
1716     @@@Type: ManakaiDISDocument
1717     @@@enDesc:
1718     The <QUOTE::dis> document. It don't have to be a newly created
1719     object.
1720     @@@nullCase:
1721     @@@@enDesc:
1722     The method is unable to resolve the reference.
1723     @@@PerlDef:
1724     $r = $self->(@_);
1725     @ManakaiDOM:inputNormalizer:
1726     @@ContentType:
1727     lang:Perl
1728     @@@:
1729     $INPUT = bless $INPUT, <ClassName::ManakaiDISModuleResolver>
1730     if ref $INPUT eq 'CODE';
1731     @@ImplNote:
1732     @@@lang:en
1733     @@@@:
1734     <FILE::cdis2pm.pl> does not support non-datatype input normalizers yet.
1735     ##DISModuleResolver
1736    
1737 wakaba 1.3 PropDef:
1738     @QName: sourceFile
1739     @enDesc:
1740     Source <QUOTE::dis> documents.
1741     @rdfs:domain: ManakaiDISDatabase
1742     @rdfs:range: ManakaiDISDocument
1743    
1744 wakaba 1.2 ClsDef:
1745     @ClsQName: ManakaiDISModuleDefinition
1746     @enDesc:
1747     <QUOTE::dis> module definitions.
1748     @ClsISA: ManakaiDISPropertyAccessor
1749 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
1750 wakaba 1.2
1751     @Attr:
1752     @@Name: uri
1753     @@Type: ModuleURI
1754     @@Description:
1755     @@@lang:en
1756     @@@@:
1757     The URI reference of this <QUOTE::dis> module.
1758     @@Get:
1759     @@@PerlDef:
1760     $r = $self->{uri};
1761    
1762     @Attr:
1763     @@Name: nameURI
1764     @@Type: NameURI
1765     @@enDesc:
1766     The URI reference of this module, without
1767     <QUOTE::for> identifier.
1768     @@Get:
1769 wakaba 1.3 @@@PerlDef:
1770 wakaba 1.4 $r = $self->{nameURI};
1771 wakaba 1.2
1772     @Attr:
1773     @@Name: localName
1774     @@enDesc:
1775     The local name of this module.
1776     @@Type:
1777 wakaba 1.3 DISCore:LocalName::ManakaiDOM:all
1778 wakaba 1.2 @@Get:
1779     @@@PerlDef:
1780     $r = $self->{localName};
1781    
1782     @Attr:
1783     @@Name: namespaceURI
1784     @@Type: AnyURI
1785     @@enDesc:
1786     The namespace URI of the name of this resource.
1787     @@Get:
1788     @@@PerlDef:
1789     $r = $self->{namespaceURI};
1790    
1791     @Attr:
1792     @@Name: forURI
1793     @@Type: ForURI
1794     @@enDesc:
1795     The <QUOTE::for> URI reference for which this module is defined.
1796     @@Get:
1797     @@@PerlDef:
1798     $r = $self->{for};
1799    
1800     @Attr:
1801     @@Name: isDefined
1802     @@Description:
1803     @@@lang:en
1804     @@@@:
1805     Whether this module is defined or not.
1806     @@Type:
1807     DOMMain:boolean
1808     @@Get:
1809     @@@PerlDef:
1810     $r = $self->{<Q::isDefined>};
1811     ##DISModuleDefinition
1812    
1813     ClsDef:
1814     @ClsQName: ManakaiDISForDefinition
1815     @Description:
1816     @@lang:en
1817     @@@:
1818     <QUOTE::dis> <QUOTE::for> definitions.
1819 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
1820 wakaba 1.2
1821     @Attr:
1822     @@Name: uri
1823     @@Type: ForURI
1824     @@Description:
1825     @@@lang:en
1826     @@@@:
1827     The URI reference of this <QUOTE::for>.
1828     @@Get:
1829     @@@PerlDef:
1830     $r = $self->{uri};
1831    
1832     @Method:
1833     @@Name: isaURI
1834     @@Description:
1835     @@@lang:en
1836     @@@@:
1837     Whether this <QUOTE::for> is-a another <QUOTE::for> or not.
1838     @@Param:
1839     @@@Name: superURI
1840     @@@Type: ForURI
1841     @@@Description:
1842     @@@@lang:en
1843     @@@@@:
1844     Another <QUOTE::for> URI reference to test.
1845     @@Return:
1846     @@@Type:
1847     DOMMain:boolean
1848     @@@TrueCase:
1849     @@@@enDesc:
1850     <P::superURI> is a super-<QUOTE::for> of this <QUOTE::for>.
1851     @@@FalseCase:
1852     @@@@enDesc:
1853     <P::superURI> is not a super-<QUOTE::for> of this <QUOTE::for>.
1854     @@@PerlDef:
1855     $r = $self->{uri} eq $superURI ? true : $self->{isa}->{$superURI};
1856    
1857     @Attr:
1858     @@Name: isDefined
1859     @@Description:
1860     @@@lang:en
1861     @@@@:
1862     Whether this <QUOTE::for> is already defined or not.
1863     @@Type:
1864     DOMMain:boolean
1865     @@Get:
1866     @@@TrueCase:
1867     This <QUOTE::for> is already defined.
1868     @@@FalseCase:
1869     This <QUOTE::for> is not defined.
1870     @@@PerlDef:
1871     $r = $self->{<Q::isDefined>};
1872    
1873     @Attr:
1874     @@Name: isReferred
1875     @@Description:
1876     @@@lang:en
1877     @@@@:
1878     Whether this <QUOTE::for> is referred somewhere or not.
1879     @@Type:
1880     DOMMain:any
1881     @@Get:
1882     @@@InCase:
1883     @@@@Type:ManakaiDISElement
1884     @@@@enDesc:
1885     This <QUOTE::for> is referred by the element.
1886     @@@nullCase:
1887     This <QUOTE::for> is not referred.
1888     @@@PerlDef:
1889     $r = $self->{<Q::isReferred>};
1890     @@Set:
1891     @@@InCase:
1892     @@@@Type:ManakaiDISElement
1893     @@@@enDesc:
1894     This <QUOTE::for> is referred by the element.
1895     @@@PerlDef:
1896     $self->{<Q::isReferred>} = true if $given;
1897    
1898     @Attr:
1899     @@Name: definingModule
1900     @@Description:
1901     @@@lang:en
1902     @@@@:
1903     The <QUOTE::dis> module in which this <QUOTE::for> is defined.
1904     @@Type: ManakaiDISModuleDefinition
1905     @@Get:
1906     @@@Description:
1907     @@@@lang:en
1908     @@@@@:
1909     The module object.
1910 wakaba 1.3 @@@nullCase:
1911 wakaba 1.2 @@@@Description:
1912     @@@@@lang:en
1913     @@@@@@:
1914     This <QUOTE::for> is not associated to any module.
1915     @@@PerlDef:
1916     $r = $self->{db}
1917     -><M::ManakaiDISDatabase.getResource>
1918     ($self->{<Q::definingModule>})
1919     if defined $self->{<Q::definingModule>};
1920    
1921     @Method:
1922     @@Name: readDefinition
1923     @@enDesc:
1924     Reads <QUOTE::for> definition and sets attributes.
1925     @@Param:
1926     @@@Name: forDefElement
1927     @@@Type: ManakaiDISElement
1928     @@@Description:
1929     @@@@lang:en
1930     @@@@@:
1931     A <CODE::ForDef> element containing definition of this <QUOTE::for>.
1932     @@Return:
1933     @@@RaiseException:
1934     @@@@@:FOR_ALREADY_DEFINED_ERR
1935     @@@@Description:
1936     @@@@@lang:en
1937     @@@@@@:
1938     The <QUOTE::for> definition for this <QUOTE::for> is already read.
1939     @@@PerlDef:
1940     if ($self->{<Q::isDefined>}) {
1941 wakaba 1.3 # __EXCEPTION{FOR_ALREADY_DEFINED_ERR}__;
1942 wakaba 1.2 }
1943     ## TODO:
1944     $self->{<Q::isDefined>} = true;
1945     ##DISForDefinition
1946    
1947     ClsDef:
1948     @ClsQName: ManakaiDISResourceDefinition
1949     @enDesc:
1950     <QUOTE::dis> resource definitions.
1951     @ClsISA: ManakaiDISPropertyAccessor
1952 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
1953 wakaba 1.2
1954     @Attr:
1955     @@Name: uri
1956     @@Type: ResourceURI
1957     @@Description:
1958     @@@lang:en
1959     @@@@:
1960     The URI reference of this <QUOTE::dis> resource.
1961     @@Get:
1962     @@@PerlDef:
1963     $r = $self->{uri};
1964    
1965     @Attr:
1966     @@Name: nameURI
1967     @@Type: NameURI
1968     @@enDesc:
1969     The URI reference of this <QUOTE::dis> resource, without
1970     <QUOTE::for> identifier.
1971     @@Get:
1972     @@@nullCase:
1973     @@@@enDesc:
1974     This resource does not have its name URI reference.
1975 wakaba 1.3 @@@PerlDef:
1976 wakaba 1.4 $r = $self->{nameURI};
1977 wakaba 1.2
1978     @Attr:
1979     @@Name: localName
1980     @@enDesc:
1981     The local name of this resource.
1982     @@Type:
1983 wakaba 1.3 DISCore:LocalName::ManakaiDOM:all
1984 wakaba 1.2 @@Get:
1985     @@@nullCase:
1986     @@@@enDesc:
1987     This resource does not have its local name.
1988     @@@PerlDef:
1989     $r = $self->{localName};
1990    
1991     @Attr:
1992     @@Name: namespaceURI
1993     @@Type: AnyURI
1994     @@enDesc:
1995     The namespace URI of the name of this resource.
1996     @@Get:
1997     @@@nullCase:
1998     The name of this resource does not have its namespace
1999     or this resource does not have its name.
2000     @@@PerlDef:
2001     $r = $self->{namespaceURI};
2002    
2003     @Attr:
2004     @@Name: isAnonymous
2005     @@enDesc:
2006     Whether this <QUOTE::dis> resource has name or not.
2007     @@Type:
2008     DOMMain:boolean
2009     @@Get:
2010     @@@TrueCase:
2011     This resource does not have any global unique name.
2012     <A::ManakaiDISResourceDefinition.uri> is a temporary URI reference.
2013     @@@FalseCase:
2014     This resource does have its formal name.
2015     <A::ManakaiDISResourceDefinition.uri> is a URI reference
2016     generated from the name and the <QUOTE::for> URI reference
2017     of this resource.
2018     @@@PerlDef:
2019     $r = $self->{<Q::isAnon>};
2020    
2021     @Attr:
2022     @@Name: forURI
2023     @@enDesc:
2024     The <QUOTE::for> URI reference for which this resource is defined.
2025     @@Type:ForURI
2026     @@Get:
2027     @@@PerlDef:
2028     $r = $self->{for};
2029    
2030     @Attr:
2031     @@Name: forpURI
2032     @@enDesc:
2033     The <QUOTE::for+> URI references for which this resource is defined.
2034     @@Type: ForURIList
2035     @@Get:
2036 wakaba 1.3 @@@PerlDef:
2037 wakaba 1.2 $r = $self->{forp};
2038    
2039     @Method:
2040     @@Name: subsetOfURI
2041     @@Description:
2042     @@@lang:en
2043     @@@@:
2044     Whether this resource is a subset of another resource or not.
2045     @@Param:
2046     @@@Name: superURI
2047     @@@Type: ResourceURI
2048     @@@Description:
2049     @@@@lang:en
2050     @@@@@:
2051     Another resource URI reference to test.
2052     @@Return:
2053     @@@Type:
2054     DOMMain:boolean
2055     @@@TrueCase:
2056     @@@@enDesc:
2057     <P::superURI> is a super-resource of this resource.
2058     @@@FalseCase:
2059     @@@@enDesc:
2060     <P::superURI> is not a super-resource of this resource.
2061     @@@PerlDef:
2062     $r = $superURI eq $self->{uri} ? true : $self->{subOf}->{$superURI};
2063    
2064     @Attr:
2065     @@Name: isDefined
2066     @@Description:
2067     @@@lang:en
2068     @@@@:
2069     Whether this resource is already defined or not.
2070     @@Type:
2071     DOMMain:boolean
2072     @@Get:
2073     @@@TrueCase:
2074     This resource is already defined.
2075     @@@FalseCase:
2076     This resource is not defined.
2077     @@@PerlDef:
2078     $r = $self->{<Q::isDefined>};
2079    
2080     @Attr:
2081     @@Name: isReferred
2082     @@Description:
2083     @@@lang:en
2084     @@@@:
2085     Whether this resource is referred or not.
2086     @@Type:
2087     DOMMain:any
2088     @@Get:
2089     @@@InCase:
2090     @@@@Type:ManakaiDISElement
2091     @@@@enDesc:
2092     This resource is referred by the element.
2093     @@@nullCase:
2094     This resource is not referred.
2095     @@@PerlDef:
2096     $r = $self->{<Q::isReferred>};
2097     @@Set:
2098     @@@InCase:
2099     @@@@Type:ManakaiDISElement
2100     @@@@enDesc:
2101     This resource is referred by this element.
2102     @@@PerlDef:
2103     $self->{<Q::isReferred>} = $given if $given;
2104    
2105     @Attr:
2106     @@Name: definingModule
2107     @@Description:
2108     @@@lang:en
2109     @@@@:
2110     The <QUOTE::dis> module in which this resource is defined.
2111     @@Type: ManakaiDISModuleDefinition
2112     @@Get:
2113     @@@Description:
2114     @@@@lang:en
2115     @@@@@:
2116     The module object.
2117 wakaba 1.3 @@@nullCase:
2118 wakaba 1.2 @@@@Description:
2119     @@@@@lang:en
2120     @@@@@@:
2121     This resource is not associated to any module.
2122     @@@PerlDef:
2123     $r = $self->{db}
2124     -><M::ManakaiDISDatabase.getModule>
2125     ($self->{<Q::definingModule>})
2126     if defined $self->{<Q::definingModule>};
2127     @@Set:
2128     @@@Description:
2129     @@@@lang:en
2130     @@@@@:
2131     The module object to which the <QUOTE::defining module> is set.
2132     @@@PerlDef:
2133     $self->{<Q::defininingModule>}
2134     = $given-><AG::ManakaiDISModuleDefinition.uri>;
2135    
2136     ##DISResourceDefinition
2137    
2138     ClsDef:
2139     @ClsQName: ManakaiDISPropertyAccessor
2140 wakaba 1.3 @enDesc:
2141 wakaba 1.2 Accessor methods for resource or module properties.
2142    
2143     @Method:
2144     @@Name: getPropertyText
2145     @@enDesc:
2146     Gets property value text.
2147     @@PropNameParam:
2148     @@Param:
2149     @@@Name:default
2150     @@@Type:
2151 wakaba 1.3 swcfg21:SWCFGString::swcfg21:ForLatest
2152 wakaba 1.2 @@@enDesc:
2153     The default value that is returned if no explicit property
2154     value specification found for this resource.
2155     @@@nullCase:
2156     @@@@enDesc:
2157     No default value supplied; <DOM::null> is returned if
2158     no value specified.
2159     @@Return:
2160     @@@Type:
2161 wakaba 1.3 swcfg21:SWCFGString::swcfg21:ForLatest
2162 wakaba 1.2 @@@enDesc:
2163     The property value string.
2164     @@@nullCase:
2165     @@@@enDesc:
2166     No value nor default value has specified.
2167     @@@PerlDef:
2168     if (exists $self->{$propName}) {
2169     $r = defined $self->{$propName} ? $self->{$propName} : $default;
2170     } elsif ($self->{src}) {
2171     $r = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
2172     ($propName, for_arg => $self->{for},
2173     forp_arg => $self->{forp});
2174     $self->{$propName} = $r;
2175     $r = $default unless defined $r;
2176     } else {
2177     $r = $default;
2178     }
2179    
2180     @Method:
2181     @@Name: getPropertyResource
2182     @@enDesc:
2183     Gets property value resource.
2184     @@PropNameParam:
2185     @@Return:
2186     @@@Type: ManakaiDISResourceDefinition
2187     @@@enDesc:
2188     The property value resource.
2189     @@@nullCase:
2190     @@@@enDesc:
2191     No value has specified.
2192     @@@PerlDef:
2193     if (defined $self->{$propName}) {
2194     $r = $self->{db}-><M::ManakaiDISDatabase.getResource>
2195     ($self->{$propName});
2196     } else {
2197     $r = null;
2198     }
2199    
2200     @Method:
2201     @@Name: addPropertyResourceList
2202     @@enDesc:
2203     Adds a resource to a resource-list property value.
2204     \
2205     {ISSUE:: Should an exception be thrown if the property is
2206     not of list?
2207     \
2208     }
2209     @@PropNameParam:
2210     @@Param:
2211     @@@Name: res
2212     @@@Type: ManakaiDISResourceDefinition
2213     @@@enDesc:
2214     A resource to add.
2215     @@Return:
2216     @@@PerlDef:
2217     if (ref $self->{$propName} eq 'ARRAY') {
2218     push @{$self->{$propName}}, $res->{uri};
2219     } elsif (not defined $self->{$propName}) {
2220     $self->{$propName} = [$res->{uri}];
2221     }
2222    
2223 wakaba 1.3 ElementTypeBinding:
2224     @Name: PropNameParam
2225     @ElementType:
2226     dis:ResourceDef
2227     @ShadowContent:
2228     @@rdf:type:
2229     DISLang:MethodParameter
2230     @@Name: propName
2231     @@Type: ResourceURI
2232     @@Description:
2233     @@@lang:en
2234     @@@@:
2235     The name of the property.
2236    
2237 wakaba 1.2 ##DISPropertyAccessor
2238    
2239     PropDef:
2240     @QName:isAnon
2241     @Description:
2242     @@lang:en
2243     @@@:
2244     Whether the subject resource is anonymous or not.
2245     @Type:
2246     DOMMain:boolean
2247    
2248     PropDef:
2249     @QName:isDefined
2250     @Description:
2251     @@lang:en
2252     @@@:
2253     Whether the subject resource is defined or not.
2254    
2255     PropDef:
2256 wakaba 1.3 @QName:isReferred
2257 wakaba 1.2 @Description:
2258     @@lang:en
2259     @@@:
2260     Whether the subject resource is referred or not.
2261     @Type:
2262     DOMMain:any
2263    
2264     PropDef:
2265     @QName:definingModule
2266     @Description:
2267     @@lang:en
2268     @@@:
2269     The <QUOTE::dis> module in which the subject resource is defined.
2270     @rdfs:domain:
2271     DISCore:Module
2272 wakaba 1.1
2273     ## -- Datatypes
2274    
2275     URITypeDef:
2276 wakaba 1.3 @QName: AnyURI
2277     @Description:
2278     @@lang:en
2279     @@@:
2280     Any URI references.
2281    
2282     URITypeDef:
2283     @QName: FileURI
2284     @enDesc:
2285     URI references identifying file.
2286    
2287     URITypeDef:
2288 wakaba 1.1 @QName: ForURI
2289     @Description:
2290     @@lang:en
2291     @@@:
2292     <QUOTE::For> URI references.
2293    
2294     DataTypeDef:
2295     @QName: ForURIList
2296     @Description:
2297     @@lang:en
2298     @@@:
2299     References to the array containing <QUOTE::for> URI references.
2300    
2301     URITypeDef:
2302 wakaba 1.3 @QName: ResourceURI
2303     @Description:
2304     @@lang:en
2305     @@@:
2306     A URI reference for a <QUOTE::dis> resource.
2307    
2308     URITypeDef:
2309 wakaba 1.1 @QName: MediaTypeURI
2310     @Description:
2311     @@lang:en
2312     @@@:
2313     Media type URI references.
2314 wakaba 1.3 @rdfs:subClassOf: ResourceURI
2315    
2316     URITypeDef:
2317     @QName: ModuleURI
2318     @enDesc:
2319     URI references for <QUOET::dis> modules.
2320     @rdfs:subClassOf: ResourceURI
2321    
2322     URITypeDef:
2323     @QName: NameURI
2324     @enDesc:
2325     URI references identifying a resource.
2326     @rdfs:subClassOf: ResourceURI
2327    
2328     ElementTypeBinding:
2329     @Name: DataTypeDef
2330     @ElementType:
2331     dis:ResourceDef
2332     @ShadowContent:
2333     @@rdf:type:
2334     ManakaiDOM:DataType
2335    
2336     ElementTypeBinding:
2337     @Name: URITypeDef
2338     @ElementType:
2339     dis:ResourceDef
2340     @ShadowContent:
2341     @@rdf:type:
2342     ManakaiDOM:DataType
2343     @@rdfs:subClassOf: AnyURI
2344 wakaba 1.1
2345     ## -- Exceptions
2346    
2347     XParamDef:
2348     @QName: sourceNode
2349     @Description:
2350     @@lang:en
2351     @@@:
2352 wakaba 1.4 The node in which an error has occurred.
2353 wakaba 1.1 @Type: DISNode
2354 wakaba 1.3
2355     ExceptionDef:
2356     @ClsQName: ManakaiDISException
2357     @enDesc:
2358     Exceptions for the <QUOTE::dis> operations.
2359 wakaba 1.4 @ClsISA:
2360     ManakaiDOM:ManakaiDOMException::ManakaiDOM:Perl
2361 wakaba 1.3 @XConstGroupDef:
2362     @@ClsQName: ManakaiDISExceptionCode
2363     @@enDesc:
2364     Exception codes for <Class::ManakaiDISException>.
2365     @@XConstDef:
2366     @@@Name: NAMESPACE_ERR
2367     @@@Value:14
2368     @@@enDesc:
2369     An error related to namespaces has occurred.
2370     @@@XSubTypeDef:
2371     @@@@QName: UNDECLARED_NS_PREFIX_ERR
2372     @@@@enDesc:
2373     The implementation has encounted an undeclared namespace
2374     prefix.
2375     @@XConstDef:
2376     @@@Name: INVALID_STATE_ERR
2377     @@@Value:11
2378     @@@enDesc:
2379     An attempt is made to use an object that is not (or no longer) usable.
2380     @@@XSubTypeDef:
2381     @@@@QName: NO_ASSOCIATED_DB_ERR
2382     @@@@enDesc:
2383     No <QUOTE::dis> database has been associated with this document.
2384 wakaba 1.4 @@XConstDef:
2385     @@@Name: INVALID_SOURCE_ERR
2386     @@@Value: 200
2387     @@@enDesc:
2388     The source input is well-formed but invalid.
2389     @@@XSubTypeDef:
2390     @@@@QName: NO_MODULE_QNAME_ERR
2391     @@@@enDesc:
2392     The <Q::dis:Module> element must have its <Q::dis:QName>
2393     attribute.
2394     @@@XSubTypeDef:
2395     @@@@QName: UNABLE_TO_GET_MODULE_ERR
2396     @@@@enDesc:
2397     The implementation is unable to get the module source.
2398     @@@@Def:
2399     @@@@@ContentType:
2400     lang:muf
2401     @@@@@lang:en
2402     @@@@@@:
2403     Unable to get the module source of <%p (name => {<Q::DIS:uri>});>
2404     @@@@XParam:
2405     @@@@@QName: uri
2406     @@@@@enDesc:
2407     The URI reference of the module.
2408     @@@@XParam:
2409     @@@@@QName: namespaceURI
2410     @@@@@enDesc:
2411     The namespace URI of the module name.
2412     @@@@XParam:
2413     @@@@@QName: localName
2414     @@@@@enDesc:
2415     The local name of the module name.
2416     @@@@XParam:
2417     @@@@@QName: for
2418     @@@@@enDesc:
2419     The <QUOTE::for> of the module.
2420     ##DISException
2421    
2422     ClsDef:
2423     @ClsQName: ManakaiDISExceptionTarget
2424     @enDesc:
2425     Objects that is able to be the target of an exception.
2426     @IntMethod:
2427     @@Operator:
2428     @@@@:
2429     ManakaiDOM:MUErrorHandler
2430     @@@ContentType:
2431     dis:TypeQName
2432     @@Description:
2433     @@@lang:en
2434     @@@@:
2435     This method is a generic error handler; all manakai exceptions
2436     and warnings associated to an object are once reported to this method
2437     and then delivered to appropriate entities.
2438     \
2439     If the error is an exception (such as <X::DOMCore:DOMException> or
2440     <X::ManakaiDOM:ManakaiDOMImplementationException>), it is
2441     simply thrown. If the error is only a warning, it is reported
2442     via the <IF::DOMCore:DOMError> interface.
2443     \
2444     See <PerlModule::Message::Util::Error> documentation for more
2445     information on the error reporting mechanism.
2446     \
2447     {NOTE:: This kind of methods are named as <Perl::___report_error>
2448     in the convention of <PerlModule::Message::Util::Error>.
2449     \
2450     }
2451     @@Param:
2452     @@@Name:err
2453     @@@Type:
2454     ManakaiDOM:ManakaiDOMExceptionOrWarning::ManakaiDOM:Perl
2455     @@@Description:
2456     @@@@lang:en
2457     @@@@@:
2458     An exception object that describes what kind of error it is
2459     and how it should be recovered.
2460     \
2461     {NOTE:: Exception objects in manakai implementation
2462     inherit the class <PerlModule::Message::Util::Error>,
2463     that in turn inherits <PerlModule::Error>.
2464     \
2465     }
2466     @@Return:
2467     @@@PerlDef:
2468     if ($err->isa (<ClassName::ManakaiDOM:ManakaiDOMException
2469     ::ManakaiDOM:Perl>)) {
2470     $err->throw;
2471     } else {
2472     \## TODO: Implement warning reporting
2473     warn $err->stringify;
2474     }
2475     ##DISExceptionTarget
2476    
2477     ForDef:
2478     @QName:
2479     DIS:ForIF
2480     ForDef:
2481     @QName:
2482     DIS:ForClass
2483    
2484     ElementTypeBinding:
2485     @Name: IFClsDef
2486     @ElementType:
2487     dis:ResourceDef
2488     @ShadowContent:
2489     @@rdf:type:
2490     @@@@:
2491     dis:MultipleResource
2492     @@@ForCheck: !ForClass !ForIF
2493     @@rdf:type:
2494     @@@@:
2495     ManakaiDOM:IF
2496     @@@ForCheck: ForIF
2497     @@rdf:type:
2498     @@@@:
2499     ManakaiDOM:Class
2500     @@@ForCheck: ForClass
2501     @@resourceFor: ForIF
2502     @@resourceFor:
2503     @@@@: ForClass
2504     @@@ForCheck: ForLatest
2505     @@DOMMain:implementFeature:
2506     @@@@:CoreFeature10
2507     @@@ForCheck: ForClass
2508     @@ForCheck:
2509     ManakaiDOM:Perl
2510 wakaba 1.3
2511     ElementTypeBinding:
2512     @Name: ClsDef
2513     @ElementType:
2514     dis:ResourceDef
2515     @ShadowContent:
2516     @@rdf:type:
2517     ManakaiDOM:Class
2518     @@AliasFor:
2519     @@@@:
2520     ::ForLatest
2521     @@@For:
2522     !=ForLatest
2523     @@ForCheck:
2524     ManakaiDOM:Perl
2525     @@DOMMain:implementFeature: CoreFeature10
2526    
2527     ElementTypeBinding:
2528     @Name: ExceptionDef
2529     @ElementType:
2530     dis:ResourceDef
2531     @ShadowContent:
2532     @@rdf:type:
2533     ManakaiDOM:ExceptionClass
2534     @@AliasFor:
2535     @@@@:
2536     ::ForLatest
2537     @@@For:
2538     !=ForLatest
2539     @@ForCheck:
2540     ManakaiDOM:Perl
2541     @@DOMMain:implementFeature: CoreFeature10
2542    
2543     ElementTypeBinding:
2544     @Name: ClsQName
2545     @ElementType:
2546     dis:QName
2547    
2548     ElementTypeBinding:
2549     @Name: ClsISA
2550     @ElementType:
2551     dis:ISA
2552    
2553     ElementTypeBinding:
2554     @Name: Method
2555     @ElementType:
2556     dis:ResourceDef
2557     @ShadowContent:
2558     @@rdf:type:
2559     DISLang:Method
2560    
2561     ElementTypeBinding:
2562     @Name: IntMethod
2563     @ElementType:
2564     dis:ResourceDef
2565     @ShadowContent:
2566     @@rdf:type:
2567     DISLang:Method
2568     @@ManakaiDOM:isForInternal:1
2569    
2570     ElementTypeBinding:
2571     @Name: Attr
2572     @ElementType:
2573     dis:ResourceDef
2574     @ShadowContent:
2575     @@rdf:type:
2576     DISLang:Attribute
2577    
2578     ElementTypeBinding:
2579     @Name: Return
2580     @ElementType:
2581     dis:ResourceDef
2582     @ShadowContent:
2583     @@rdf:type:
2584     DISLang:MethodReturn
2585    
2586     ElementTypeBinding:
2587     @Name: Get
2588     @ElementType:
2589     dis:ResourceDef
2590     @ShadowContent:
2591     @@rdf:type:
2592     DISLang:AttributeGet
2593    
2594     ElementTypeBinding:
2595     @Name: Set
2596     @ElementType:
2597     dis:ResourceDef
2598     @ShadowContent:
2599     @@rdf:type:
2600     DISLang:AttributeSet
2601    
2602     ElementTypeBinding:
2603     @Name: Param
2604     @ElementType:
2605     dis:ResourceDef
2606     @ShadowContent:
2607     @@rdf:type:
2608     DISLang:MethodParameter
2609    
2610     ElementTypeBinding:
2611     @Name: PerlDef
2612     @ElementType:
2613     dis:Def
2614     @ShadowContent:
2615     @@ContentType:
2616     lang:Perl
2617    
2618     ElementTypeBinding:
2619     @Name: disDef
2620     @ElementType:
2621     dis:Def
2622     @ShadowContent:
2623     @@ContentType:
2624     lang:dis
2625    
2626     ElementTypeBinding:
2627     @Name: InCase
2628     @ElementType:
2629     dis:ResourceDef
2630     @ShadowContent:
2631     @@rdf:type:
2632     ManakaiDOM:InCase
2633    
2634     ElementTypeBinding:
2635     @Name: nullCase
2636     @ElementType:
2637     dis:ResourceDef
2638     @ShadowContent:
2639     @@rdf:type:
2640     ManakaiDOM:InCase
2641     @@Value:
2642     @@@is-null:1
2643    
2644     ElementTypeBinding:
2645     @Name: TrueCase
2646     @ElementType:
2647     dis:ResourceDef
2648     @ShadowContent:
2649     @@rdf:type:
2650     ManakaiDOM:InCase
2651     @@Value:true
2652     @@Type:
2653     DOMMain:boolean
2654    
2655    
2656     ElementTypeBinding:
2657     @Name: FalseCase
2658     @ElementType:
2659     dis:ResourceDef
2660     @ShadowContent:
2661     @@rdf:type:
2662     ManakaiDOM:InCase
2663     @@Value:false
2664     @@Type:
2665     DOMMain:boolean
2666    
2667     ElementTypeBinding:
2668     @Name: enDesc
2669     @ElementType:
2670     dis:Description
2671     @ShadowContent:
2672     @@lang:en
2673    
2674     ElementTypeBinding:
2675     @Name: PropDef
2676     @ElementType:
2677     dis:ResourceDef
2678     @ShadowContent:
2679     @@rdf:type:
2680     rdf:Property
2681     @@AliasFor:
2682     @@@@:
2683     ::ManakaiDOM:all
2684     @@@For:
2685     !=ManakaiDOM:all
2686    
2687     ElementTypeBinding:
2688     @Name: MethodRedef
2689     @ElementType:
2690     dis:ResourceDef
2691     @ShadowContent:
2692     @@rdf:type:
2693     DISLang:Method
2694     @@ManakaiDOM:isRedefining:1
2695    
2696     ElementTypeBinding:
2697     @Name: NamedParam
2698     @ElementType:
2699     dis:ResourceDef
2700     @ShadowContent:
2701     @@rdf:type:
2702     DISLang:MethodParameter
2703     @@DISPerl:isNamedParameter:1
2704    
2705     ElementTypeBinding:
2706     @Name: NodeParam
2707     @ElementType:
2708     dis:ResourceDef
2709     @ShadowContent:
2710     @@rdf:type:
2711     DISLang:MethodParameter
2712     @@DISPerl:isNamedParameter:1
2713     @@Name: node
2714     @@Type: ManakaiDISNode
2715     @@Description:
2716     @@@lang:en
2717     @@@@:
2718     The node in which the name has occurred. It is intended
2719     to be reported when an exception had been raised.
2720     @@ResourceDef:
2721     @@@rdf:type:
2722     ManakaiDOM:InCase
2723     @@@Value:
2724     @@@@is-null:1
2725     @@@Description:
2726     @@@@lang:en
2727     @@@@@:
2728     The source of the name is not a node.
2729    
2730     ElementTypeBinding:
2731     @Name: ForParam
2732     @ElementType:
2733     dis:ResourceDef
2734     @ShadowContent:
2735     @@rdf:type:
2736     DISLang:MethodParameter
2737     @@DISPerl:isNamedParameter:1
2738     @@Name: forArg
2739     @@Type: ForURI
2740     @@Description:
2741     @@@lang:en
2742     @@@@:
2743     The <QUOTE::for> URI reference.
2744     @@ResourceDef:
2745     @@@rdf:type:
2746     ManakaiDOM:InCase
2747     @@@Value:
2748     @@@@is-null:1
2749     @@@Description:
2750     @@@@lang:en
2751     @@@@@:
2752     Equivalent to <Q::ManakaiDOM:all>, i.e. <QUOTE::for all>.
2753    
2754     ElementTypeBinding:
2755     @Name: ForpParam
2756     @ElementType:
2757     dis:ResourceDef
2758     @ShadowContent:
2759     @@rdf:type:
2760     DISLang:MethodParameter
2761     @@DISPerl:isNamedParameter:1
2762     @@Name: forpArg
2763     @@Type: ForURIList
2764     @@Description:
2765     @@@lang:en
2766     @@@@:
2767     An array reference containing additional <QUOTE::for>
2768     constraints (<QUOTE::For+> list).
2769     @@ResourceDef:
2770     @@@rdf:type:
2771     ManakaiDOM:InCase
2772     @@@Value:
2773     @@@@is-null:1
2774     @@@Description:
2775     @@@@lang:en
2776     @@@@@:
2777     Equivalent to the empty array reference.
2778    
2779     ElementTypeBinding:
2780     @Name: MediaTypeParam
2781     @ElementType:
2782     dis:ResourceDef
2783     @ShadowContent:
2784     @@rdf:type:
2785     DISLang:MethodParameter
2786     @@DISPerl:isNamedParameter:1
2787     @@Name: mediaType
2788     @@Type: MediaTypeURI
2789     @@Description:
2790     @@@lang:en
2791     @@@@:
2792     The URI reference identifying a media type.
2793     @@ResourceDef:
2794     @@@rdf:type:
2795     ManakaiDOM:InCase
2796     @@@Value:
2797     @@@@is-null:1
2798     @@@Description:
2799     @@@@lang:en
2800     @@@@@:
2801     No media type specified.
2802    
2803     ElementTypeBinding:
2804     @Name: MediaTypeDefaultParam
2805     @ElementType:
2806     dis:ResourceDef
2807     @ShadowContent:
2808     @@rdf:type:
2809     DISLang:MethodParameter
2810     @@DISPerl:isNamedParameter:1
2811     @@Name: defaultMediaType
2812     @@Type: MediaTypeURI
2813     @@Description:
2814     @@@lang:en
2815     @@@@:
2816     The default media type, i.e. the type used when no explicit
2817     specification is not found in the source tree.
2818     @@ResourceDef:
2819     @@@rdf:type:
2820     ManakaiDOM:InCase
2821     @@@Value:
2822     @@@@is-null:1
2823     @@@Description:
2824     @@@@lang:en
2825     @@@@@:
2826     Defaulted to <Q::DOMMain:any>.
2827    
2828     ElementTypeBinding:
2829     @Name: RaiseException
2830     @ElementType:
2831     ManakaiDOM:raises
2832    
2833     ElementTypeBinding:
2834     @Name: UndeclaredPrefixException
2835     @ElementType:
2836     ManakaiDOM:raises
2837     @ShadowContent:
2838     @@@: UNDECLARED_NS_PREFIX_ERR
2839     @@Description:
2840     @@@lang:en
2841     @@@@:
2842     The implementation has encounted an undeclared namespace prefix.
2843    
2844     ElementTypeBinding:
2845     @Name: NoDBException
2846     @ElementType:
2847     ManakaiDOM:raises
2848     @ShadowContent:
2849     @@@: NO_DB_ASSOCIATED_ERR
2850     @@Description:
2851     @@@lang:en
2852     @@@@:
2853     No <QUOTE::dis> database is associated to this document.
2854    
2855     ElementTypeBinding:
2856     @Name: XConstGroupDef
2857     @ElementType:
2858     dis:ResourceDef
2859     @ShadowContent:
2860     @@rdf:type:
2861     ManakaiDOM:ConstGroup
2862     @@Type:
2863     DOMMain:unsigned-short::ManakaiDOM:all
2864     @@rdfs:subClassOf:
2865     DOMMain:unsigned-short::ManakaiDOM:all
2866    
2867     ElementTypeBinding:
2868     @Name: XConstDef
2869     @ElementType:
2870     dis:ResourceDef
2871     @ShadowContent:
2872     @@rdf:type:
2873     ManakaiDOM:Const
2874    
2875     ElementTypeBinding:
2876     @Name: XSubTypeDef
2877     @ElementType:
2878     dis:ResourceDef
2879     @ShadowContent:
2880     @@rdf:type:
2881     ManakaiDOM:ExceptionOrWarningSubType
2882    
2883     ElementTypeBinding:
2884     @Name: XParam
2885     @ElementType:
2886     ManakaiDOM:exceptionOrWarningParameter
2887    
2888     ElementTypeBinding:
2889     @Name: XParamDef
2890     @ElementType:
2891     dis:ResourceDef
2892     @ShadowContent:
2893     @@rdf:type:
2894     DOMMain:XWParameter
2895     @@AliasFor:
2896     @@@For:
2897     !=ManakaiDOM:all
2898     @@@@:
2899     ::ManakaiDOM:all
2900    
2901     ElementTypeBinding:
2902     @Name: enMufDef
2903     @ElementType:
2904     dis:Def
2905     @ShadowContent:
2906     @@ContentType:
2907     lang:muf
2908     @@lang:en
2909    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24