/[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.6 - (hide annotations) (download)
Mon Feb 28 04:32:40 2005 UTC (20 years, 4 months ago) by wakaba
Branch: MAIN
Changes since 1.5: +166 -15 lines
lib/Message/Util/DIS.dis: Resource aliasing implemented

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24