/[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.59 - (hide annotations) (download)
Thu Sep 29 15:18:09 2005 UTC (19 years, 10 months ago) by wakaba
Branch: MAIN
Changes since 1.58: +58 -29 lines
++ manakai/lib/Message/Util/ChangeLog	29 Sep 2005 14:43:39 -0000
2005-09-29  Wakaba  <wakaba@suika.fam.cx>

	* DIS.dis: Shares local name, namespace URI and for URI
	if possible.

	* PerlCode.dis (stringify): Sorts "require" statements by module
	name.

++ manakai/lib/Message/Util/DIS/ChangeLog	29 Sep 2005 14:44:23 -0000
2005-09-29  Wakaba  <wakaba@suika.fam.cx>

	* DNLite.dis: Shares element type expanded URI where possible.

	* Value.dis: Shares data type URI where possible.

++ manakai/lib/manakai/ChangeLog	29 Sep 2005 14:45:10 -0000
2005-09-29  Wakaba  <wakaba@suika.fam.cx>

	* DISPerl.dis (DISPerl:HashStringRef, DISPerl:StringRef): New.

1 wakaba 1.1 Module:
2 wakaba 1.51 @QName: Util|DIS
3 wakaba 1.1 @FullName:
4     @@lang: en
5     @@@:
6     <QUOTE::DIS> Object Model
7     @Namespace:
8     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
9    
10     @Description:
11     @@lang:en
12     @@@:
13 wakaba 1.14 This module provides an object model for <QUOTE::dis> document format.
14 wakaba 1.1
15 wakaba 1.53 @DISCore:author: DISCore|Wakaba
16 wakaba 1.1 @License:
17     @@@:
18     license:Perl+MPL
19     @@Original:
20     @@@FullName:
21 wakaba 1.19 manakai <CODE::lib/manakai/dis.pl> and <CODE::bin/cdis2pm.pl>
22 wakaba 1.1 @@@Year:2004
23 wakaba 1.53 @@@DISCore:author: DISCore|Wakaba
24 wakaba 1.1 @Date:
25     @@@:
26 wakaba 1.59 $Date: 2005/09/28 09:49:10 $
27 wakaba 1.1 @@ContentType:
28     dis:Date.RCS
29    
30     @Require:
31     @@Module:
32 wakaba 1.51 @@@QName: Markup|SuikaWikiConfig21
33     @@@WithFor: swcfg21|ForLatest
34 wakaba 1.3 @@Module:
35 wakaba 1.51 @@@QName: Util|DIS
36     @@@WithFor: DIS|ForLatest
37 wakaba 1.12 @@Module:
38 wakaba 1.51 @@@QName: Util|DIS
39     @@@WithFor: DIS|ForEmpty
40 wakaba 1.47 @@Module:
41 wakaba 1.51 @@@QName: Util|PerlCode
42     @@@WithFor: ManakaiDOM|Perl
43 wakaba 1.47 @@Module:
44     @@@QName: MDOM|DOMFeature
45     @@@WithFor: ManakaiDOM|all
46 wakaba 1.48 @@Module:
47     @@@QName: DIS|Perl
48     @@@WithFor: DIS|ForLatest
49     @@Module:
50     @@@QName: DIS|Value
51     @@@WithFor: DIS|ForLatest
52 wakaba 1.3
53 wakaba 1.51 @DefaultFor: DIS|ForLatest
54 wakaba 1.1
55     Namespace:
56     @DIS:
57     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
58     @dis:
59     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
60     @dis2pm:
61     http://suika.fam.cx/~wakaba/archive/2004/11/8/dis2pm#
62 wakaba 1.5 @DISlib:
63     http://suika.fam.cx/~wakaba/archive/2004/dis/
64 wakaba 1.13 @disPerl:
65     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--Perl--
66 wakaba 1.3 @DOMCore:
67     http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
68 wakaba 1.30 @DOMException:
69     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
70 wakaba 1.3 @DOMLS:
71     http://suika.fam.cx/~wakaba/archive/2004/dom/ls#
72     @DOMMain:
73     http://suika.fam.cx/~wakaba/archive/2004/dom/main#
74 wakaba 1.46 @DOMMetaImpl:
75     http://suika.fam.cx/~wakaba/archive/2004/dom/meta#
76 wakaba 1.48 @dp:
77     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Perl/
78     @dv:
79     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Value/
80 wakaba 1.52 @dx:
81     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
82 wakaba 1.47 @ecore:
83     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/
84 wakaba 1.3 @infoset:
85     http://www.w3.org/2001/04/infoset#
86 wakaba 1.47 @kwd:
87     http://suika.fam.cx/~wakaba/archive/2005/rfc2119/
88 wakaba 1.1 @lang:
89     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
90     @license:
91     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
92     @ManakaiDOM:
93     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
94 wakaba 1.5 @Markup:
95     http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup#
96 wakaba 1.47 @MDOM:
97     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.
98 wakaba 1.3 @MDOMX:
99     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
100 wakaba 1.53 @mn:
101     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode#
102 wakaba 1.43 @null:
103     http://suika.fam.cx/~wakaba/-temp/2003/09/27/null
104 wakaba 1.1 @owl:
105     http://www.w3.org/2002/07/owl#
106     @Perl:
107     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#Perl--
108 wakaba 1.49 @pl:
109     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#Perl--
110 wakaba 1.1 @rdf:
111     http://www.w3.org/1999/02/22-rdf-syntax-ns#
112     @rdfs:
113     http://www.w3.org/2000/01/rdf-schema#
114 wakaba 1.32 @s:
115     http://suika.fam.cx/~wakaba/archive/2004/dis/Markup#
116 wakaba 1.3 @swcfg21:
117     http://suika.fam.cx/~wakaba/archive/2005/swcfg21#
118 wakaba 1.1 @Util:
119     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/
120    
121     ## -- "For" definitions
122    
123     ForDef:
124 wakaba 1.51 @QName: DIS|ForEmpty
125     @enDesc:
126     For any version
127     @ISA: ManakaiDOM|Perl
128    
129     ForDef:
130 wakaba 1.1 @QName:
131     DIS:ForLatest
132     @Description:
133     @@lang:en
134     @@@:
135     For latest version of the <Module::Util:DIS> module implementation
136 wakaba 1.47 @ISA: DIS|ForEmpty
137 wakaba 1.1
138 wakaba 1.51 ## -- Module sets
139 wakaba 1.38
140 wakaba 1.51 ResourceDef:
141     @QName: Util|
142     @For: DIS|ForEmpty
143     @rdf:type: dis|ModuleGroup
144     @FullName:
145     @@lang:en
146     @@@:
147     Manakai support modules
148     @DISPerl:packageName:
149     Message::Util::
150     @DISPerl:interfacePackageName:
151     @@@:
152     Message::Util::IF::
153     @@For: DIS|ForEmpty !DIS|ForLatest
154     @DISPerl:interfacePackageName:
155     @@@:
156     Message::Util::IFLatest::
157     @@For: DIS|ForLatest
158     @ImplNote:
159     @@lang:en
160     @@@:
161     Resources <Q::Util|> for <Q::ManakaiDOM|all> and for <Q::ManakaiDOM|Perl>
162     is defined in module <Module::Util|ManakaiNode>.
163 wakaba 1.38
164     ResourceDef:
165     @QName:
166     DIS:
167     @rdf:type:
168     dis:ModuleGroup
169     @FullName:
170     @@lang:en
171     @@@:
172     <QUOTE::dis> modules
173 wakaba 1.51 @DISPerl:packageName:
174     Message::Util::DIS::
175     @DISPerl:interfacePackageName:
176 wakaba 1.48 Message::Util::IF::
177 wakaba 1.38
178 wakaba 1.1 ## -- Features
179    
180     ElementTypeBinding:
181     @Name: FeatureDef
182     @ElementType:
183     dis:ResourceDef
184     @ShadowContent:
185 wakaba 1.52 @@rdf:type: DOMFeature|Feature
186 wakaba 1.24 @@ForCheck:
187 wakaba 1.49 =ManakaiDOM:all
188 wakaba 1.1
189     ElementTypeBinding:
190     @Name: FeatureVerDef
191     @ElementType:
192     dis:ResourceDef
193     @ShadowContent:
194 wakaba 1.52 @@rdf:type: DOMFeature|Feature
195 wakaba 1.1
196     ElementTypeBinding:
197     @Name: featureQName
198     @ElementType:
199 wakaba 1.52 DOMFeature:name
200 wakaba 1.1 @ShadowContent:
201 wakaba 1.52 @@ContentType: DISCore|QName
202 wakaba 1.1
203     FeatureDef:
204     @QName: Core
205     @FeatureVerDef:
206     @@QName: CoreFeature10
207     @@Version: 1.0
208 wakaba 1.24 @@DOMMetaImpl:instanceFeatureOf: Core
209 wakaba 1.1 @@FullName:
210     @@@lang:en
211     @@@@:
212     The <QUOTE::dis> object model, version 1.0
213     @@Description:
214     @@@lang:en
215     @@@@:
216     The <QUOTE::dis> object model, version 1.0.
217     @@DOMMain:requireFeature:
218     swcfg21:CoreFeature21
219    
220 wakaba 1.38 ## -- Roles
221    
222     ElementTypeBinding:
223     @Name: RoleDef
224     @ElementType:
225     dis:ResourceDef
226     @ShadowContent:
227     @@rdf:type:
228     DISLang:Role
229     @@ForCheck:
230     =ManakaiDOM:all
231    
232     RoleDef:
233     @QName: ModuleRole
234     @enDesc:
235     Any class playing this role may be returned by
236     <M::ManakaiDISModuleDefinition.getFeature> method with
237     appropriate feature parameters.
238    
239     RoleDef:
240     @QName: ForRole
241     @enDesc:
242     Any class playing this role may be returned by
243     <M::ManakaiDISForDefinition.getFeature> method with
244     appropriate feature parameters.
245    
246     RoleDef:
247     @QName: ResourceRole
248     @enDesc:
249     Any class playing this role may be returned by
250     <M::ManakaiDISResourceDefinition.getFeature> method with
251     appropriate feature parameters.
252    
253     RoleDef:
254     @QName: ElementRole
255     @enDesc:
256     Any class playing this role may be returned by
257     <M::ManakaiDISElement.getFeature> method with
258     appropriate feature parameters.
259    
260     RoleDef:
261     @QName: DatabaseRole
262     @enDesc:
263     Any class playing this role may be returned by
264     <M::ManakaiDISDatabase.getFeature> method with
265     appropriate feature parameters.
266    
267 wakaba 1.47
268     ElementTypeBinding:
269     @Name: IFQName
270     @ElementType:
271     dis:QName
272     @ShadowContent:
273     @@ForCheck: ManakaiDOM|ForIF
274    
275     ElementTypeBinding:
276     @Name: ClsQName
277     @ElementType:
278     dis:QName
279     @ShadowContent:
280     @@ForCheck: ManakaiDOM|ForClass
281    
282     ElementTypeBinding:
283     @Name: IFISA
284     @ElementType:
285     dis:ISA
286     @ShadowContent:
287     @@ForCheck: ManakaiDOM|ForIF
288    
289     ElementTypeBinding:
290     @Name: ClsISA
291     @ElementType:
292     dis:ISA
293     @ShadowContent:
294     @@ForCheck: ManakaiDOM|ForClass
295    
296     ElementTypeBinding:
297     @Name: IFClsDef
298     @ElementType:
299     dis:ResourceDef
300     @ShadowContent:
301     @@rdf:type:
302     @@@@: dis|MultipleResource
303     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
304     @@resourceFor: ManakaiDOM|ForIF
305     @@resourceFor:
306     @@@@: ManakaiDOM|ForClass
307     @@@ForCheck: ForEmpty !=ForEmpty
308     @@For: ForLatest
309     @@For: =ForEmpty
310    
311     @@rdf:type:
312     @@@@: ManakaiDOM|IF
313     @@@ForCheck: ManakaiDOM|ForIF
314    
315     @@rdf:type:
316     @@@@: ManakaiDOM|Class
317     @@@ForCheck: ManakaiDOM|ForClass
318     @@Implement:
319     @@@@: ||ForEmpty||ManakaiDOM|ForIF
320     @@@ContentType: DISCore|TFPQNames
321     @@@ForCheck: ManakaiDOM|ForClass ForEmpty
322     @@Implement:
323     @@@@: ||ForLatest||ManakaiDOM|ForIF
324     @@@ContentType: DISCore|TFPQNames
325     @@@ForCheck: ManakaiDOM|ForClass ForLatest
326    
327     @@DOMMain:implementFeature:
328     @@@@: CoreFeature10
329     @@@For: ForLatest
330    
331     ElementTypeBinding:
332     @Name: ClsDef
333     @ElementType:
334     dis:ResourceDef
335     @ShadowContent:
336     @@rdf:type:
337     @@@@: dis|MultipleResource
338     @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
339    
340     @@resourceFor:
341     @@@@: ManakaiDOM|ForClass
342     @@@ForCheck: ForEmpty !=ForEmpty
343     @@For: ForLatest
344    
345     @@rdf:type:
346     @@@@: ManakaiDOM|Class
347     @@@ForCheck: ManakaiDOM|ForClass
348    
349     @@DOMMain:implementFeature:
350     @@@@: CoreFeature10
351     @@@For: ForLatest
352    
353     ElementTypeBinding:
354     @Name: clsActualType
355     @ElementType:
356     dis:actualType
357     @ShadowContent:
358     @@ForCheck: ManakaiDOM|ForClass
359    
360 wakaba 1.1 ## -- SuikaWikiConfig/2.1 extended classes
361    
362 wakaba 1.47 IFClsDef:
363     @IFQName: DISImplementation
364 wakaba 1.1 @ClsQName: ManakaiDISImplementation
365 wakaba 1.47
366 wakaba 1.1 @ClsISA:
367 wakaba 1.3 swcfg21:ManakaiSWCFGImplementation::swcfg21:ForLatest
368 wakaba 1.48 @ClsISA: dp|ManakaiDISImplementationPerl
369     @ClsISA: dv|ManakaiDISImplementationValue
370    
371 wakaba 1.1 @Description:
372     @@lang:en
373     @@@:
374     A <QUOTE::dis> implementation object.
375    
376     @Method:
377     @@Name: createDISDocument
378     @@Description:
379     @@@lang:en
380     @@@@:
381 wakaba 1.47 Creates an empty <IF::DISDocument> node.
382 wakaba 1.1 @@Return:
383 wakaba 1.47 @@@Type: DISDocument
384     @@@clsActualType: ManakaiDISDocument
385 wakaba 1.1 @@@Description:
386     @@@@lang:en
387     @@@@@:
388     The newly created <QUOTE::dis> document object.
389     @@@PerlDef:
390 wakaba 1.29 $r = bless $self-><M::swcfg21:SWCFGImplementation::swcfg21:ForLatest
391     .createSWCFGDocument>,
392     <ClassName::ManakaiDISDocument>;
393 wakaba 1.3 $r-><AS::swcfg21:SWCFGDocument::swcfg21:ForLatest
394     .defaultElementTypeNamespaceURI>
395 wakaba 1.1 (<Q::dis:>);
396    
397     @Method:
398 wakaba 1.2 @@Name: createDISParser
399     @@Description:
400     @@@lang:en
401     @@@@:
402 wakaba 1.47 Creates a <IF::DISParser> object.
403 wakaba 1.2 @@Return:
404 wakaba 1.47 @@@Type: DISParser
405     @@@clsActualType: ManakaiDISParser
406 wakaba 1.2 @@@Description:
407     @@@@lang:en
408     @@@@@:
409 wakaba 1.1 A newly created <QUOTE::dis> parser.
410 wakaba 1.2 @@@PerlDef:
411 wakaba 1.3 $r = bless $self-><M::swcfg21:SWCFGImplementation::swcfg21:ForLatest
412     .createSWCFGParser>,
413 wakaba 1.1 <ClassName::ManakaiDISParser>;
414    
415     @Method:
416 wakaba 1.2 @@Name: createDISDatabase
417 wakaba 1.1 @@Description:
418     @@@lang:en
419     @@@@:
420 wakaba 1.2 Creates a new <QUOTE::dis> database.
421 wakaba 1.1 @@Return:
422 wakaba 1.47 @@@Type: DISDatabase
423     @@@clsActualType: ManakaiDISDatabase
424 wakaba 1.4 @@@Description:
425     @@@@lang:en
426     @@@@@:
427 wakaba 1.2 A newly created <QUOTE::dis> parser.
428 wakaba 1.4 @@@PerlDef:
429 wakaba 1.2 $r = bless {
430     forDef => {
431 wakaba 1.5 <Q::ManakaiDOM:all> => bless ({
432 wakaba 1.2 uri => <Q::ManakaiDOM:all>,
433     isa => {<Q::ManakaiDOM:all> => 1},
434     revISA => {},
435 wakaba 1.5 }, <ClassName::ManakaiDISForDefinition>),
436 wakaba 1.2 },
437     resDef => {},
438 wakaba 1.9 modDef => {},
439     seq => 0,
440 wakaba 1.3 }, <ClassName::ManakaiDISDatabase>;
441 wakaba 1.48 $r->{forDef}->{<Q::ManakaiDOM:all>}->{db} = $r;
442 wakaba 1.3
443     @Method:
444     @@Name: tfurisToURI
445     @@Description:
446     @@@lang:en
447     @@@@:
448     Converts a pair of name URI reference and <QUOTE::for> URI reference
449 wakaba 1.47 into a <Q::dis:TFQNames>-expanded URI reference.
450 wakaba 1.3 @@Param:
451     @@@Name: typeURI
452     @@@Type: NameURI
453     @@@Description:
454     @@@@lang:en
455     @@@@@:
456     A URI reference to identify a resource.
457 wakaba 1.49 @@@nullCase:
458 wakaba 1.3 @@@@Description:
459     @@@@@lang:en
460     @@@@@@:
461     Equivalent to <Q::DOMMain:any> (for historical reason).
462     @@Param:
463     @@@Name: forURI
464     @@@Type: ForURI
465     @@@Description:
466     @@@@lang:en
467     @@@@@:
468     A <QUOTE::for> URI reference.
469 wakaba 1.49 @@@nullCase:
470 wakaba 1.3 @@@@Description:
471     @@@@@lang:en
472     @@@@@@:
473     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
474     @@Return:
475     @@@Type:
476     DISCore:TFURI::ManakaiDOM:all
477     @@@Description:
478     @@@@lang:en
479     @@@@@:
480 wakaba 1.47 The <Q::dis:TFQNames>-expanded URI references.
481 wakaba 1.3 @@@PerlDef:
482     $typeURI = <Q::DOMMain:any> unless defined $typeURI;
483     $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
484 wakaba 1.4 __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__;
485    
486     @ResourceDef:
487 wakaba 1.47 @@ForCheck: ManakaiDOM|ForClass
488 wakaba 1.4 @@QName: tfurisToURI
489     @@rdf:type:
490     dis2pm:BlockCode
491     @@enDesc:
492     Converts a pair of name URI reference and <QUOTE::for> URI reference
493 wakaba 1.47 into a <Q::dis:TFQNames>-expanded URI reference.
494 wakaba 1.4 @@PerlDef:
495     if ($furi eq <Q::ManakaiDOM:all>) {
496     $uri = $turi;
497 wakaba 1.3 } else {
498     ## NOTE: [RFC 3986]
499     ## fragment := *(pchar / "/" / "?")
500     ## pchar := unreserved / pct-encoded / sub-delims / [:@]
501     ## unreserved := ALPHA / DIGIT / [._~-]
502     ## sub-delims := [!$&'()*+,;=]
503     ## NOTE: [XPointer Framework]
504     ## SchemeData := *EscapedData
505     ## EscapedData := NormalChar / "^(" / "^)" / "^^"
506     ## / "(" SchemeData ")"
507     ## NormalChar := UnicodeChar - [()^]
508 wakaba 1.5 my $__turi = $turi;
509     my $__furi = $furi;
510     for my $__uri ($__turi, $__furi) {
511 wakaba 1.58 $__uri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge;
512 wakaba 1.3 }
513 wakaba 1.58 $uri = qq<tag:suika.fam.cx,2005-09:$__turi+$__furi>;
514 wakaba 1.3 }
515 wakaba 1.2
516 wakaba 1.5 @ResourceDef:
517 wakaba 1.6 @@QName: tfpurisToURI
518     @@rdf:type:
519     dis2pm:BlockCode
520     @@enDesc:
521     Converts a set of name URI reference and <QUOTE::for> URI reference
522     and <QUOTE::for+> URI references into a URi reference.
523 wakaba 1.47 @@ForCheck: ManakaiDOM|ForClass
524 wakaba 1.6 @@PerlDef:
525     if ($furi eq <Q::ManakaiDOM:all> and @{$forp} == 0) {
526     $uri = $turi;
527     } elsif (@{$forp}) {
528     my $__turi = $turi;
529     my $__furi = $furi;
530     for my $__uri ($__turi, $__furi) {
531 wakaba 1.58 $__uri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge;
532 wakaba 1.6 }
533     my @__fp;
534     for my $__uri (@{$forp}) {
535     my $__fpuri = $__uri;
536 wakaba 1.58 $__fpuri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])}
537 wakaba 1.6 {sprintf '%%%02X', ord $1}ge;
538     push @__fp, $__fpuri;
539     }
540 wakaba 1.58 $uri = qq<tag:suika.fam.cx,2005-09:$__turi+$__furi+>.join ('+', @__fp);
541 wakaba 1.6 } else {
542     my $__turi = $turi;
543     my $__furi = $furi;
544     for my $__uri ($__turi, $__furi) {
545 wakaba 1.58 $__uri =~ s{([^0-9A-Za-z!\$'(),*:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge;
546 wakaba 1.6 }
547 wakaba 1.58 $uri = qq<tag:suika.fam.cx,2005-09:$__turi+$__furi>;
548 wakaba 1.6 }
549    
550 wakaba 1.43 @ImplNote:
551     @@lang:en
552     @@@:
553     {TODO:: IRI support.
554     }
555    
556 wakaba 1.6 @ResourceDef:
557 wakaba 1.5 @@QName: getChildResourceURI
558     @@rdf:type:
559     dis2pm:BlockCode
560     @@enDesc:
561     Gets an anonymous URI reference of a child resource of another
562     resource.
563 wakaba 1.47 @@ForCheck: ManakaiDOM|ForClass
564 wakaba 1.5 @@PerlDef:
565     my $__parent = $parentURI;
566     my $__ln = $localName;
567     for my $__uri ($__parent, $__ln) {
568 wakaba 1.58 $__uri =~ s{([^0-9A-Za-z!\$'(),*:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge;
569 wakaba 1.5 }
570 wakaba 1.58 $result = qq<data:suika.fam.cx,2005-09::$__parent+$__ln>;
571 wakaba 1.5
572 wakaba 1.8 @IntMethod:
573     @@Name: camelCaseToUnderscoreName
574     @@enDesc:
575     Converts a camelCase name to a underscored_name.
576     @@ManakaiDOM:isStatic:1
577 wakaba 1.47 @@ForCheck: ManakaiDOM|ForClass
578 wakaba 1.8 @@Param:
579     @@@Name: camelName
580     @@@Type:
581 wakaba 1.18 DISLang:String::ManakaiDOM:all
582 wakaba 1.8 @@@enDesc:
583     The source name.
584     @@Return:
585     @@@Type:
586 wakaba 1.18 DISLang:String::ManakaiDOM:all
587 wakaba 1.8 @@@enDesc:
588     The result name.
589     @@@PerlDef:
590     $r = $camelName;
591     $r =~ s/^([A-Z0-9]+)$/lc $1/ge;
592     $r =~ s/([A-Z][A-Z0-9]*)$/"_".lc $1/ge;
593     $r =~ s/([A-Z0-9])([A-Z0-9]*)([A-Z0-9])/$1.lc ($2)."_".lc $3/ge;
594     $r =~ s/([A-Z])/"_".lc $1/ge;
595     $r =~ s/(?=[0-9](?!$))/_/g;
596 wakaba 1.9
597 wakaba 1.24 @DOMMetaImpl:provideFeature: CoreFeature10
598 wakaba 1.1 ##DISImplementation
599    
600 wakaba 1.47 IFClsDef:
601     @IFQName: DISParser
602 wakaba 1.1 @ClsQName: ManakaiDISParser
603 wakaba 1.47
604     @IFISA: swcfg21|SWCFGParser||swcfg21|ForLatest
605 wakaba 1.1 @ClsISA:
606 wakaba 1.3 swcfg21:ManakaiSWCFGParser::swcfg21:ForLatest
607 wakaba 1.47
608 wakaba 1.1 @Description:
609     @@lang:en
610     @@@:
611     A SuikaWikiConfig/2.1 parser that returns <QUOTE::dis> object.
612     @Method:
613 wakaba 1.3 @@Name: parse
614     @@Description:
615     @@@lang:en
616     @@@@:
617 wakaba 1.1 Parses a <QUOTE::dis> document and returns it as an object tree.
618 wakaba 1.3 @@Param:
619     @@@Name: input
620     @@@Type:
621 wakaba 1.37 DOMLS:LSInput::ManakaiDOM:ManakaiDOMLatest
622 wakaba 1.3 @@@Description:
623     @@@@lang:en
624     @@@@@:
625 wakaba 1.1 The input source.
626 wakaba 1.3 @@Return:
627 wakaba 1.47 @@@Type: DISDocument
628     @@@clsActualType: ManakaiDISDocument
629 wakaba 1.3 @@@Description:
630     @@@@lang:en
631     @@@@@:
632 wakaba 1.1 The <QUOTE::dis> document object created from the <P::input>.
633     @@@RaiseException:
634     @@@@@:
635 wakaba 1.47 swcfg21:SWCFG_PARSE_ERR::swcfg21:ForLatest
636 wakaba 1.1 @@@@Description:
637     @@@@@lang:en
638     @@@@@@:
639     The <IF::swcfg21:SWCFGParser> was unable to load the SuikaWikiConfig
640     document.
641     @@@PerlDef:
642     __DEEP{
643 wakaba 1.28 $r = $self->SUPER::parse ($input)
644     ## NOTE: Method name directly written
645     #< M::swcfg21:ManakaiSWCFGParser
646     # ::swcfg21:ForLatest.parse> ($input)
647 wakaba 1.1 }__;
648     if (defined $r) {
649     $r = bless $r, <ClassName::ManakaiDISDocument>;
650 wakaba 1.4 $r-><AS::swcfg21:SWCFGDocument::swcfg21:ForLatest
651     .defaultElementTypeNamespaceURI>
652     (<Q::dis:>);
653 wakaba 1.1 }
654 wakaba 1.52
655     @IntMethod:
656     @@ForCheck: ManakaiDOM|ForClass
657     @@Operator:
658     @@@@: DISPerl|NewMethod
659     @@@ContentType: DISCore|QName
660     @@ForCheck: ManakaiDOM|ForClass
661     @@enDesc:
662     Creates a new instance of the <IF::DISParser> interface
663     and returns it.
664    
665     {NOTE:: This method is compatible with the role <Q::DOMLS:ParserRole>
666     so that this class is accessible via the
667     <M::DOMLS|DOMImplementationLSExtended.createMLSParser>
668     method.
669     }
670     @@Param:
671     @@@Name: impl
672     @@@Type: DOMFeature|MinimumImplementation||ManakaiDOM|ManakaiDOMLatest
673     @@@enDesc:
674     An implementation object. The <M::DOMFeature|GetFeature.getFeature>
675     method with parameter values <Feature::DIS|Core> and
676     <FeatureVer::1.0> respectively <kwd:MUST> return
677     an object implementing the <IF::DISImplementation> interface.
678     @@Param:
679     @@@Name: features
680     @@@Type: DISLang|String||ManakaiDOM|all
681     @@@dis:actualType: DOMFeature|FeaturesString||ManakaiDOM|ManakaiDOMLatest
682     @@@enDesc:
683     A list of requested features. In the current implementation
684     this parameter is ignored.
685     @@Return:
686     @@@Type: DOMMain|Object||ManakaiDOM|all
687     @@@actualType: ManakaiDISParser
688     @@@enDesc: The newly created parser object.
689     @@@PerlDef:
690     __DEEP{
691     $r = $self->SUPER::new
692     ($impl-><M::DOMFeature|GetFeature
693     ||ManakaiDOM|ManakaiDOMLatest.getFeature>
694     (<Q::swcfg21:Core> => '2.1'),
695     $features);
696     }__;
697 wakaba 1.1 ##DISParser
698    
699 wakaba 1.47 IFClsDef:
700     @IFQName: DISNode
701 wakaba 1.1 @ClsQName: ManakaiDISNode
702 wakaba 1.47
703 wakaba 1.1 @Description:
704     @@lang:en
705     @@@:
706     <QUOTE::dis> node objects.
707 wakaba 1.7 @ImplNote:
708     @@lang:en
709     @@@:
710     This class does not inherit
711     <Class::swcfg21:ManakaiSWCFGNode::swcfg21:ForLatest>, since
712     inheriting classes such as <Class::ManakaiDISElement> indirectly
713     inherit it.
714 wakaba 1.1
715     @MethodRedef:
716 wakaba 1.47 @@ForCheck: ManakaiDOM|ForClass
717 wakaba 1.1 @@Name:lookupNamespacePrefix
718     @@Description:
719     @@@lang:en
720     @@@@:
721     Looks up the namespace prefix associated to the given
722     namespace URI. The default namespaces are ignored.
723     @@Param:
724     @@@Name:namespaceURI
725 wakaba 1.3 @@@Type: AnyURI
726 wakaba 1.1 @@@Description:
727     @@@@lang:en
728     @@@@@:
729     The namespace URI to look for.
730 wakaba 1.49 @@@nullCase:
731 wakaba 1.1 @@@@Description:
732     @@@@@lang:en
733     @@@@@@:
734     The <DOM::null> namespace.
735     @@NamedParam:
736     @@@Name: makeNewBinding
737     @@@Type:
738 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
739 wakaba 1.1 @@@Description:
740     @@@@lang:en
741     @@@@@:
742     Whether a new namespace prefix should be bound when
743     no namespace URI has been associated yet.
744 wakaba 1.49 @@@TrueCase:
745 wakaba 1.1 @@@@Description:
746     @@@@@lang:en
747     @@@@@@:
748     New binding is made if no prefix associated.
749 wakaba 1.49 @@@FalseCase:
750 wakaba 1.1 @@@@Description:
751     @@@@@lang:en
752     @@@@@@:
753     Simply returns the <DOM::null> if no prefix associated.
754     @@Return:
755 wakaba 1.47 @@@Type: swcfg21|SWCFGString||swcfg21|ForLatest
756     @@@actualType:
757 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
758 wakaba 1.1 @@@Description:
759     @@@@lang:en
760     @@@@@:
761     An associated namespace prefix. If more than one prefix
762     are associated to the namespace URI, the returned prefix
763     is implementation dependent.
764 wakaba 1.49 @@@nullCase:
765 wakaba 1.1 @@@@Description:
766     @@@@@lang:en
767     @@@@@@:
768     No associated namespace prefix found.
769     @@@PerlDef:
770     $r = null;
771 wakaba 1.3 my $od = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
772     .ownerDocument> || $self;
773 wakaba 1.53 my $binds = $od->{<H::mn:node>}->{<H::swcfg21:nsBinding>};
774 wakaba 1.1 if (defined $namespaceURI) {
775     FIND: {
776     for my $prefix (keys %$binds) {
777     if (defined $binds->{$prefix} and
778     $binds->{$prefix} eq $namespaceURI) {
779     $r = $prefix;
780     last FIND;
781     }
782     }
783 wakaba 1.7
784     ## From module list
785     try {
786     my $db = $self-><AG::ManakaiDISNode.ownerDISDocument>
787     -><AG::ManakaiDISDocument.disDatabase>;
788     for my $mod_uri (keys %{$db->{modDef}}) {
789     my $mod = $db-><M::ManakaiDISDatabase.getModule> ($mod_uri);
790 wakaba 1.48 my $mod_ln = $mod-><AG::DISAnyResource.localName>;
791 wakaba 1.7 next if exists $binds->{$mod_ln};
792 wakaba 1.57 my $ns_uri = $mod-><AG::DIS|DISModule.targetNamespaceURI>;
793     $ns_uri = '' unless defined $ns_uri;
794 wakaba 1.7 if ($ns_uri eq $namespaceURI) {
795     $r = $mod_ln;
796     last FIND;
797     }
798     }
799 wakaba 1.48 } catch <IF::DISException> with {
800 wakaba 1.7 my $err = shift;
801     $err->throw
802 wakaba 1.47 unless $err->{<Q::MDOMX:subtype>} eq <Q::NO_ASSOCIATED_DB_ERR>;
803 wakaba 1.7 };
804    
805 wakaba 1.1 last FIND unless $makeNewBinding;
806     ## Not found
807     if ($namespaceURI =~ /(\w+)$/) {
808     my $prefix = $1;
809     unless (exists $binds->{$prefix}) {
810     $binds->{$prefix} = $namespaceURI;
811     $r = $prefix;
812     last FIND;
813     }
814     }
815     my $i = 1;
816     {
817     unless (exists $binds->{'ns'.$i}) {
818     $binds->{$r = 'ns'.$i} = $namespaceURI;
819     last FIND;
820     }
821     $i++;
822     redo;
823     }
824     } # FIND
825     } else { ## Null namespace
826     FIND: {
827     if (exists $binds->{'nu'.'ll'} and not defined $binds->{'nu'.'ll'}) {
828     $r = 'nu'.'ll';
829     last FIND;
830     }
831     for my $prefix (keys %$binds) {
832     if (not defined $prefix) {
833     $r = $prefix;
834     last FIND;
835     }
836     }
837     last FIND unless $makeNewBinding;
838     ## Not found
839     my $i = '';
840     {
841     unless (exists $binds->{'nu'.'ll'.$i}) {
842     $binds->{$r = 'nu'.'ll'.$i} = null;
843     last FIND;
844     }
845     $i++;
846     redo;
847     }
848     }
849     }
850    
851     @MethodRedef:
852 wakaba 1.47 @@ForCheck: ManakaiDOM|ForClass
853 wakaba 1.1 @@Name:lookupNamespaceURI
854     @@Description:
855     @@@lang:en
856     @@@@:
857     Looks up the namespace URI associated to the given prefix.
858     @@Param:
859     @@@Name:prefix
860     @@@Type:
861 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
862 wakaba 1.1 @@@Description:
863     @@@@lang:en
864     @@@@@:
865     The namespace URI to look for.
866     @@NamedParam:
867     @@@Name: makeNewBinding
868     @@@Type:
869 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
870 wakaba 1.1 @@@Description:
871     @@@@lang:en
872     @@@@@:
873     Whether a new binding should be created if no namespace URI
874     is associated with the <P::prefix> or not.
875 wakaba 1.49 @@@TrueCase:
876 wakaba 1.1 @@@@Description:
877     @@@@@lang:en
878     @@@@@@:
879     A new binding to the temporary namespace URI
880     exactly same as <P::prefix> is created
881     if no binding found.
882 wakaba 1.49 @@@FalseCase:
883 wakaba 1.1 @@@@Description:
884     @@@@@lang:en
885     @@@@@@:
886     No new binding is created if no binding found. Note that
887     even if no association newly created, this method
888     returns the <DOM::null> value.
889 wakaba 1.12 @@NamedParam:
890     @@@Name: raisePrefixException
891     @@@Type:
892 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
893 wakaba 1.12 @@@enDesc:
894     Whehter an exception should be thrown if <P::prefix>
895     is not declared or not.
896 wakaba 1.1 @@Return:
897 wakaba 1.3 @@@Type: AnyURI
898 wakaba 1.1 @@@Description:
899     @@@@lang:en
900     @@@@@:The associated namespace URI.
901 wakaba 1.49 @@@nullCase:
902 wakaba 1.1 @@@@Description:
903     @@@@@lang:en
904     @@@@@@:
905 wakaba 1.3 No namespace URI is associated to the prefix or
906 wakaba 1.1 the <DOM::null> namespace is associated.
907 wakaba 1.12 @@@UndeclaredPrefixException:
908 wakaba 1.1 @@@PerlDef:
909 wakaba 1.51 my $od = $self-><AG::DISNode.ownerDISDocument> || $self;
910 wakaba 1.53 my $binds = $od->{<H::mn:node>}->{<H::swcfg21:nsBinding>};
911 wakaba 1.1 if (exists $binds->{$prefix}) {
912     $r = $binds->{$prefix};
913     } else {
914 wakaba 1.7 ## From module list
915     FIND: {
916     try {
917 wakaba 1.51 my $db = $od-><AG::DISDocument.disDatabase>;
918 wakaba 1.7 for my $mod_uri (keys %{$db->{modDef}}) {
919     my $mod = $db-><M::ManakaiDISDatabase.getModule> ($mod_uri);
920 wakaba 1.48 if ($mod-><AG::DISAnyResource.localName>
921 wakaba 1.7 eq $prefix) {
922 wakaba 1.57 $r = $mod-><AG::DIS|DISModule.targetNamespaceURI>;
923 wakaba 1.7 last FIND;
924     }
925     }
926 wakaba 1.48 } catch <IF::DISException> with {
927 wakaba 1.7 my $err = shift;
928     $err->throw
929 wakaba 1.47 unless $err->{<Q::MDOMX:subtype>} eq <Q::NO_ASSOCIATED_DB_ERR>;
930 wakaba 1.7 };
931     if ($makeNewBinding) {
932     $r = $binds->{$prefix} = $prefix;
933 wakaba 1.12 } elsif ($raisePrefixException) {
934     __EXCEPTION{DIS:UNDECLARED_NS_PREFIX_ERR::
935     infoset:prefix => {$prefix},
936     MDOMX:param-name => 'prefix',
937     DIS:sourceNode => {$self},
938     }__;
939 wakaba 1.7 } else {
940     $r = null;
941     }
942     } # FIND
943 wakaba 1.1 }
944    
945     @IntMethod:
946 wakaba 1.47 @@ForCheck: ManakaiDOM|ForClass
947 wakaba 1.1 @@Name:getNodeReference
948     @@Description:
949     @@@lang:en
950     @@@@:
951     Returns a new reference to the node object.
952     @@ManakaiDOM:isStatic:1
953     @@Param:
954     @@@Name:object
955 wakaba 1.47 @@@Type: ManakaiNode|NodeStem||ManakaiDOM|Perl
956 wakaba 1.1 @@@Description:
957     @@@@lang:en
958     @@@@@:
959     The node object to be referred.
960     @@Return:
961     @@@Type: ManakaiDISNode
962     @@@Description:
963     @@@@lang:en
964     @@@@@:
965     A newly created reference.
966     @@@PerlDef:
967     my $class;
968 wakaba 1.53 if ($object->{<H::swcfg21:nodeType>} eq '#element') {
969 wakaba 1.1 $class = <ClassName::ManakaiDISElement>;
970 wakaba 1.53 } elsif ($object->{<H::swcfg21:nodeType>} eq '#comment') {
971 wakaba 1.1 $class = <ClassName::ManakaiDISComment>;
972 wakaba 1.53 } elsif ($object->{<H::swcfg21:nodeType>} eq '#document') {
973 wakaba 1.1 $class = <ClassName::ManakaiDISDocument>;
974 wakaba 1.53 } elsif ($object->{<H::swcfg21:nodeType>} eq '#fragment') {
975 wakaba 1.1 $class = <ClassName::ManakaiDISDocumentFragment>;
976     } else {
977     __ASSERT{DISPerl:invariant::
978 wakaba 1.53 msg => {qq[Node type: "$object->{<H::swcfg21:nodeType>}" ].
979 wakaba 1.1 qq[(ref: "@{[ref $object]}")]},
980     }__;
981     }
982 wakaba 1.47 __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl::
983     $object => $object,
984     $ref => $r,
985     $class => $class,
986     }__;
987 wakaba 1.1
988 wakaba 1.2 @Attr:
989     @@Name:ownerDISDocument
990     @@Description:
991     @@@lang:en
992     @@@@:
993     The <QUOTE::dis> document object associated with this node.
994     @@Get:
995 wakaba 1.47 @@@Type: DISDocument
996     @@@clsActualType: ManakaiDISDocument
997 wakaba 1.2 @@@Description:
998     @@@@lang:en
999     @@@@@:
1000     The document object associated with this node.
1001 wakaba 1.49 @@@nullCase:
1002 wakaba 1.2 @@@@Description:
1003     @@@@@lang:en
1004     @@@@@@:
1005     This node is a document node.
1006     @@@PerlDef:
1007     $r = <ClassM::ManakaiDISNode.getNodeReference>
1008 wakaba 1.53 ($self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>})
1009     if $self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>};
1010 wakaba 1.1 ##DISNode
1011    
1012 wakaba 1.47 IFClsDef:
1013 wakaba 1.48 @IFQName: NSResolverDIS
1014     @ClsQName: ManakaiNSResolverDIS
1015 wakaba 1.1
1016 wakaba 1.38
1017 wakaba 1.1 @Method:
1018 wakaba 1.48 @@Name: prefixToURI
1019 wakaba 1.1 @@Description:
1020     @@@lang:en
1021     @@@@:
1022 wakaba 1.48 Converts a namespace prefix into associated URI reference.
1023 wakaba 1.1 @@Param:
1024 wakaba 1.48 @@@Name: prefix
1025     @@@Type:
1026     DISCore:NamespacePrefix::ManakaiDOM:all
1027 wakaba 1.1 @@@Description:
1028     @@@@lang:en
1029     @@@@@:
1030 wakaba 1.48 A namespace prefix to look for.
1031 wakaba 1.49 @@@nullCase:
1032 wakaba 1.1 @@@@Description:
1033     @@@@@lang:en
1034     @@@@@@:
1035 wakaba 1.48 Returns the default namespace URI.
1036     @@NodeParam:
1037 wakaba 1.1 @@Return:
1038 wakaba 1.48 @@@Type: AnyURI
1039 wakaba 1.1 @@@Description:
1040     @@@@lang:en
1041 wakaba 1.48 @@@@@: The URI references associated.
1042 wakaba 1.2 @@@UndeclaredPrefixException:
1043     @@@PerlDef:
1044 wakaba 1.48 if (defined $prefix) {
1045     __DEEP{
1046     $r = $self-><M::SWCFGNode.lookupNamespaceURI> ($prefix);
1047     }__;
1048     unless (defined $r) {
1049     __EXCEPTION{UNDECLARED_NS_PREFIX_ERR::
1050     infoset:prefix => {$prefix},
1051     MDOMX:param-name => 'prefix',
1052     DIS:sourceNode => {$node},
1053     }__;
1054     }
1055 wakaba 1.53 } elsif (defined $self->{<H::mn:node>}
1056     ->{<H::DIS|defaultNamespaceURI>}) {
1057     $r = $self->{<H::mn:node>}->{<H::DIS|defaultNamespaceURI>};
1058 wakaba 1.48 } else { ## Default namespace
1059 wakaba 1.2 __DEEP{
1060 wakaba 1.48 $r = ($self-><AG::ManakaiDISNode.ownerDISDocument> || $self)
1061     -><AG::ManakaiDISDocument.moduleElement>
1062     -><AG::ManakaiDISModuleElement.definingNamespaceURI>;
1063 wakaba 1.2 }__;
1064 wakaba 1.48 }
1065 wakaba 1.1
1066     @Method:
1067 wakaba 1.48 @@Name: qnameToURI
1068 wakaba 1.1 @@Description:
1069     @@@lang:en
1070     @@@@:
1071 wakaba 1.48 Converts a qualified name (<Q::dis:TypeQName>) to
1072     an expanded URI reference.
1073 wakaba 1.1 @@Param:
1074 wakaba 1.48 @@@Name: qname
1075     @@@Type:
1076     dis:TypeQName::ManakaiDOM:all
1077 wakaba 1.1 @@@Description:
1078     @@@@lang:en
1079     @@@@@:
1080 wakaba 1.48 A qualified name.
1081     @@NodeParam:
1082     @@NamedParam:
1083     @@@Name: defaultNamespaceURI
1084     @@@Type: AnyURI
1085     @@@enDesc:
1086     Default namespace URI reference.
1087     @@@nullCase:
1088     @@@@enDesc:
1089     The default namespace is the namespace defined by the module
1090     to which this resource belongs.
1091 wakaba 1.1 @@Return:
1092 wakaba 1.48 @@@Type: AnyURI
1093 wakaba 1.1 @@@Description:
1094     @@@@lang:en
1095     @@@@@:
1096 wakaba 1.48 The expanded URI reference.
1097     @@@UndeclaredPrefixException:
1098 wakaba 1.2 @@@PerlDef:
1099 wakaba 1.48 $qname =~ s/^\s+//; $qname =~ s/\s+$//;
1100     my ($prefix, $lname) = split /\s*[:|]\s*/, $qname, 2;
1101     __DEEP{
1102     if (defined $lname) {
1103     $r = $self-><M::NSResolverDIS.prefixToURI> ($prefix) . $lname;
1104     } else { ## In default namespace
1105 wakaba 1.13 if (defined $defaultNamespaceURI) {
1106     $r = $defaultNamespaceURI . $prefix;
1107     } else {
1108 wakaba 1.48 $r = $self-><M::NSResolverDIS.prefixToURI> (null) . $prefix;
1109 wakaba 1.13 }
1110 wakaba 1.1 }
1111 wakaba 1.4 }__;
1112 wakaba 1.1
1113     @Method:
1114 wakaba 1.47 @@Name: qnameToPair
1115 wakaba 1.1 @@Description:
1116     @@@lang:en
1117     @@@@:
1118 wakaba 1.47 Converts a qualified name (<Q::dis:TypeQName>) to
1119 wakaba 1.1 a pair of namespace URI and local name.
1120     @@Param:
1121     @@@Name: qname
1122     @@@Type:
1123 wakaba 1.18 dis:TypeQName::ManakaiDOM:all
1124 wakaba 1.1 @@@Description:
1125     @@@@lang:en
1126     @@@@@:
1127     A qualified name.
1128     @@NodeParam:
1129     @@Return:
1130     @@@Type:
1131 wakaba 1.18 Perl:ARRAY::ManakaiDOM:all
1132 wakaba 1.1 @@@Description:
1133     @@@@lang:en
1134     @@@@@:
1135     A list of namespace URI and local name.
1136     @@@UndeclaredPrefixException:
1137     @@@PerlDef:
1138     $qname =~ s/^\s+//; $qname =~ s/\s+$//;
1139 wakaba 1.15 my ($prefix, $lname) = split /\s*[:|]\s*/, $qname, 2;
1140 wakaba 1.1 __DEEP{
1141     if (defined $lname) {
1142 wakaba 1.48 $r = [$self-><M::NSResolverDIS.prefixToURI> ($prefix), $lname];
1143 wakaba 1.1 } else { ## In default namespace
1144 wakaba 1.48 $r = [$self-><M::NSResolverDIS.prefixToURI> (null), $prefix];
1145 wakaba 1.1 }
1146 wakaba 1.4 }__;
1147 wakaba 1.1
1148     @Method:
1149 wakaba 1.3 @@Name: tfqnamesToURI
1150 wakaba 1.1 @@Description:
1151     @@@lang:en
1152     @@@@:
1153 wakaba 1.47 Converts a <Q::dis:TFQNames>
1154 wakaba 1.1 into an expanded URI reference.
1155     @@Param:
1156     @@@Name: tfqnames
1157     @@@Type:
1158 wakaba 1.18 dis:TFQNames::ManakaiDOM:all
1159 wakaba 1.1 @@@Description:
1160     @@@@lang:en
1161     @@@@@:
1162 wakaba 1.47 A <Q::dis:TFQNames> to identify a resource.
1163 wakaba 1.1 @@Param:
1164     @@@Name: defaultTypeURI
1165     @@@Type: NameURI
1166     @@@Description:
1167     @@@@lang:en
1168     @@@@@:
1169     A name URI reference used if it is missing from
1170     <P::tfqnames>.
1171 wakaba 1.49 @@@nullCase:
1172 wakaba 1.1 @@@@Description:
1173     @@@@@lang:en
1174     @@@@@@:
1175     Equivalent to <Q::DOMMain:any>.
1176     @@Param:
1177     @@@Name: defaultForURI
1178     @@@Type: ForURI
1179     @@@Description:
1180     @@@@lang:en
1181     @@@@@:
1182     A <QUOTE::for> URI reference used if it is missing from
1183     <P::tfqnames>.
1184 wakaba 1.49 @@@nullCase:
1185 wakaba 1.1 @@@@Description:
1186     @@@@@lang:en
1187     @@@@@@:
1188     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
1189     @@NodeParam:
1190     @@Return:
1191     @@@Type:
1192 wakaba 1.3 DISCore:TFURI::ManakaiDOM:all
1193 wakaba 1.1 @@@Description:
1194     @@@@lang:en
1195     @@@@@:
1196 wakaba 1.47 The <Q::dis:TFQNames>-expanded URI references.
1197 wakaba 1.1 @@@UndeclaredPrefixException:
1198     @@@PerlDef:
1199 wakaba 1.15 my ($typeq, $forq) = split /\s*[:|][:|]\s*/, $tfqnames, 2;
1200 wakaba 1.1 my ($typeURI, $forURI);
1201     if (defined $forq) {
1202     __DEEP{
1203     $typeURI = $typeq eq ''
1204     ? defined $defaultTypeURI ? $defaultTypeURI
1205     : <Q::DOMMain:any>
1206 wakaba 1.48 : $self-><M::NSResolverDIS.qnameToURI> ($typeq, %opt);
1207 wakaba 1.1 }__;
1208     if (length $forq) {
1209 wakaba 1.48 $forURI = $self-><M::NSResolverDIS.qnameToURI> ($forq, %opt);
1210 wakaba 1.1 } else {
1211     $forURI = <Q::ManakaiDOM:all>;
1212     }
1213     } else { ## "For" omitted
1214     __DEEP{
1215     $typeURI = $typeq eq ''
1216     ? defined $defaultTypeURI ? $defaultTypeURI
1217     : <Q::DOMMain:any>
1218 wakaba 1.48 : $self-><M::NSResolverDIS.qnameToURI> ($typeq, %opt);
1219 wakaba 1.1 }__;
1220 wakaba 1.3 $forURI = defined $defaultForURI ? $defaultForURI
1221     : <Q::ManakaiDOM:all>;
1222 wakaba 1.1 }
1223 wakaba 1.4 __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__;
1224 wakaba 1.2
1225     @Method:
1226 wakaba 1.33 @@Name: tfpqnamesToURI
1227     @@Description:
1228     @@@lang:en
1229     @@@@:
1230 wakaba 1.47 Converts a <Q::DISCore:TFPQNames>
1231 wakaba 1.33 into an expanded URI reference.
1232     @@Param:
1233     @@@Name: tfpqnames
1234     @@@Type:
1235     DISCore:TFPQNames::ManakaiDOM:all
1236     @@@Description:
1237     @@@@lang:en
1238     @@@@@:
1239 wakaba 1.47 A <Q::DISCore:TFPQNames> to identify a resource.
1240 wakaba 1.33 @@Param:
1241     @@@Name: defaultTypeURI
1242     @@@Type: NameURI
1243     @@@Description:
1244     @@@@lang:en
1245     @@@@@:
1246     A name URI reference used if it is missing from
1247     <P::tfqnames>.
1248 wakaba 1.49 @@@nullCase:
1249 wakaba 1.33 @@@@Description:
1250     @@@@@lang:en
1251     @@@@@@:
1252     Equivalent to <Q::DOMMain:any>.
1253     @@Param:
1254     @@@Name: defaultForURI
1255     @@@Type: ForURI
1256     @@@Description:
1257     @@@@lang:en
1258     @@@@@:
1259     A <QUOTE::for> URI reference used if it is missing from
1260     <P::tfqnames>.
1261 wakaba 1.49 @@@nullCase:
1262 wakaba 1.33 @@@@Description:
1263     @@@@@lang:en
1264     @@@@@@:
1265     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
1266     @@NodeParam:
1267     @@Return:
1268     @@@Type:
1269     DISCore:TFURI::ManakaiDOM:all
1270     @@@Description:
1271     @@@@lang:en
1272     @@@@@:
1273 wakaba 1.47 The <Q::dis:TFQNames>-expanded URI references.
1274 wakaba 1.33 @@@UndeclaredPrefixException:
1275     @@@PerlDef:
1276     my ($typeq, $forq, @forpq) = split /\s*[:|][:|]\s*/, $tfpqnames;
1277     my ($typeURI, $forURI);
1278     my $forpURI = [];
1279     undef $forq if defined $forq and $forq eq '+';
1280     if (defined $forq) {
1281     __DEEP{
1282     $typeURI = $typeq eq ''
1283     ? defined $defaultTypeURI ? $defaultTypeURI
1284     : <Q::DOMMain:any>
1285 wakaba 1.48 : $self-><M::NSResolverDIS.qnameToURI> ($typeq, %opt);
1286 wakaba 1.33 if (length $forq) {
1287 wakaba 1.48 $forURI = $self-><M::NSResolverDIS.qnameToURI> ($forq, %opt);
1288 wakaba 1.33 } else {
1289     $forURI = <Q::ManakaiDOM:all>;
1290     }
1291     }__;
1292     } else { ## "For" omitted
1293     __DEEP{
1294     $typeURI = $typeq eq ''
1295     ? defined $defaultTypeURI ? $defaultTypeURI
1296     : <Q::DOMMain:any>
1297 wakaba 1.48 : $self-><M::NSResolverDIS.qnameToURI> ($typeq, %opt);
1298 wakaba 1.33 }__;
1299     $forURI = defined $defaultForURI ? $defaultForURI
1300     : <Q::ManakaiDOM:all>;
1301     }
1302     __DEEP{
1303     for my $forpq (@forpq) {
1304 wakaba 1.48 push @$forpURI, $self-><M::NSResolverDIS.qnameToURI>
1305 wakaba 1.33 ($forpq, %opt);
1306     }
1307     }__;
1308     __CODE{tfpurisToURI:: $turi => $typeURI, $furi => $forURI,
1309     $forp => $forpURI, $uri => $r}__;
1310 wakaba 1.48 ##NSResolverDIS
1311    
1312     PropDef:
1313     @QName: defaultNamespaceURI
1314     @enDesc:
1315     Default namespace URI for an element.
1316 wakaba 1.57 @DIS:key: dns
1317 wakaba 1.48
1318     IFClsDef:
1319     @IFQName: DISElement
1320     @ClsQName: ManakaiDISElement
1321    
1322     @ClsISA: ManakaiNSResolverDIS
1323     @ClsISA: ManakaiDISNode
1324     @ClsISA:
1325     swcfg21:ManakaiSWCFGElement::swcfg21:ForLatest
1326     @ClsISA: dp|ManakaiDISElementPerl
1327    
1328     @Description:
1329     @@lang:en
1330     @@@:
1331     <QUOTE::dis> element node objects.
1332    
1333     @DISLang:role: ElementRole
1334 wakaba 1.33
1335     @Method:
1336 wakaba 1.48 @@Name: forMatch
1337     @@Description:
1338     @@@lang:en
1339     @@@@:
1340     Tests whether this element is for a <QUOTE::for> or not.
1341 wakaba 1.2 @@Param:
1342 wakaba 1.48 @@@Name: forArg
1343     @@@Type: ForURI
1344     @@@Description:
1345     @@@@lang:en
1346     @@@@@:
1347     The <QUOTE::For> URI reference to test against.
1348 wakaba 1.3 @@Param:
1349 wakaba 1.48 @@@Name: forpArg
1350     @@@Type: ForURIList
1351     @@@Description:
1352     @@@@lang:en
1353     @@@@@:
1354     The <QUOTE::For+> URI references to test against.
1355 wakaba 1.49 @@@nullCase:
1356 wakaba 1.48 @@@@Description:
1357     @@@@@lang:en
1358     @@@@@@:
1359     No additional <QUOTE::For> URI reference.
1360     Equivalent to an empty array reference.
1361 wakaba 1.49 @@NamedParam:
1362     @@@Name: databaseArg
1363     @@@Type: DISDatabase
1364     @@@enDesc:
1365     A <QUOTE::dis> database.
1366     @@@nullCase:
1367     @@@@enDesc:
1368     The database associated to the document is used.
1369 wakaba 1.2 @@Return:
1370 wakaba 1.48 @@@Type:
1371     DOMMain:boolean::ManakaiDOM:all
1372     @@@Description:
1373     @@@@lang:en
1374     @@@@@:
1375     Whether this element is for <P::forArg> and <P::forpArg> or not.
1376     @@@UndeclaredPrefixException:
1377     @@@NoDBException:
1378 wakaba 1.2 @@@PerlDef:
1379 wakaba 1.48 $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
1380     $forpArg ||= [];
1381    
1382     FORMATCH: {
1383     __DEEP{
1384 wakaba 1.49 my $for_res = ($databaseArg ||=
1385     $self-><AG::DISNode.ownerDISDocument>
1386     -><AG::DISDocument.disDatabase>)
1387     -><M::DISDatabase.getFor> ($forArg);
1388 wakaba 1.48 my $forp_res = [map {
1389 wakaba 1.49 $databaseArg-><M::DISDatabase.getFor> ($_)
1390 wakaba 1.48 } @{$forpArg}];
1391    
1392     my @ce = @{$self-><M::ManakaiDISElement.disAllChildElements>};
1393     for my $ce (@ce) {
1394     my $et = $ce-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1395     .expandedURI>;
1396     if ($et eq <Q::dis:ForCheck>) {
1397     my $fors = [split /\s+/, $ce-><M::swcfg21:SWCFGNode
1398     ::swcfg21:ForLatest.value>];
1399     FCs: for my $f (@$fors) {
1400     if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
1401     my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1402 wakaba 1.49 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1403 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($ce);
1404     for my $arg_res ($for_res, @{$forp_res}) {
1405     if ($arg_res eq $for) {
1406     $r = false;
1407     last FORMATCH;
1408     }
1409     }
1410     } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
1411     my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1412 wakaba 1.49 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1413 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($ce);
1414     for my $arg_res ($for_res, @{$forp_res}) {
1415     if ($arg_res-><M::DISFor.isaURI> ($uri)) {
1416     $r = false;
1417     last FORMATCH;
1418     }
1419     }
1420     } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
1421     my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1422 wakaba 1.49 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1423 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($ce);
1424     for my $arg_res ($for_res, @{$forp_res}) {
1425     if ($arg_res eq $for) {
1426     next FCs;
1427     }
1428     }
1429     $r = false;
1430     last FORMATCH;
1431     } else { ## -- ISA
1432     my $uri = $self-><M::NSResolverDIS.qnameToURI> ($f);
1433 wakaba 1.49 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1434 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($ce);
1435     for my $arg_res ($for_res, @{$forp_res}) {
1436     if ($arg_res-><M::DISFor.isaURI> ($uri)) {
1437     next FCs;
1438     }
1439     }
1440     $r = false;
1441     last FORMATCH;
1442     }
1443     } # FCs
1444     } # dis:ForCheck
1445     } # children
1446    
1447     my $has_for = false;
1448     for my $ce (@ce) {
1449     if ($ce-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1450     .expandedURI> eq
1451     <Q::dis:For>) {
1452     my $fors = [split /\s+/, $ce-><M::swcfg21:SWCFGNode
1453     ::swcfg21:ForLatest.value>];
1454     my $ok = true;
1455     $has_for = true;
1456     AFOR: for my $f (@$fors) {
1457     if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
1458     my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1459 wakaba 1.49 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1460 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($ce);
1461     if ($for eq $for_res) {
1462     $ok = false;
1463     last AFOR;
1464     }
1465     } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
1466     my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1467 wakaba 1.49 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1468 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($ce);
1469     if ($for_res-><M::ManakaiDISForDefinition.isaURI> ($uri)) {
1470     $ok = false;
1471     last AFOR;
1472     }
1473     } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
1474     my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1475 wakaba 1.49 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1476 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($ce);
1477     unless ($for eq $for_res) {
1478     $ok = false;
1479     last AFOR;
1480     }
1481     } else { ## -- ISA
1482     my $uri = $self-><M::NSResolverDIS.qnameToURI> ($f);
1483 wakaba 1.49 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1484 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($ce);
1485     unless ($for_res-><M::ManakaiDISForDefinition.isaURI>($uri)){
1486     $ok = false;
1487     last AFOR;
1488     }
1489     }
1490     } # AFOR
1491     if ($ok) {
1492     $r = true;
1493     last FORMATCH;
1494     }
1495     } # dis:For
1496     } # $ce
1497     $r = $has_for ? false : true;
1498     }__;
1499     } # FORMATCH
1500 wakaba 1.2
1501 wakaba 1.4 @Method:
1502 wakaba 1.48 @@Name: mediaTypeMatch
1503     @@Description:
1504     @@@lang:en
1505     @@@@:
1506     Tests whether the content media type of this element matches to
1507     a type or not.
1508     @@Param:
1509     @@@Name: mediaType
1510     @@@Type: MediaTypeURI
1511     @@@Description:
1512     @@@@lang:en
1513     @@@@@:
1514     A media type URI reference to test against.
1515     @@Param:
1516     @@@Name: defaultMediaType
1517     @@@Type: MediaTypeURI
1518     @@@Description:
1519     @@@@lang:en
1520     @@@@@:
1521     The default media type for this element.
1522 wakaba 1.49 @@@nullCase:
1523 wakaba 1.48 @@@@Description:
1524     @@@@@lang:en
1525     @@@@@@:
1526     No default type provided. All <P::mediaType> will match.
1527 wakaba 1.4 @@ForParam:
1528     @@ForpParam:
1529 wakaba 1.49 @@NamedParam:
1530     @@@Name: databaseArg
1531     @@@Type: DISDatabase
1532     @@@enDesc:
1533     A <QUOTE::dis> database.
1534     @@@nullCase:
1535     @@@@enDesc:
1536     The database associated to the document is used.
1537 wakaba 1.4 @@Return:
1538 wakaba 1.48 @@@Type:
1539     DOMMain:boolean::ManakaiDOM:all
1540     @@@Description:
1541     @@@@lang:en
1542     @@@@@:
1543     Whether this element is of <P::mediaType> or not.
1544 wakaba 1.2 @@@PerlDef:
1545 wakaba 1.48 if (defined $mediaType) {
1546     __DEEP{
1547 wakaba 1.49 my $ctn = $self-><M::SWCFGNode.getAttributeNS>
1548     (<Q::dis:>, 'ContentType');
1549 wakaba 1.48 my $ct;
1550     $ct = $ctn-><AG::DISElement.qnameValueURI> if $ctn;
1551     $ct = $defaultMediaType unless defined $ct;
1552     my $res = $self-><AG::ManakaiDISNode.ownerDISDocument>
1553     -><AG::ManakaiDISDocument.disDatabase>
1554     -><M::ManakaiDISDatabase.getResource> ($ct);
1555     $res-><AS::DISAnyResource.isReferred> ($ctn or $self);
1556     unless ($res-><M::ManakaiDISResourceDefinition
1557     .isSubsetOfURI> ($mediaType)) {
1558     $r = false;
1559     } else {
1560     $r = true;
1561     }
1562     }__;
1563     } else {
1564     $r = true;
1565     }
1566 wakaba 1.5
1567 wakaba 1.10 @Method:
1568 wakaba 1.48 @@Name:mediaTypeURI
1569 wakaba 1.10 @@enDesc:
1570 wakaba 1.48 The URI reference of the media type of this element.
1571     @@Type: MediaTypeURI
1572     @@NamedParam:
1573     @@@Name:defaultMediaType
1574     @@@Type:MediaTypeURI
1575     @@@enDesc:
1576     The default media type URI reference.
1577     @@@nullCase:
1578     @@@@enDesc:
1579     No default is specified.
1580     @@ForParam:
1581     @@ForpParam:
1582 wakaba 1.10 @@Return:
1583     @@@enDesc:
1584 wakaba 1.48 The media type URI reference of this element.
1585 wakaba 1.2 @@@nullCase:
1586     @@@@enDesc:
1587 wakaba 1.48 This element has no media type information and
1588     <P::defaultMediaType> parameter is not provided.
1589 wakaba 1.2 @@@UndeclaredPrefixException:
1590 wakaba 1.3 @@@PerlDef:
1591 wakaba 1.48 __DEEP{
1592     $r = $defaultMediaType;
1593 wakaba 1.49 my $ctn = $self-><M::SWCFGNode.getAttributeNS>
1594     (<Q::dis:>, 'ContentType');
1595 wakaba 1.48 $r = $ctn-><AG::DISElement.qnameValueURI> if $ctn;
1596     }__;
1597 wakaba 1.4
1598 wakaba 1.48 @Method:
1599     @@Name: disGetAttribute
1600     @@enDesc:
1601     Gets an attribute node.
1602     @@Param:
1603     @@@Name: attrName
1604     @@@Type: AnyURI
1605     @@@enDesc:
1606     The name expanded URI of the node to retrieve.
1607     @@ForParam:
1608     @@ForpParam:
1609     @@MediaTypeParam:
1610     @@MediaTypeDefaultParam:
1611 wakaba 1.49 @@NamedParam:
1612     @@@Name: databaseArg
1613     @@@Type: DISDatabase
1614     @@@enDesc:
1615     A <QUOTE::dis> database.
1616     @@@nullCase:
1617     @@@@enDesc:
1618     The database associated to the document is used.
1619 wakaba 1.48 @@Return:
1620     @@@Type: DISElement
1621     @@@clsActualType: ManakaiDISElement
1622     @@@enDesc:
1623     The attribute (property) element node.
1624     @@@nullCase:
1625     @@@@enDesc:
1626     No attribute node found.
1627     @@@PerlDef:
1628     C: for my $c (@{$self-><M::ManakaiDISElement.disChildElements>
1629 wakaba 1.49 (for_arg => $forArg, forp_arg => $forpArg,
1630     database_arg => $databaseArg)}) {
1631 wakaba 1.48 if ($c-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1632     .expandedURI> eq $attrName and
1633     $c-><M::ManakaiDISElement.mediaTypeMatch>
1634     ($mediaType, $defaultMediaType,
1635 wakaba 1.49 for_arg => $forArg, forp_arg => $forpArg,
1636     database_arg => $databaseArg)) {
1637 wakaba 1.48 $r = $c;
1638     last C;
1639     }
1640     }
1641    
1642     @Method:
1643     @@Name: disGetAttributeList
1644     @@enDesc:
1645     Gets attribute nodes.
1646     @@Param:
1647     @@@Name: attrName
1648     @@@Type: AnyURI
1649     @@@enDesc:
1650     The name expanded URI of the node to retrieve.
1651     @@ForParam:
1652     @@ForpParam:
1653     @@MediaTypeParam:
1654     @@MediaTypeDefaultParam:
1655 wakaba 1.49 @@NamedParam:
1656     @@@Name: databaseArg
1657     @@@Type: DISDatabase
1658     @@@enDesc:
1659     A <QUOTE::dis> database.
1660     @@@nullCase:
1661     @@@@enDesc:
1662     The database associated to the document is used.
1663 wakaba 1.48 @@Return:
1664     @@@Type: DISElementList
1665     @@@clsActualType: ManakaiDISElementList
1666     @@@enDesc:
1667     The attribute (property) element nodes.
1668     @@@PerlDef:
1669     $r = bless [], <ClassName::ManakaiDISElementList>;
1670     for my $c (@{$self-><M::ManakaiDISElement.disChildElements>
1671 wakaba 1.49 (for_arg => $forArg, forp_arg => $forpArg,
1672     database_arg => $databaseArg)}) {
1673 wakaba 1.48 if ($c-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1674     .expandedURI> eq $attrName and
1675     $c-><M::ManakaiDISElement.mediaTypeMatch>
1676     ($mediaType, $defaultMediaType,
1677 wakaba 1.49 for_arg => $forArg, forp_arg => $forpArg,
1678     database_arg => $databaseArg)) {
1679 wakaba 1.48 push @$r, $c;
1680     }
1681     }
1682    
1683     @Method:
1684     @@Name: disChildElements
1685     @@enDesc:
1686     A list of child elements, with <QUOTE::for> check.
1687     @@ForParam:
1688     @@ForpParam:
1689 wakaba 1.49 @@NamedParam:
1690     @@@Name: databaseArg
1691     @@@Type: DISDatabase
1692     @@@enDesc:
1693     A <QUOTE::dis> database.
1694     @@@nullCase:
1695     @@@@enDesc:
1696     The database associated to the document is used.
1697 wakaba 1.48 @@Return:
1698     @@@Type: DISElementList
1699     @@@clsActualType: ManakaiDISElementList
1700     @@@enDesc:
1701     The current snapshot of child nodes.
1702     @@@PerlDef:
1703     $r = bless [], <ClassName::ManakaiDISElementList>;
1704     __DEEP{
1705     C: for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1706     .childNodes>}) {
1707     ## $cn is an #element.
1708     my $dn;
1709     __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl::
1710 wakaba 1.53 $object => {$cn->{<H::mn:node>}},
1711 wakaba 1.48 $ref => $dn,
1712     $class => {<ClassName::ManakaiDISElement>},
1713     }__;
1714     next C unless $dn-><M::ManakaiDISElement.forMatch>
1715 wakaba 1.49 ($forArg, $forpArg,
1716     database_arg => $databaseArg);
1717 wakaba 1.48 push @$r, $dn;
1718     }
1719     }__;
1720    
1721     @Method:
1722     @@Name: disAllChildElements
1723     @@enDesc:
1724     A list of child elements, without <QUOTE::for> check.
1725     @@Return:
1726     @@@Type: DISElementList
1727     @@@clsActualType: ManakaiDISElementList
1728     @@@enDesc:
1729     The current snapshot of child nodes.
1730     @@@PerlDef:
1731     $r = bless [], <ClassName::ManakaiDISElementList>;
1732     __DEEP{
1733     for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1734     .childNodes>}) {
1735     ## $cn is an #element.
1736     my $dn;
1737     __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl::
1738 wakaba 1.53 $object => {$cn->{<H::mn:node>}},
1739 wakaba 1.48 $ref => $dn,
1740     $class => {<ClassName::ManakaiDISElement>},
1741     }__;
1742     push @$r, $dn;
1743     }
1744     }__;
1745    
1746     @Attr:
1747     @@Name: qnameValueURI
1748     @@enDesc:
1749     The element value (written as <Q::dis:TypeQName>), as URI reference.
1750     \
1751     {NOTE:: What should be if list value?
1752     \
1753     }
1754     @@Get:
1755     @@@Type:AnyURI
1756     @@@nullCase:
1757     @@@@enDesc:
1758     No value.
1759     @@@UndeclaredPrefixException:
1760     @@@PerlDef:
1761     __DEEP{
1762     my $v = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1763     if (defined $v and not ref $v eq 'ARRAY') {
1764     $r = $self-><M::NSResolverDIS.qnameToURI> ($v, node => $self);
1765     } else {
1766     $r = null;
1767     }
1768     }__;
1769    
1770     @Attr:
1771     @@Name: qnameValueLocalName
1772 wakaba 1.4 @@enDesc:
1773     The local name part of the element value (assumed as
1774 wakaba 1.47 written as <Q::dis:TypeQName>).
1775 wakaba 1.4 \
1776     {NOTE:: What should be if list value?
1777     \
1778     }
1779     @@Get:
1780     @@@Type:
1781 wakaba 1.18 DISCore:LocalName::ManakaiDOM:all
1782 wakaba 1.4 @@@nullCase:
1783     @@@@enDesc:
1784     No value.
1785     @@@PerlDef:
1786     __DEEP{
1787 wakaba 1.14 my $v = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1788 wakaba 1.4 if (defined $v and not ref $v eq 'ARRAY') {
1789 wakaba 1.15 my ($n, $v) = split /\s*[:|]\s*/, $v, 2;
1790 wakaba 1.4 $r = defined $v ? $v : $n;
1791     } else {
1792     $r = null;
1793     }
1794     }__;
1795    
1796     @Attr:
1797 wakaba 1.43 @@Name: qnameValuePrefix
1798     @@enDesc:
1799     The prefix part of the element value (assumed as
1800 wakaba 1.47 written as <Q::dis:TypeQName>).
1801 wakaba 1.43 \
1802     {NOTE:: What should be if list value?
1803     \
1804     }
1805     @@Get:
1806     @@@Type:
1807     DISCore:NamespacePrefix::ManakaiDOM:all
1808     @@@nullCase:
1809     @@@@enDesc:
1810     No value.
1811     @@@PerlDef:
1812     __DEEP{
1813     my $v = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1814     if (defined $v and not ref $v eq 'ARRAY') {
1815     my ($p, $l) = split /\s*[:|]\s*/, $v, 2;
1816     $r = defined $l ? $p : null;
1817     } else {
1818     $r = null;
1819     }
1820     }__;
1821    
1822     @Attr:
1823 wakaba 1.4 @@Name: qnameValueNamespaceURI
1824     @@enDesc:
1825     The namespace URI of the element value (assumed as written
1826 wakaba 1.47 in <Q::dis:TypeQName>).
1827 wakaba 1.4 \
1828     {NOTE:: What should be if list value?
1829     \
1830     }
1831     @@Get:
1832     @@@Type:AnyURI
1833     @@@nullCase:
1834     @@@@enDesc:
1835     No value.
1836     @@@UndeclaredPrefixException:
1837     @@@PerlDef:
1838     __DEEP{
1839 wakaba 1.14 my $v = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1840 wakaba 1.4 if (defined $v and not ref $v eq 'ARRAY') {
1841 wakaba 1.15 my ($p, $v) = split /\s*[:|]\s*/, $v, 2;
1842 wakaba 1.48 $r = $self-><M::NSResolverDIS.prefixToURI>
1843 wakaba 1.4 (defined $v ? $p : null);
1844     } else {
1845     $r = null;
1846     }
1847     }__;
1848 wakaba 1.2
1849 wakaba 1.6 @Method:
1850 wakaba 1.3 @@Name: tfqnamesValueURI
1851 wakaba 1.2 @@enDesc:
1852 wakaba 1.47 The element value (written as <Q::dis:TFQNames>),
1853 wakaba 1.2 as URI reference.
1854     \
1855     {NOTE:: What should be if list value?
1856     \
1857     }
1858 wakaba 1.6 @@Param:
1859     @@@Name: defaultTypeURI
1860     @@@Type: NameURI
1861     @@@Description:
1862     @@@@lang:en
1863     @@@@@:
1864     A name URI reference used if it is missing from
1865     <P::tfqnames>.
1866 wakaba 1.49 @@@nullCase:
1867 wakaba 1.6 @@@@Description:
1868     @@@@@lang:en
1869     @@@@@@:
1870     Equivalent to <Q::DOMMain:any>.
1871     @@Param:
1872     @@@Name: defaultForURI
1873     @@@Type: ForURI
1874     @@@Description:
1875     @@@@lang:en
1876     @@@@@:
1877     A <QUOTE::for> URI reference used if it is missing from
1878     <P::tfqnames>.
1879 wakaba 1.49 @@@nullCase:
1880 wakaba 1.6 @@@@Description:
1881     @@@@@lang:en
1882     @@@@@@:
1883     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
1884 wakaba 1.33 @@ForParam:
1885     @@ForpParam:
1886 wakaba 1.49 @@NamedParam:
1887     @@@Name:databaseArg
1888     @@@Type:DISDatabase
1889 wakaba 1.6 @@Return:
1890 wakaba 1.2 @@@Type:ResourceURI
1891     @@@nullCase:
1892     @@@@enDesc:
1893     No value.
1894     @@@UndeclaredPrefixException:
1895 wakaba 1.3 @@@PerlDef:
1896 wakaba 1.14 my $v = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1897 wakaba 1.2 if (defined $v and not ref $v eq 'ARRAY') {
1898     __DEEP{
1899 wakaba 1.33 if ($self-><M::ManakaiDISElement.mediaTypeMatch>
1900 wakaba 1.48 (<Q::DISCore:TFPQNames>, <Q::DISCore:TFPQNames>,
1901 wakaba 1.49 for_arg => $forArg, forp_arg => $forpArg,
1902     database_arg => $databaseArg)) {
1903 wakaba 1.48 $r = $self-><M::NSResolverDIS.tfpqnamesToURI>
1904 wakaba 1.33 ($v, $defaultTypeURI, $defaultForURI,
1905     node => $self);
1906     } else {
1907 wakaba 1.48 $r = $self-><M::NSResolverDIS.tfqnamesToURI>
1908 wakaba 1.33 ($v, $defaultTypeURI, $defaultForURI,
1909     node => $self);
1910     }
1911 wakaba 1.2 }__;
1912     } else {
1913     $r = null;
1914     }
1915 wakaba 1.7
1916     @Method:
1917     @@Name: elementTypeMatch
1918     @@enDesc:
1919     Returns whether the element type of this element matches
1920     with another element type (either the same element type or
1921     this type is a subtype of another type).
1922     @@Param:
1923     @@@Name: etype
1924     @@@Type: ResourceURI
1925     @@@enDesc:
1926     An element type name URI reference to test.
1927     @@Return:
1928     @@@Type:
1929 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
1930 wakaba 1.7 @@@TrueCase:
1931     @@@@enDesc:
1932     Either the element type expanded URI reference of this element is
1933     same as <P::etype> or it is a sub-element type of <P::etype>.
1934     @@@FalseCase:
1935     @@@@enDesc:
1936     This element is not of <P::etype>.
1937     @@@NoDBException:
1938     @@@PerlDef:
1939     __DEEP{
1940 wakaba 1.14 my $et = $self-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1941 wakaba 1.7 .expandedURI>;
1942     my $rdef = $self-><AG::ManakaiDISNode.ownerDISDocument>
1943     -><AG::ManakaiDISDocument.disDatabase>
1944     -><M::ManakaiDISDatabase.getResource> ($et);
1945     $r = $rdef-><M::ManakaiDISResourceDefinition.isSubsetOfURI> ($etype);
1946     }__;
1947    
1948     @Attr:
1949     @@Name: isResourceElement
1950     @@enDesc:
1951     Whether this element defines a resource or not.
1952     \
1953     {NOTE:: An element defines a resource if its element type is
1954     <Q::dis:ResourceDef> or its subtype.
1955     \
1956     }
1957     @@Get:
1958     @@@Type:
1959 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
1960 wakaba 1.7 @@@TrueCase:
1961     @@@@enDesc:
1962     This element defines a resource.
1963     @@@FalseCase:
1964     @@@@enDesc:
1965     This element does not define any resource.
1966     @@@NoDBException:
1967     @@@PerlDef:
1968     __DEEP{
1969 wakaba 1.49 $r = ($self-><AG::SWCFGElement.expandedURI> eq <Q::dis:ResourceDef>);
1970 wakaba 1.7 }__;
1971    
1972 wakaba 1.49 @Method:
1973 wakaba 1.7 @@Name: isPropertyElement
1974     @@enDesc:
1975     Whether this element is a property or not.
1976     \
1977     {NOTE:: An element is a property if its element type is
1978     <Q::rdf:type> or if its element type's <Q::rdf:type>
1979     property is <Q::rdf:Property> or is <Q::dis:subsetOf>
1980     <Q::rdf:Property>.
1981     \
1982     }
1983 wakaba 1.49 @@NamedParam:
1984     @@@Name: databaseArg
1985     @@@Type: DIS|DISDatabase
1986     @@@nullCase:
1987     @@Return:
1988 wakaba 1.7 @@@Type:
1989 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
1990 wakaba 1.7 @@@TrueCase:
1991     @@@@enDesc:
1992     This element is a property.
1993     @@@FalseCase:
1994     @@@@enDesc:
1995     This element is not a property.
1996     @@@NoDBException:
1997     @@@PerlDef:
1998     __DEEP{
1999 wakaba 1.48 my $xn = $self-><AG::SWCFGElement.expandedURI>;
2000 wakaba 1.7 if ($xn eq <Q::rdf:type>) {
2001     $r = true;
2002     } else {
2003 wakaba 1.49 my $rdef = ($databaseArg or
2004     $self-><AG::DISNode.ownerDISDocument>
2005     -><AG::DISDocument.disDatabase>)
2006     -><M::DISDatabase.getResource> ($xn);
2007 wakaba 1.48 $r = $rdef-><M::DISResource.isTypeURI> (<Q::rdf:Property>);
2008 wakaba 1.18 }
2009     }__;
2010 wakaba 1.19
2011     @Method:
2012 wakaba 1.38 @@Name: getFeature
2013     @@Description:
2014     @@@lang:en
2015     @@@@:
2016     Returns a specialized object that implements the specialized
2017     interfaces of the specified feature and version.
2018     @@Param:
2019     @@@Name: feature
2020 wakaba 1.47 @@@Type: swcfg21|SWCFGString||swcfg21|ForLatest
2021     @@@actualType: DOMFeature|FeatureNameString||ManakaiDOM|ManakaiDOMLatest
2022 wakaba 1.38 @@@Description:
2023     @@@@lang:en
2024     @@@@@:
2025     A feature name to request.
2026     @@Param:
2027     @@@Name: version
2028 wakaba 1.47 @@@Type: swcfg21|SWCFGString||swcfg21|ForLatest
2029 wakaba 1.38 @@@actualType:
2030 wakaba 1.47 DOMFeature|FeatureVersionString||ManakaiDOM|ManakaiDOMLatest
2031 wakaba 1.38 @@@Description:
2032     @@@@lang:en
2033     @@@@@:
2034     A feature version number to request.
2035     @@Return:
2036     @@@Type:
2037     DOMMain:Object::ManakaiDOM:all
2038     @@@Description:
2039     @@@@lang:en
2040     @@@@@:
2041     An object that implements the specialized APIs of the
2042     <P::feature> and <P::version>.
2043 wakaba 1.49 @@@nullCase:
2044     @@@@enDesc:
2045 wakaba 1.38 There is no object available that implements interfaces
2046     associated with the <P::feature> and <P::version>.
2047     @@@PerlDef:
2048     $feature =~ s/^\+//;
2049     CLASS: for my $class (grep {
2050     $Message::Util::DIS::ManakaiDISElement::CompatClass{$_}
2051     } keys %Message::Util::DIS::ManakaiDISElement::CompatClass) {
2052     if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) {
2053 wakaba 1.47 __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl::
2054 wakaba 1.53 $object => {$self->{<H::mn:node>}},
2055 wakaba 1.47 $ref => $r,
2056     $class => $class,
2057     }__;
2058 wakaba 1.38 last CLASS;
2059     }
2060     }
2061 wakaba 1.1
2062 wakaba 1.48 @Method:
2063     @@Name: unlinkFromDocument
2064     @@enDesc:
2065     Removes any relationship to this node from the owner document tree.
2066     In addition, namespace bindings are copied from the document.
2067     The node <kwd:MUST> be a cloned one (or just newly created one)
2068     so that it does not have any parent-child relationship.
2069    
2070     {NOTE:: Once a subtree has removed from the document, the nodes
2071     belongs to the subtree can't be part of any document anymore.
2072     }
2073 wakaba 1.49 @@Param:
2074     @@@Name: databaseArg
2075     @@@Type: DISDatabase
2076     @@@enDesc:
2077     The <QUOTE::dis> database.
2078 wakaba 1.48 @@Return:
2079     @@@PerlDef:
2080     __DEEP{
2081 wakaba 1.53 my $ods = $self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>};
2082     $self->{<H::mn:node>}->{<H::swcfg21:nsBinding>}
2083 wakaba 1.49 = $self-><M::DISElement.getNamespaceBindingList> ($databaseArg);
2084 wakaba 1.53 $self->{<H::mn:node>}->{<H::DIS|defaultNamespaceURI>}
2085 wakaba 1.49 = ${$self-><M::DISElement.getDefaultNamespaceURIRef>};
2086 wakaba 1.53 my @nodes = ($self->{<H::mn:node>});
2087 wakaba 1.49 while (defined (my $node = shift @nodes)) {
2088 wakaba 1.53 CORE::delete $node->{<H::swcfg21:ownerDocument>};
2089     push @nodes, grep {$_} @{$node->{<H::swcfg21:childNodes>}},
2090     $node->{<H::swcfg21:shadowContent>},
2091     $node->{<H::swcfg21:shadowSibling>};
2092 wakaba 1.49 }
2093 wakaba 1.53 $self->{<H::mn:node>}
2094 wakaba 1.49 -><M::ManakaiNode|NodeStem||ManakaiDOM|Perl.orphanate>;
2095     }__;
2096    
2097     @Method:
2098     @@Name: getNamespaceBindingList
2099     @@enDesc:
2100     Returns the <QUOTE::live> hash reference of namespace bindings.
2101 wakaba 1.51 @@Type: DISPerl|HASH||ManakaiDOM|all
2102 wakaba 1.49 @@Param:
2103     @@@Name: databaseArg
2104     @@@Type: DISDatabase
2105     @@@enDesc:
2106     The <QUOTE::dis> database.
2107     @@Return:
2108     @@@PerlDef:
2109 wakaba 1.53 my $ods = $self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>};
2110     if ($ods->{<H::DIS|allNSBindings>}) {
2111     $r = $ods->{<H::DIS|allNSBindings>};
2112 wakaba 1.49 } else {
2113     if ($databaseArg) {
2114     for my $mod_uri (keys %{$databaseArg->{modDef}}) {
2115     my $mod = $databaseArg-><M::DISDatabase.getModule> ($mod_uri);
2116 wakaba 1.53 $ods->{<H::DIS|allNSBindings>}
2117 wakaba 1.49 ->{$mod-><AG::DISAnyResource.localName>}
2118 wakaba 1.57 = $mod-><AG::DIS|DISModule.targetNamespaceURI>;
2119 wakaba 1.48 }
2120     }
2121 wakaba 1.53 for my $prefix (keys %{$ods->{<H::swcfg21:nsBinding>}}) {
2122     $ods->{<H::DIS|allNSBindings>}->{$prefix}
2123     = $ods->{<H::swcfg21:nsBinding>}->{$prefix};
2124 wakaba 1.48 }
2125 wakaba 1.53 $r = $ods->{<H::DIS|allNSBindings>};
2126 wakaba 1.49 }
2127    
2128     @Method:
2129     @@Name: getDefaultNamespaceURIRef
2130     @@enDesc: A reference to the URI of the default namespace.
2131 wakaba 1.51 @@Type: DISPerl|SCALAR||ManakaiDOM|all
2132 wakaba 1.49 @@Return:
2133     @@@PerlDef:
2134 wakaba 1.53 my $ods = $self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>};
2135     if ($ods->{<H::DIS|defaultNamespaceURI>}) {
2136     $r = \ ($ods->{<H::DIS|defaultNamespaceURI>});
2137 wakaba 1.49 } else {
2138     __DEEP{
2139 wakaba 1.53 $r = \($ods->{<H::DIS|defaultNamespaceURI>}
2140 wakaba 1.49 = $self-><AG::DISNode.ownerDISDocument>
2141     -><AG::DISDocument.moduleElement>
2142     -><AG::DISModuleElement.definingNamespaceURI>);
2143     }__;
2144     }
2145    
2146 wakaba 1.48
2147     @Method:
2148     @@Name: preserveNodePath
2149     @@enDesc:
2150     Saves a copy of node path string.
2151     @@Return:
2152     @@@PerlDef:
2153     __DEEP{
2154     $self-><M::SWCFGNode.flag> (nodePath => $self-><M::SWCFGNode.nodePath>
2155     (key => [qw/QName Name Type type/]));
2156     }__;
2157    
2158     @Method:
2159     @@Operator:
2160     @@@ContentType:
2161     dis:TypeQName
2162     @@@@:
2163     DISPerl:CloneMethod
2164 wakaba 1.19 @@Description:
2165     @@@lang:en
2166     @@@@:
2167 wakaba 1.48 Makes a copy of this node. All child nodes are cloned and
2168     all flags and options are copied (rather than cloned).
2169     The new node does not have any parent.
2170     @@Return:
2171     @@@Type: DISElement
2172 wakaba 1.19 @@@Description:
2173     @@@@lang:en
2174     @@@@@:
2175 wakaba 1.48 The cloned node.
2176     \
2177     If this node is a document node, then the another document is made.
2178     @@@PerlDef:
2179     $r = bless $self->SUPER::clone, <ClassName::ManakaiDISElement>;
2180     ##DISElement
2181 wakaba 1.19
2182 wakaba 1.49 PropDef:
2183     @QName: allNSBindings
2184     @enDesc:
2185     Collected set of namespace bindings for a node.
2186    
2187 wakaba 1.47 IFClsDef:
2188     @IFQName: DISModuleElement
2189     @ClsQName: ManakaiDISModuleElement
2190 wakaba 1.19
2191 wakaba 1.47 @IFISA: DISElement
2192 wakaba 1.4 @ClsISA: ManakaiDISElement
2193 wakaba 1.47
2194 wakaba 1.4 @enDesc:
2195     The <Q::dis:Module> elements.
2196    
2197 wakaba 1.38 @DISLang:role:
2198     @@@:
2199     DISLang:NullRole
2200     @@DISCore:stopISARecursive:1
2201    
2202 wakaba 1.4 @Attr:
2203     @@Name: requireElement
2204     @@enDesc:
2205     The <Q::dis:Require> child element. The element is
2206     newly created if not exist.
2207 wakaba 1.47 @@Type: DISElement
2208     @@clsActualType: ManakaiDISElement
2209 wakaba 1.4 @@Get:
2210     @@@PerlDef:
2211     __DEEP{
2212 wakaba 1.29 $r = bless $self-><M::swcfg21:SWCFGNode
2213 wakaba 1.4 ::swcfg21:ForLatest.getAttributeNS>
2214 wakaba 1.29 (<Q::dis:>, 'Require', make_new_node => true),
2215     <ClassName::ManakaiDISElement>;
2216 wakaba 1.4 }__;
2217    
2218     @Attr:
2219     @@Name: defaultForURI
2220     @@enDesc:
2221     The value of <Q::dis:DefaultFor> attribute.
2222     @@Type: ForURI
2223     @@Get:
2224     @@@enDesc:
2225     The value of <Q::dis:DefaultFor> child element. If missing,
2226     <Q::ManakaiDOM:all> is returned.
2227     @@@PerlDef:
2228     __DEEP{
2229     my $df = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
2230     .getAttributeNS>
2231     (<Q::dis:>, 'DefaultFor');
2232     if ($df) {
2233 wakaba 1.29 $r = (bless $df, <ClassName::ManakaiDISElement>)
2234 wakaba 1.48 -><AG::DISElement.qnameValueURI>
2235 wakaba 1.4 || <Q::ManakaiDOM:all>;
2236     } else {
2237     $r = <Q::ManakaiDOM:all>;
2238     }
2239     }__;
2240     @@Set:
2241     @@@PerlDef:
2242     __DEEP{
2243     $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.setAttributeNS>
2244     (<Q::dis:>, 'DefaultFor' => $given);
2245     }__;
2246 wakaba 1.7
2247     @Attr:
2248     @@Name: definingNamespaceURI
2249     @@enDesc:
2250 wakaba 1.48 The value of <Q::dis:Namespace> attribute, i.e.
2251 wakaba 1.7 the URI reference of the namespace that this module primary
2252     defines.
2253     \
2254     {NOTE:: Defining namespace URI is <QUOTE::for> independent.
2255     \
2256     }
2257     @@Type: AnyURI
2258     @@Get:
2259     @@@PerlDef:
2260     __DEEP{
2261     my $df = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
2262     .getAttributeNS>
2263     (<Q::dis:>, 'Namespace');
2264     if ($df) {
2265 wakaba 1.14 $r = $df-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2266 wakaba 1.7 } else {
2267     __ASSERT{DISPerl:invariant::
2268     msg => {qq["dis:Namespace" attribute not found]},
2269     }__;
2270     }
2271     }__;
2272     @@Set:
2273     @@@PerlDef:
2274     __DEEP{
2275     $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.setAttributeNS>
2276     (<Q::dis:>, 'Namespace' => $given);
2277     }__;
2278 wakaba 1.4 ##DISModuleElement
2279    
2280 wakaba 1.47 IFClsDef:
2281     @IFQName: DISElementList
2282 wakaba 1.2 @ClsQName: ManakaiDISElementList
2283 wakaba 1.47
2284 wakaba 1.2 @enDesc:
2285     @@lang:en
2286     @@@:
2287     Lists of elements.
2288     \
2289     {NOTE:: <Class::ManakaiDISElementList> is <QUOTE::dead>;
2290     later changes to the tree does not affect this type of objects.
2291     \
2292     }
2293     ##DISElementList
2294    
2295 wakaba 1.47 IFClsDef:
2296     @IFQName: DISComment
2297 wakaba 1.1 @ClsQName: ManakaiDISComment
2298 wakaba 1.47
2299 wakaba 1.7 @ClsISA: ManakaiDISNode
2300 wakaba 1.1 @ClsISA:
2301 wakaba 1.3 swcfg21:ManakaiSWCFGComment::swcfg21:ForLatest
2302 wakaba 1.47
2303 wakaba 1.1 @Description:
2304     @@lang:en
2305     @@@:
2306     <QUOTE::dis> comment node objects.
2307     ##DISComment
2308    
2309 wakaba 1.47 IFClsDef:
2310     @IFQName: DISDocumentFragment
2311 wakaba 1.1 @ClsQName: ManakaiDISDocumentFragment
2312 wakaba 1.47
2313 wakaba 1.7 @ClsISA: ManakaiDISNode
2314 wakaba 1.1 @ClsISA:
2315 wakaba 1.3 swcfg21:ManakaiSWCFGDocumentFragment::swcfg21:ForLatest
2316 wakaba 1.47
2317 wakaba 1.1 @Description:
2318     @@lang:en
2319     @@@:
2320     <QUOTE::dis> document fragment node objects.
2321     ##DISDocumentFragment
2322    
2323 wakaba 1.47 IFClsDef:
2324     @IFQName: DISDocument
2325 wakaba 1.1 @ClsQName: ManakaiDISDocument
2326 wakaba 1.47
2327 wakaba 1.7 @ClsISA: ManakaiDISNode
2328 wakaba 1.1 @ClsISA:
2329 wakaba 1.3 swcfg21:ManakaiSWCFGDocument::swcfg21:ForLatest
2330 wakaba 1.47
2331 wakaba 1.1 @Description:
2332     @@lang:en
2333     @@@:
2334     <QUOTE::dis> document node objects.
2335 wakaba 1.2
2336     @Attr:
2337 wakaba 1.4 @@Name: moduleElement
2338     @@enDesc:
2339     The <Q::dis:Module> element in this document. The element is
2340     newly created if not exist.
2341 wakaba 1.47 @@Type: DISModuleElement
2342     @@clsActualType: ManakaiDISModuleElement
2343 wakaba 1.4 @@Get:
2344     @@@PerlDef:
2345     __DEEP{
2346     $r = $self-><M::swcfg21:SWCFGNode
2347     ::swcfg21:ForLatest.getAttributeNS>
2348     (<Q::dis:>, 'Module', make_new_node => true);
2349     }__;
2350     $r = bless $r, <ClassName::ManakaiDISModuleElement>;
2351    
2352     @Attr:
2353 wakaba 1.2 @@Name: disDatabase
2354     @@enDesc:
2355     Associated <QUOTE::dis> database.
2356    
2357 wakaba 1.47 @@Type: DISDatabase
2358     @@clsActualType: ManakaiDISDatabase
2359 wakaba 1.2 @@Get:
2360     @@@NoDBException:
2361     @@@PerlDef:
2362 wakaba 1.53 if ($self->{<H::mn:node>}->{<H::DIS|db>}) {
2363     $r = $self->{<H::mn:node>}->{<H::DIS|db>};
2364 wakaba 1.2 } else {
2365     __EXCEPTION{NO_ASSOCIATED_DB_ERR}__;
2366     }
2367     @@Set:
2368     @@@PerlDef:
2369 wakaba 1.53 $self->{<H::mn:node>}->{<H::DIS|db>} = $given;
2370 wakaba 1.2 require Scalar::Util;
2371 wakaba 1.53 Scalar::Util::weaken ($self->{<H::mn:node>}->{<H::DIS|db>});
2372 wakaba 1.5
2373     @Method:
2374     @@Name: disChildElements
2375     @@enDesc:
2376 wakaba 1.10 A list of child elements, with <QUOTE::for> checks.
2377 wakaba 1.5 @@ForParam:
2378     @@ForpParam:
2379 wakaba 1.49 @@NamedParam:
2380     @@@Name: databaseArg
2381     @@@Type: DISDatabase
2382     @@@enDesc:
2383     A <QUOTE::dis> database.
2384     @@@nullCase:
2385     @@@@enDesc:
2386     The database associated to the document is used.
2387 wakaba 1.5 @@Return:
2388 wakaba 1.47 @@@Type: DISElementList
2389     @@@clsActualType: ManakaiDISElementList
2390 wakaba 1.5 @@@enDesc:
2391     The current snapshot of child nodes.
2392     @@@PerlDef:
2393     $r = bless [], <ClassName::ManakaiDISElementList>;
2394     __DEEP{
2395 wakaba 1.47 C: for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
2396 wakaba 1.5 .childNodes>}) {
2397 wakaba 1.47 next C unless $cn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
2398 wakaba 1.5 .nodeType> eq '#element';
2399 wakaba 1.47 my $dn;
2400     __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl::
2401 wakaba 1.53 $object => {$cn->{<H::mn:node>}},
2402 wakaba 1.47 $ref => $dn,
2403     $class => {<ClassName::ManakaiDISElement>},
2404     }__;
2405     next C unless $dn-><M::ManakaiDISElement.forMatch>
2406 wakaba 1.49 ($forArg, $forpArg,
2407     database_arg => $databaseArg);
2408 wakaba 1.5 push @$r, $dn;
2409     }
2410     }__;
2411 wakaba 1.10
2412     @Method:
2413     @@Name: disAllChildElements
2414     @@enDesc:
2415     A list of child elements, without <QUOTE::for> checks.
2416     @@Return:
2417 wakaba 1.47 @@@Type: DISElementList
2418     @@@clsActualType: ManakaiDISElementList
2419 wakaba 1.10 @@@enDesc:
2420     The current snapshot of child nodes.
2421     @@@PerlDef:
2422     $r = bless [], <ClassName::ManakaiDISElementList>;
2423     __DEEP{
2424 wakaba 1.47 C: for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
2425 wakaba 1.10 .childNodes>}) {
2426 wakaba 1.47 next C unless $cn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
2427 wakaba 1.10 .nodeType> eq '#element';
2428 wakaba 1.47 my $dn;
2429     __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl::
2430 wakaba 1.53 $object => {$cn->{<H::mn:node>}},
2431 wakaba 1.47 $ref => $dn,
2432     $class => {<ClassName::ManakaiDISElement>},
2433     }__;
2434 wakaba 1.10 push @$r, $dn;
2435     }
2436     }__;
2437 wakaba 1.51
2438     @Method:
2439     @@Name: addNamespaceBinding
2440     @@Param:
2441     @@@Name: prefix
2442     @@@Type: DISLang|String||ManakaiDOM|all
2443     @@Param:
2444     @@@Name: namespaceURI
2445     @@@Type: DISLang|String||ManakaiDOM|all
2446     @@@nullCase:
2447     @@Return:
2448     @@@PerlDef:
2449     if (defined $namespaceURI) {
2450 wakaba 1.53 $self->{<H::mn:node>}->{<H::swcfg21:nsBinding>}->{$prefix}
2451 wakaba 1.51 = $namespaceURI;
2452     } else {
2453 wakaba 1.53 CORE::delete $self->{<H::mn:node>}->{<H::swcfg21:nsBinding>}
2454 wakaba 1.51 ->{$prefix};
2455     }
2456 wakaba 1.1 ##DISDocument
2457 wakaba 1.2
2458     PropDef:
2459     @QName: db
2460     @enDesc:
2461     Associated <QUOTE::dis> database.
2462     @rdfs:domain: ManakaiDISDocument
2463     @rdfs:range: ManakaiDISDatabase
2464    
2465     ## -- Definition object database
2466    
2467 wakaba 1.47 IFClsDef:
2468     @IFQName: DISDatabase
2469 wakaba 1.2 @ClsQName: ManakaiDISDatabase
2470 wakaba 1.47
2471 wakaba 1.48 @ClsISA: dp|ManakaiDISDatabasePerl
2472 wakaba 1.47 @ClsISA: ManakaiDISExceptionTarget
2473    
2474 wakaba 1.2 @enDesc:
2475     Resource database created from <QUOTE::dis> source data.
2476    
2477 wakaba 1.38 @DISLang:role: DatabaseRole
2478    
2479 wakaba 1.2 @Method:
2480     @@Name: getModule
2481     @@Description:
2482     @@@lang:en
2483     @@@@:
2484     Returns a <QUOTE::dis> module definition.
2485     @@Param:
2486 wakaba 1.9 @@@Name: moduleURI
2487 wakaba 1.2 @@@Type: ModuleURI
2488     @@@Description:
2489     @@@@lang:en
2490     @@@@@:
2491     A <QUOTE::dis> module URI reference.
2492 wakaba 1.9 @@ForParam:
2493 wakaba 1.2 @@Return:
2494 wakaba 1.47 @@@Type: DISModule
2495     @@@clsActualType: ManakaiDISModuleDefinition
2496 wakaba 1.2 @@@Description:
2497     @@@@lang:en
2498     @@@@@:
2499     The module definition.
2500     @@@PerlDef:
2501 wakaba 1.9 my $modURI;
2502     if (defined $forArg) {
2503     __CODE{tfurisToURI:: $turi => $moduleURI, $furi => $forArg,
2504     $uri => $modURI}__;
2505     } else {
2506     $modURI = $moduleURI;
2507     }
2508 wakaba 1.2 if (defined $self->{modDef}->{$modURI}) {
2509     $r = $self->{modDef}->{$modURI};
2510     } else {
2511     $r = $self->{modDef}->{$modURI}
2512     = bless {
2513     uri => $modURI,
2514     db => $self,
2515     for => <Q::ManakaiDOM:all>,
2516     forp => [],
2517     }, <ClassName::ManakaiDISModuleDefinition>;
2518     require Scalar::Util;
2519     Scalar::Util::weaken ($r->{db});
2520     }
2521    
2522     @Method:
2523     @@Name: getFor
2524     @@Description:
2525     @@@lang:en
2526     @@@@:
2527     Returns a <QUOTE::for> definition object.
2528     @@Param:
2529     @@@Name: forURI
2530     @@@Type: ForURI
2531     @@@Description:
2532     @@@@lang:en
2533     @@@@@:
2534     A <QUOTE::for> URI reference.
2535 wakaba 1.49 @@@nullCase:
2536 wakaba 1.2 @@@@Description:
2537     @@@@@lang:en
2538     @@@@@@:
2539     Defaulted to <Q::ManakaiDOM:all>.
2540     @@Return:
2541 wakaba 1.47 @@@Type: DISFor
2542     @@@clsActualType: ManakaiDISForDefinition
2543 wakaba 1.2 @@@PerlDef:
2544     $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
2545     if (defined $self->{forDef}->{$forURI}) {
2546     $r = $self->{forDef}->{$forURI};
2547 wakaba 1.55 } elsif (defined $self->{<H::DIS|resourceModuleMap>}->{$forURI}) {
2548     __DEEP{
2549     $self-><M::dp|ManakaiDISDatabasePerl.plLoadDISDatabaseModule>
2550     ($self-><M::DIS|DISDatabase.getModule>
2551     (${$self->{<H::DIS|resourceModuleMap>}->{$forURI}}));
2552     }__;
2553     unless (defined $self->{forDef}->{$forURI}) {
2554     __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
2555     DIS:uri => {$forURI},
2556     DIS:moduleURI => {${$self->{<H::DIS|resourceModuleMap>}
2557     ->{$forURI}}},
2558     }__;
2559     }
2560     $r = $self->{forDef}->{$forURI};
2561 wakaba 1.2 } else {
2562     $r = $self->{forDef}->{$forURI}
2563     = bless {
2564     uri => $forURI,
2565     isa => {<Q::ManakaiDOM:all> => true},
2566     revISA => {},
2567     db => $self,
2568     }, <ClassName::ManakaiDISForDefinition>;
2569     $self->{forDef}->{<Q::ManakaiDOM:all>}->{revISA}->{$forURI} = true;
2570     require Scalar::Util;
2571     Scalar::Util::weaken ($r->{db});
2572     }
2573    
2574     @Method:
2575     @@Name: getResource
2576     @@Description:
2577     @@@lang:en
2578     @@@@:
2579     Returns a <QUOTE::dis> resource definition.
2580     @@Param:
2581 wakaba 1.9 @@@Name: resourceURI
2582 wakaba 1.2 @@@Type: ResourceURI
2583     @@@Description:
2584     @@@@lang:en
2585     @@@@@:
2586     A <QUOTE::dis> resource URI reference.
2587 wakaba 1.3 @@@nullCase:
2588 wakaba 1.2 @@@@Description:
2589     @@@@@lang:en
2590     @@@@@@:
2591     Defaulted to <Q::DOMMain:any>.
2592 wakaba 1.9 @@ForParam:
2593 wakaba 1.2 @@Return:
2594 wakaba 1.47 @@@Type: DISResource
2595     @@@clsActualType: ManakaiDISResourceDefinition
2596 wakaba 1.2 @@@Description:
2597     @@@@lang:en
2598     @@@@@:
2599     The resource definition.
2600 wakaba 1.54 @@@RaiseException:
2601     @@@@@: DIS|RESOURCE_NOT_DEFINED_ERR
2602     @@@@enDesc:
2603     The resource should be included in database submodule but
2604     it is not.
2605 wakaba 1.2 @@@PerlDef:
2606 wakaba 1.9 $resourceURI = <Q::DOMMain:any> unless defined $resourceURI;
2607     my $resURI;
2608     if (defined $forArg) {
2609     __CODE{tfurisToURI:: $turi => $resourceURI, $furi => $forArg,
2610     $uri => $resURI}__;
2611     } else {
2612     $resURI = $resourceURI;
2613     }
2614 wakaba 1.54
2615 wakaba 1.2 if (defined $self->{resDef}->{$resURI}) {
2616     $r = $self->{resDef}->{$resURI};
2617 wakaba 1.54 } elsif (defined $self->{<H::DIS|resourceModuleMap>}->{$resURI}) {
2618     __DEEP{
2619     $self-><M::dp|ManakaiDISDatabasePerl.plLoadDISDatabaseModule>
2620     ($self-><M::DIS|DISDatabase.getModule>
2621     (${$self->{<H::DIS|resourceModuleMap>}->{$resURI}}));
2622     }__;
2623     unless (defined $self->{resDef}->{$resURI}) {
2624     __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
2625     DIS:uri => {$resURI},
2626     DIS:moduleURI => {${$self->{<H::DIS|resourceModuleMap>}
2627     ->{$resURI}}},
2628     }__;
2629     }
2630     $r = $self->{resDef}->{$resURI};
2631 wakaba 1.2 } else {
2632     $r = $self->{resDef}->{$resURI}
2633     = bless {
2634     uri => $resURI,
2635 wakaba 1.6 aliasURI => {$resURI => true},
2636 wakaba 1.2 db => $self,
2637     for => <Q::ManakaiDOM:all>,
2638     forp => [],
2639 wakaba 1.9 seq => -1,
2640 wakaba 1.2 }, <ClassName::ManakaiDISResourceDefinition>;
2641     require Scalar::Util;
2642     Scalar::Util::weaken ($r->{db});
2643     }
2644 wakaba 1.3
2645     @Method:
2646     @@Name: getSourceFile
2647     @@enDesc:
2648     Gets <QUOTE::dis> source document.
2649     @@Param:
2650     @@@Name: fileName
2651     @@@Type: FileURI
2652     @@@enDesc:
2653     A URI reference identifying a file.
2654     @@Return:
2655 wakaba 1.47 @@@Type: DISDocument
2656     @@@clsActualType: ManakaiDISDocument
2657 wakaba 1.3 @@@enDesc:
2658     The <QUOTE::dis> source document.
2659     @@@nullCase:
2660     @@@@enDesc:
2661     No document associated with that <P::fileName>.
2662     @@@PerlDef:
2663 wakaba 1.53 $r = $self->{<H::DIS|sourceFile>}->{$fileName};
2664 wakaba 1.3 @Method:
2665     @@Name: setSourceFile
2666     @@enDesc:
2667     Puts <QUOTE::dis> source document object.
2668     @@Param:
2669     @@@Name: fileName
2670     @@@Type: FileURI
2671     @@@enDesc:
2672 wakaba 1.4 A URI reference identifying a file. If there is already a
2673 wakaba 1.3 source document, then the association has been updated.
2674     @@Param:
2675     @@@Name: doc
2676 wakaba 1.47 @@@Type: DISDocument
2677     @@@clsActualType: ManakaiDISDocument
2678 wakaba 1.3 @@@enDesc:
2679     The document object to set.
2680     @@Return:
2681     @@@PerlDef:
2682 wakaba 1.53 $self->{<H::DIS|sourceFile>}->{$fileName} = $doc;
2683 wakaba 1.4
2684     @Method:
2685     @@Name: loadModule
2686     @@enDesc:
2687     Loads definitions from a <QUOTE::dis> document.
2688     @@Param:
2689     @@@Name: doc
2690 wakaba 1.47 @@@Type: DISDocument
2691     @@@clsActualType: ManakaiDISDocument
2692 wakaba 1.4 @@@enDesc:
2693     The source <QUOTE::dis> document object. Its
2694     <A::ManakaiDISDocument.disDatabase> must be this database.
2695     @@Param:
2696     @@@Name: resolver
2697     @@@Type: DISModuleResolver
2698     @@@enDesc:
2699     The resolver to convert module name into <QUOTE::dis> document object.
2700     @@ForParam:
2701 wakaba 1.32 @@NamedParam:
2702     @@@Name: onResourceRead
2703     @@@Type:
2704     Perl:CODE::ManakaiDOM:all
2705     @@@enDesc:
2706     An event handler called when a resource is read.
2707     @@@nullCase:
2708     @@@@enDesc:
2709     No event handler is read.
2710 wakaba 1.4 @@Return:
2711     @@@RaiseException:
2712     @@@@@: NO_MODULE_QNAME_ERR
2713     @@@@enDesc:
2714     The <Q::dis:Module> element must have a <Q::dis:QName> attribute.
2715     @@@RaiseException:
2716     @@@@@: UNABLE_TO_GET_MODULE_ERR
2717     @@@@enDesc:
2718     The implementation is unable to get a module source.
2719 wakaba 1.5 @@@ForDefDupException:
2720     @@@ForDefNoQNameException:
2721     @@@ResDefDupException:
2722     @@@ElementNotAllowedException:
2723 wakaba 1.7 @@@RaiseException:
2724     @@@@@:NO_REQUIRED_ATTR_ERR
2725     @@@@enDesc:
2726     The <Q::dis:Module> element does not have
2727     <Q::dis:Namespace> attribute.
2728 wakaba 1.4 @@@PerlDef:
2729     $resolver = bless $resolver, <ClassName::ManakaiDISModuleResolver>
2730     if ref $resolver eq 'CODE';
2731     ## -- Module Name, URI
2732     $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
2733     my $mod_node;
2734     my $mod_name_node;
2735     __DEEP{
2736 wakaba 1.48 $mod_node = $doc-><AG::DISDocument.moduleElement>;
2737     $mod_name_node = $mod_node-><M::SWCFGNode.getAttributeNS>
2738 wakaba 1.4 (<Q::dis:>, 'QName');
2739     unless ($mod_name_node) {
2740     __UNDEEP{
2741     __EXCEPTION{NO_MODULE_QNAME_ERR::
2742     DIS:sourceNode => {$mod_node},
2743     }__;
2744     }__;
2745     }
2746 wakaba 1.51 $mod_name_node = bless $mod_name_node, <ClassName::ManakaiDISElement>
2747     if $mod_name_node->isa (<ClassName::swcfg21:ManakaiSWCFGElement
2748     ::swcfg21:ForLatest>);
2749 wakaba 1.5 my $mod_name_uri = $mod_name_node
2750 wakaba 1.48 -><AG::DISElement.qnameValueURI>;
2751     my $mod = $self-><M::DISDatabase.getModule>
2752 wakaba 1.9 ($mod_name_uri, for_arg => $forArg);
2753 wakaba 1.4
2754 wakaba 1.48 unless ($mod-><AG::DISAnyResource.isDefined>) {
2755 wakaba 1.4 ## -- Initializes Module Definition Object
2756 wakaba 1.59 my $v = $mod_name_node-><AG::DISElement.qnameValueLocalName>;
2757     __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
2758     $result => {$mod->{localName}},
2759     $given => {$v},
2760     }__;
2761     my $ns = $mod_name_node-><AG::DISElement.qnameValueNamespaceURI>;
2762     __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
2763     $result => {$mod->{namespaceURI}},
2764     $given => {$ns},
2765     }__;
2766     __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
2767     $result => {$mod->{for}},
2768     $given => {$forArg},
2769     }__;
2770 wakaba 1.4 $mod->{src} = $mod_node;
2771 wakaba 1.48 $mod->{<Q::DIS|isDefined>} = true;
2772 wakaba 1.49 $self-><M::DISDatabase.setSourceFile> ($mod_name_uri => $doc);
2773 wakaba 1.48
2774 wakaba 1.57 $mod-><AS::DIS|ManakaiDISModuleDefinition.targetNamespaceURI>
2775     ($mod_node-><AG::DISModuleElement.definingNamespaceURI>);
2776 wakaba 1.48
2777     __CODE{dv:createValue::
2778     $result => {$mod->{<Q::DIS:sourceFile>}},
2779 wakaba 1.49 $value => {$doc-><M::SWCFGNode.flag> (<Q::swcfg21:fileName>)},
2780 wakaba 1.48 $base_type => {<Q::DISCore:String>},
2781     $type => {<Q::DISCore:String>},
2782     }__;
2783 wakaba 1.5
2784 wakaba 1.12 ## -- Loads "for" definition
2785     my $root_elements
2786 wakaba 1.48 = $doc-><M::DISDocument.disAllChildElements>;
2787     if ($mod-><AG::DISAnyResource.forURI> eq <Q::ManakaiDOM:all>) {
2788     R: for my $el (@$root_elements) {
2789     next R unless $el-><AG::SWCFGElement
2790 wakaba 1.12 .expandedURI> eq <Q::dis:ForDef>;
2791 wakaba 1.48 $self-><M::DISDatabase.loadFor> ($mod, $el);
2792 wakaba 1.12 }
2793     }
2794    
2795 wakaba 1.5 ## -- Loads "for all"
2796 wakaba 1.48 my $rmod = $self-><M::DISDatabase.getModule>
2797 wakaba 1.51 ($mod_name_uri,
2798 wakaba 1.48 for_arg => <Q::ManakaiDOM:all>);
2799     unless ($rmod-><AG::DISAnyResource.isDefined>) {
2800     my $rdoc = $resolver-><M::DISModuleResolver.uriToDocument>
2801     ($self, $rmod-><AG::DISAnyResource.uri>,
2802     $mod-><AG::DISAnyResource.namespaceURI>,
2803     $mod-><AG::DISAnyResource.localName>,
2804     <Q::ManakaiDOM:all>);
2805 wakaba 1.5 unless ($rdoc) {
2806     __UNDEEP{
2807     __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
2808 wakaba 1.48 DIS:uri => {$rmod-><AG::DISAnyResource.uri>},
2809     DIS:namespaceURI =>
2810     {$mod-><AG::DISAnyResource.namespaceURI>},
2811     DIS:localName => {$mod-><AG::DISAnyResource.localName>},
2812 wakaba 1.9 DIS:for => {<Q::ManakaiDOM:all>},
2813 wakaba 1.48 DIS:sourceNode => {$mod-><AG::DISAnyResource.sourceElement>},
2814 wakaba 1.5 }__;
2815     }__;
2816     }
2817 wakaba 1.48 $self-><M::DISDatabase.loadModule>
2818 wakaba 1.32 ($rdoc, $resolver, for_arg => <Q::ManakaiDOM:all>,
2819     on_resource_read => $onResourceRead);
2820 wakaba 1.5 } # Unless "for all" loaded
2821 wakaba 1.4
2822     ## -- Loads Required Modules
2823 wakaba 1.10 ## NOTE:: "dis:For" is not allowed since "dis:ForDef" is not read
2824 wakaba 1.48 my $req_node = $mod_node-><AG::DISModuleElement.requireElement>;
2825     for my $rm (@{$req_node-><M::DISElement.disAllChildElements>}) {
2826     next unless $rm-><AG::SWCFGElement.expandedURI> eq <Q::dis:Module>;
2827 wakaba 1.4 my ($uri, $nuri, $ln, $for);
2828 wakaba 1.48 my $mqn = $rm-><M::SWCFGNode.getAttributeNS> (<Q::dis:>, 'QName');
2829 wakaba 1.4 if ($mqn) {
2830 wakaba 1.48 my $mqv = $mqn-><M::SWCFGNode.value>;
2831 wakaba 1.51 my $mqp = ($mqn->isa (<ClassName::swcfg21:ManakaiSWCFGElement
2832     ::swcfg21:ForLatest>)
2833     ? (bless $mqn, <ClassName::ManakaiDISElement>) : $mqn)
2834 wakaba 1.48 -><M::NSResolverDIS.qnameToPair> ($mqv, node => $mqn);
2835 wakaba 1.4 ($nuri, $ln) = @$mqp;
2836     } else {
2837 wakaba 1.48 my $mn = $rm-><M::SWCFGNode.getAttributeNS> (<Q::dis:>, 'Name');
2838 wakaba 1.4 if ($mn) {
2839 wakaba 1.48 $nuri = $mod-><AG::DISAnyResource.namespaceURI>;
2840     $ln = $mn-><M::SWCFGNode.value>;
2841 wakaba 1.4 } else {
2842 wakaba 1.48 $nuri = $mod-><AG::DISAnyResource.namespaceURI>;
2843     $ln = $mod-><AG::DISAnyResource.localName>;
2844 wakaba 1.4 }
2845     }
2846 wakaba 1.48 my $wfn = $rm-><M::SWCFGNode.getAttributeNS>
2847     (<Q::dis:>, 'WithFor');
2848 wakaba 1.4 if ($wfn) {
2849 wakaba 1.51 $for = ($wfn->isa (<ClassName::swcfg21:ManakaiSWCFGElement
2850     ::swcfg21:ForLatest>)
2851     ? (bless $wfn, <ClassName::ManakaiDISElement>) : $wfn)
2852 wakaba 1.48 -><AG::DISElement.qnameValueURI>;
2853 wakaba 1.4 } else {
2854 wakaba 1.48 $for = $mod-><AG::DISAnyResource.forURI>;
2855 wakaba 1.4 }
2856 wakaba 1.48 my $rmod = $self-><M::DISDatabase.getModule>
2857 wakaba 1.9 ($nuri . $ln, for_arg => $for);
2858 wakaba 1.48 unless ($rmod-><AG::DISAnyResource.isDefined>) {
2859     my $rdoc = $resolver-><M::DISModuleResolver.uriToDocument>
2860     ($self, $rmod-><AG::DISAnyResource.uri>,
2861     $nuri, $ln, $for);
2862 wakaba 1.4 unless ($rdoc) {
2863     __UNDEEP{
2864     __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
2865 wakaba 1.48 DIS:uri => {$rmod-><AG::DISAnyResource.uri>},
2866 wakaba 1.4 DIS:namespaceURI => {$nuri},
2867     DIS:localName => {$ln},
2868     DIS:for => {$for},
2869     DIS:sourceNode => {$rm},
2870     }__;
2871     }__;
2872     }
2873 wakaba 1.48 $self-><M::DISDatabase.loadModule>
2874 wakaba 1.32 ($rdoc, $resolver, for_arg => $for,
2875     on_resource_read => $onResourceRead);
2876 wakaba 1.4 }
2877     } # Child Module elements
2878    
2879 wakaba 1.12 ## -- Loads child resources
2880 wakaba 1.48 $root_elements = $doc-><M::DISDocument.disChildElements>
2881 wakaba 1.49 (for_arg => $forArg,
2882     database_arg => $self);
2883 wakaba 1.5 for my $el (@$root_elements) {
2884 wakaba 1.48 if ($el-><AG::DISElement.isResourceElement>) {
2885     $self-><M::DISDatabase.loadResource>
2886 wakaba 1.9 ($mod, null, null, $el,
2887 wakaba 1.32 for_arg => $forArg,
2888     on_resource_read => $onResourceRead);
2889 wakaba 1.7 } else {
2890 wakaba 1.48 my $et = $el-><AG::SWCFGElement.expandedURI>;
2891 wakaba 1.7 if ({
2892 wakaba 1.5 <Q::dis:ForDef> => 1,
2893     <Q::dis:Module> => 1,
2894     <Q::dis:ImplNote> => 1,
2895 wakaba 1.7 }->{$et}) {
2896     #
2897     } else {
2898     __UNDEEP{
2899     __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR::
2900     DIS:elementType => {$et},
2901     DIS:sourceNode => {$el},
2902     DIS:uri => {$mod->{uri}},
2903     }__;
2904 wakaba 1.5 }__;
2905 wakaba 1.7 }
2906     } # element types
2907     }
2908    
2909 wakaba 1.48 my $dn = $mod_node-><M::SWCFGNode.getAttributeNS>
2910     (<Q::dis:>, 'Namespace');
2911     unless ($dn and defined $dn-><M::SWCFGNode.value>) {
2912 wakaba 1.7 __UNDEEP{
2913     __EXCEPTION{NO_REQUIRED_ATTR_ERR::
2914     DIS:elementType => {<Q::dis:Namespace>},
2915     DIS:sourceNode => {$mod_node},
2916 wakaba 1.5 }__;
2917 wakaba 1.7 }__;
2918 wakaba 1.5 }
2919     } # Unless this module loaded
2920     }__; # Deep
2921    
2922     @Method:
2923     @@Name: loadFor
2924     @@enDesc:
2925     Loads definition of a <QUOTE::for> from a <Q::dis:ForDef> element.
2926     @@Param:
2927     @@@Name: mod
2928 wakaba 1.47 @@@Type: DISModule
2929     @@@clsActualType: ManakaiDISModuleDefinition
2930 wakaba 1.5 @@@enDesc:
2931     The module in which the <QUOTE::for> to load is defined.
2932     @@Param:
2933     @@@Name: el
2934 wakaba 1.47 @@@Type: DISElement
2935 wakaba 1.5 @@@enDesc:
2936     The source <QUOTE::dis> <Q::dis:ForDef> element object.
2937     @@Return:
2938     @@@ForDefDupException:
2939     @@@ForDefNoQNameException:
2940     @@@ElementNotAllowedException:
2941     @@@PerlDef:
2942     __DEEP{
2943 wakaba 1.48 my $qn_node = $el-><M::SWCFGNode.getAttributeNS> (<Q::dis:>, 'QName');
2944 wakaba 1.5 unless ($qn_node) {
2945     __UNDEEP{
2946     __EXCEPTION{NO_FOR_QNAME_ERR::
2947 wakaba 1.48 DIS:sourceNode => {$el},
2948 wakaba 1.5 }__;
2949     }__;
2950     }
2951 wakaba 1.51 $qn_node = bless $qn_node, <ClassName::ManakaiDISElement>
2952     if $qn_node->isa (<ClassName::swcfg21:ManakaiSWCFGElement
2953     ::swcfg21:ForLatest>);
2954 wakaba 1.48 my $qn_uri = $qn_node-><AG::DISElement.qnameValueURI>;
2955     my $for = $self-><M::DISDatabase.getFor> ($qn_uri);
2956 wakaba 1.5
2957 wakaba 1.48 unless ($for-><AG::DISAnyResource.isDefined>) {
2958 wakaba 1.10 ## -- Initializes "For" Definition Object
2959 wakaba 1.5 $for->{src} = $el;
2960 wakaba 1.53 $for->{<H::DIS|isDefined>} = true;
2961     $for->{<H::DIS|definingModule>} = \ ($mod->{uri});
2962 wakaba 1.5
2963 wakaba 1.10 for my $ce (@{$el-><M::ManakaiDISElement.disAllChildElements>}) {
2964 wakaba 1.48 my $xn = $ce-><AG::SWCFGElement.expandedURI>;
2965 wakaba 1.5 if ($xn eq <Q::dis:ISA> or $xn eq <Q::dis:Implement>) {
2966 wakaba 1.48 my $sfor = $self-><M::DISDatabase.getFor>
2967     ($ce-><AG::DISElement.qnameValueURI>);
2968     $for-><M::DISFor.addISA> ($sfor);
2969     $sfor-><AS::DISAnyResource.isReferred> ($ce);
2970 wakaba 1.5 ## TODO: warn if dis:Implement
2971     } elsif ({
2972     <Q::dis:Description> => 1,
2973     <Q::dis:ImplNote> => 1,
2974     <Q::dis:FullName> => 1,
2975     <Q::dis:QName> => 1,
2976     }->{$xn}) {
2977     #
2978     } else {
2979     __UNDEEP{
2980     __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR::
2981     DIS:elementType => {$xn},
2982     DIS:sourceNode => {$ce},
2983 wakaba 1.48 DIS:uri => {$qn_uri},
2984 wakaba 1.5 }__;
2985     }__;
2986     }
2987     }
2988     } else {
2989     __UNDEEP{
2990     __EXCEPTION{FOR_ALREADY_DEFINED_ERR::
2991     DIS:sourceNode => {$el},
2992 wakaba 1.48 DIS:anotherSourceNode => {$el},
2993     DIS:uri => {$qn_uri},
2994 wakaba 1.5 }__;
2995     }__;
2996     } # isDefine?
2997     }__; # DEEP
2998    
2999     @Method:
3000     @@Name: loadResource
3001     @@enDesc:
3002     Loads definition of a <QUOTE::dis> resource from a
3003     <Q::dis:ResourceDef> element.
3004     @@Param:
3005     @@@Name: mod
3006 wakaba 1.47 @@@Type: DISModule
3007     @@@clsActualType: ManakaiDISModuleDefinition
3008 wakaba 1.5 @@@enDesc:
3009     The module in which the resource to load is defined.
3010     @@Param:
3011     @@@Name: parentResource
3012 wakaba 1.47 @@@Type: DISResource
3013     @@@clsActualType: ManakaiDISResourceDefinition
3014 wakaba 1.5 @@@enDesc:
3015 wakaba 1.7 The (static) parent resource in which the resource to load is defined.
3016 wakaba 1.5 @@@nullCase:
3017     @@@@enDesc:
3018     The resource to load is a root resource, i.e. <P::el> is
3019     a direct child of the document node.
3020     @@Param:
3021 wakaba 1.7 @@@Name: dynParent
3022 wakaba 1.47 @@@Type: DISResource
3023     @@@clsActualType: ManakaiDISResourceDefinition
3024 wakaba 1.7 @@@enDesc:
3025     The dynamic parent resource of the resource to load.
3026 wakaba 1.9 @@@nullCase:
3027 wakaba 1.7 @@@@enDesc:
3028 wakaba 1.9 If this resource is a root resource, i.e. <P::el> is
3029     a direct child of the document node.
3030 wakaba 1.7 @@Param:
3031 wakaba 1.5 @@@Name: el
3032 wakaba 1.47 @@@Type: DISElement
3033     @@@clsActualType: ManakaiDISElement
3034 wakaba 1.5 @@@enDesc:
3035     The source <QUOTE::dis> <Q::dis:ResourceDef> element object.
3036     @@ForParam:
3037     @@ForpParam:
3038 wakaba 1.32 @@NamedParam:
3039     @@@Name: onResourceRead
3040     @@@Type:
3041     Perl:CODE::ManakaiDOM:all
3042     @@@enDesc:
3043     An event handler called when a resource is read.
3044     @@@nullCase:
3045     @@@@enDesc:
3046     No event handler is read.
3047 wakaba 1.5 @@Return:
3048     @@@ResDefDupException:
3049     @@@ElementNotAllowedException:
3050 wakaba 1.49 @@@RaiseException:
3051     @@@@@: NO_RDF_TYPE_ERR
3052     @@@@enDesc:
3053     There is a resorce that does not have any <Q::rdf:type>
3054     attribute.
3055 wakaba 1.5 @@@PerlDef:
3056     $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
3057     $forpArg ||= [];
3058     __DEEP{
3059 wakaba 1.6 ## -- Node names
3060    
3061     ## Unique resource identifier generated from node id
3062 wakaba 1.50 my $node_id = $el-><AG::SWCFGNode.nodeIDRef>;
3063 wakaba 1.6 my $node_uri;
3064 wakaba 1.50 __CODE{tfpurisToURI:: $turi => {$$node_id}, $furi => $forArg,
3065 wakaba 1.6 $forp => $forpArg, $uri => $node_uri}__;
3066    
3067 wakaba 1.54 my $al_node = $el-><M::DISElement.disGetAttribute>
3068     (<Q::dis:AliasFor>, for_arg => $forArg,
3069     forp_arg => $forpArg,
3070     database_arg => $self);
3071     my $al_canon_uri;
3072     if ($al_node) {
3073     $al_canon_uri = $al_node-><M::DISElement.tfqnamesValueURI>
3074 wakaba 1.59 ($$node_id, $forArg,
3075     for_arg => $forArg,
3076     forp_arg => $forpArg,
3077     database_arg => $self);
3078 wakaba 1.54 }
3079    
3080 wakaba 1.6 ## User defined resource identifiers
3081 wakaba 1.5 my $qn_node = $el-><M::ManakaiDISElement.disGetAttribute>
3082     (<Q::dis:QName>, for_arg => $forArg,
3083 wakaba 1.49 forp_arg => $forpArg,
3084     database_arg => $self);
3085 wakaba 1.5 my $res;
3086 wakaba 1.54 ALD: {
3087 wakaba 1.5 if ($qn_node) {
3088     my $qn_uri = $qn_node-><AG::ManakaiDISElement.qnameValueURI>;
3089 wakaba 1.9 $res = $self-><M::ManakaiDISDatabase.getResource>
3090     ($qn_uri, for_arg => $forArg);
3091 wakaba 1.48 if ($res-><AG::DISAnyResource.isDefined>) {
3092 wakaba 1.54 last ALD if defined $al_canon_uri and
3093     $res->{aliasURI}->{$al_canon_uri};
3094 wakaba 1.5 __UNDEEP{
3095     __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR::
3096 wakaba 1.54 DIS:uri => {$qn_uri},
3097 wakaba 1.5 DIS:sourceNode => {$qn_node},
3098     DIS:anotherSourceNode => {$res->{src}},
3099     }__;
3100 wakaba 1.6 }__;
3101 wakaba 1.5 }
3102 wakaba 1.59 my $v = $qn_node-><AG::DIS|DISElement.qnameValueLocalName>;
3103     __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
3104     $result => {$res->{localName}},
3105     $given => {$v},
3106     }__;
3107     my $ns = $qn_node-><AG::DIS|DISElement.qnameValueNamespaceURI>;
3108     __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
3109     $result => {$res->{namespaceURI}},
3110     $given => {$ns},
3111     }__;
3112 wakaba 1.5 } else { ## Anonymous or local
3113     my $n_node = $el-><M::ManakaiDISElement.disGetAttribute>
3114     (<Q::dis:Name>, for_arg => $forArg,
3115 wakaba 1.49 forp_arg => $forpArg,
3116     database_arg => $self);
3117 wakaba 1.5 if ($n_node) {
3118     if ($parentResource) {
3119     my $puri = $parentResource->{uri};
3120     my $ru;
3121 wakaba 1.14 my $ln = $n_node-><M::swcfg21:SWCFGNode
3122     ::swcfg21:ForLatest.value>;
3123 wakaba 1.5 __CODE{getChildResourceURI:: $parentURI => $puri,
3124     $localName => $ln,
3125     $result => $ru}__;
3126 wakaba 1.9 $res = $self-><M::ManakaiDISDatabase.getResource>
3127     ($ru, for_arg => $forArg);
3128 wakaba 1.59 my $v = $n_node-><M::SWCFGNode.value>;
3129     __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
3130     $result => {$res->{localName}},
3131     $given => {$v},
3132     }__;
3133 wakaba 1.53 $res->{<H::DIS|isAnon>} = true;
3134 wakaba 1.5 } else { ## Root local name resource
3135 wakaba 1.48 my $ln = $n_node-><M::SWCFGNode.value>;
3136     my $ns_uri = $mod-><AG::DISAnyResource.sourceElement>
3137     -><AG::DISModuleElement.definingNamespaceURI>;
3138 wakaba 1.7 my $qn_uri = $ns_uri . $ln;
3139 wakaba 1.9 $res = $self-><M::ManakaiDISDatabase.getResource>
3140     ($qn_uri, for_arg => $forArg);
3141 wakaba 1.48 if ($res-><AG::DISAnyResource.isDefined>) {
3142 wakaba 1.6 __UNDEEP{
3143     __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR::
3144 wakaba 1.48 DIS:uri => {$res-><AG::DISAnyResource.uri>},
3145 wakaba 1.6 DIS:sourceNode => {$n_node},
3146 wakaba 1.48 DIS:anotherSourceNode
3147     => {$res-><AG::DISAnyResource.sourceElement>},
3148 wakaba 1.6 }__;
3149     }__;
3150     }
3151 wakaba 1.59 __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
3152     $result => {$res->{namespaceURI}},
3153     $given => {$ns_uri},
3154     }__;
3155     __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
3156     $result => {$res->{localName}},
3157     $given => {$ln},
3158     }__;
3159 wakaba 1.5 }
3160     } else {
3161 wakaba 1.48 $res = $self-><M::DISDatabase.getResource> ($node_uri);
3162 wakaba 1.53 $res->{<H::DIS|isAnon>} = true;
3163 wakaba 1.5 }
3164 wakaba 1.6 } # anon
3165 wakaba 1.59 __CODE{DISPerl|HashStringRef||ManakaiDOM|all::
3166     $result => {$res->{for}},
3167     $given => {$forArg},
3168     }__;
3169 wakaba 1.5 $res->{forp} = $forpArg;
3170     $res->{src} = $el;
3171 wakaba 1.53 $res->{<H::DIS|definingModule>} = \ ($mod->{uri});
3172 wakaba 1.55 $mod-><M::DIS|ManakaiDISModuleDefinition.addResourceList> ($res);
3173 wakaba 1.54 $res-><AS::DIS|ManakaiDISResourceDefinition.parentResource>
3174     ($parentResource) if $parentResource;
3175     $res-><AS::DIS|ManakaiDISResourceDefinition.dynamicParentResource>
3176     ($dynParent) if $dynParent;
3177 wakaba 1.9 unless ($res->{uri} eq $node_uri) {
3178 wakaba 1.48 my $nu_res = $self-><M::DISDatabase.getResource> ($node_uri);
3179     $res-><M::DISResource.mergeAsAlias> ($nu_res);
3180 wakaba 1.9 }
3181 wakaba 1.53 $res->{<H::DIS|isDefined>} = true;
3182 wakaba 1.9 $res->{seq} = $self->{seq}++;
3183 wakaba 1.50 $res-><AS::DISAnyResource.sourceNodeIDRef> ($node_id);
3184 wakaba 1.9
3185 wakaba 1.6 ## -- Alias
3186     if ($al_node) {
3187 wakaba 1.54 my $canon_res = $self-><M::DISDatabase.getResource> ($al_canon_uri);
3188 wakaba 1.48 $canon_res-><AS::DISAnyResource.isReferred> ($al_node);
3189     $canon_res-><M::DISResource.mergeAsAlias> ($res, node => $al_node);
3190 wakaba 1.6 $res = $canon_res;
3191     }
3192 wakaba 1.54 } # ALD
3193 wakaba 1.5
3194 wakaba 1.11 ## -- Registers as child
3195 wakaba 1.54 $parentResource-><M::DIS|ManakaiDISResourceDefinition
3196     .addChildResource> ($res)
3197 wakaba 1.11 if $parentResource;
3198 wakaba 1.54 $dynParent-><M::DIS|ManakaiDISResourceDefinition
3199     .addDynamicChildResource> ($res)
3200 wakaba 1.11 if $dynParent;
3201    
3202 wakaba 1.7 my $is_multires = false;
3203     my @props;
3204     my @cres;
3205 wakaba 1.48 my @ce0 = @{$el-><M::DISElement.disChildElements>
3206 wakaba 1.49 (for_arg => $forArg, forp_arg => $forpArg,
3207     database_arg => $self)};
3208     my $has_type = $al_node;
3209 wakaba 1.7 while (@ce0) {
3210     my $ce = shift @ce0;
3211 wakaba 1.49 if ($ce-><M::DISElement.elementTypeMatch> (<Q::rdf:type>,
3212     database_arg => $self)) {
3213     $has_type = true;
3214 wakaba 1.48 my $type_uri = $ce-><AG::DISElement.qnameValueURI>;
3215     my $type = $self-><M::DISDatabase.getResource> ($type_uri);
3216     $res-><M::DISResourceProp.addPropertyResourceUList>
3217     (<Q::rdf:type>, $type);
3218     $type-><AS::DISAnyResource.isReferred> ($ce);
3219     if ($type-><M::DISResource.isSubsetOfURI>
3220 wakaba 1.7 (<Q::dis:MultipleResource>)) {
3221     $is_multires = true;
3222     }
3223 wakaba 1.48 } elsif ($ce-><M::DISElement.elementTypeMatch>
3224 wakaba 1.49 (<Q::dis:subsetOf>,
3225     database_arg => $self)) {
3226 wakaba 1.48 my $sres = $self-><M::DISDatabase.getResource>
3227     ($ce-><M::DISElement.tfqnamesValueURI>
3228 wakaba 1.50 ($$node_id, $forArg,
3229 wakaba 1.49 for_arg => $forArg, forp_arg => $forpArg,
3230     database_arg => $self));
3231 wakaba 1.48 $res-><M::DISResource.addSuperResource> ($sres);
3232     } elsif ($ce-><AG::DISElement.isResourceElement>) {
3233 wakaba 1.7 push @cres, $ce;
3234 wakaba 1.48 } elsif ($ce-><M::DISElement.elementTypeMatch>
3235 wakaba 1.49 (<Q::dis:dataType>,
3236     database_arg => $self)) {
3237 wakaba 1.48 my $uri = $ce-><AG::DISElement.qnameValueURI>;
3238     __CODE{dv:createURI::
3239     $uri => $uri,
3240     $result => {$res->{<Q::dis:dataType>}},
3241     }__;
3242     my $type = $self-><M::DISDatabase.getResource> ($uri);
3243     $type-><AS::DISAnyResource.isReferred> ($ce);
3244     } elsif ($ce-><M::DISElement.elementTypeMatch>
3245 wakaba 1.49 (<Q::dis:multipleProperties>,
3246     database_arg => $self)) {
3247 wakaba 1.48 my $uri = $ce-><AG::DISElement.qnameValueURI>;
3248     __CODE{dv:createURI::
3249     $uri => $uri,
3250     $result => {$res->{<Q::dis:multipleProperties>}},
3251     }__;
3252     my $type = $self-><M::DISDatabase.getResource> ($uri);
3253     $type-><AS::DISAnyResource.isReferred> ($ce);
3254 wakaba 1.7 } else {
3255     ## Property and invalid element is not checked, since not
3256     ## all property definitions has loaded at this stage.
3257     push @props, $ce;
3258     }
3259     } # @ce0
3260    
3261 wakaba 1.49 unless ($has_type) {
3262     __UNDEEP{__EXCEPTION{NO_RDF_TYPE_ERR::
3263     DIS:uri => {$res->{uri}},
3264     DIS:sourceNode => {$el},
3265     }__}__;
3266     }
3267    
3268 wakaba 1.7 ## -- Child resources
3269     unless ($is_multires) {
3270     for my $re (@cres) {
3271     unless ($al_node) {
3272     $self-><M::ManakaiDISDatabase.loadResource>
3273     ($mod, $res, $res, $re,
3274 wakaba 1.32 for_arg => $forArg, forp_arg => $forpArg,
3275     on_resource_read => $onResourceRead);
3276 wakaba 1.5 } else {
3277 wakaba 1.7 my $ac = $re-><M::ManakaiDISElement.disGetAttribute>
3278     (<Q::dis:aliasChild>, for_arg => $forArg,
3279 wakaba 1.49 forp_arg => $forpArg,
3280     database_arg => $self);
3281 wakaba 1.48 if ($ac and $ac-><M::SWCFGNode.value>) {
3282 wakaba 1.7 $self-><M::ManakaiDISDatabase.loadResource>
3283     ($mod, $res, $res, $re,
3284 wakaba 1.32 for_arg => $forArg, forp_arg => $forpArg,
3285     on_resource_read => $onResourceRead);
3286 wakaba 1.7 }
3287 wakaba 1.4 }
3288     }
3289 wakaba 1.7 }
3290 wakaba 1.5
3291 wakaba 1.7 ## -- Multiple representations
3292     if ($is_multires) {
3293     for my $pe (@props) {
3294     if ($pe-><M::ManakaiDISElement.elementTypeMatch>
3295 wakaba 1.49 (<Q::dis:resourceFor>,
3296     database_arg => $self)) {
3297 wakaba 1.14 my $for_uri = $pe-><AG::ManakaiDISElement.qnameValueURI>;
3298 wakaba 1.7 my $for = $self-><M::ManakaiDISDatabase.getFor> ($for_uri);
3299 wakaba 1.48 $for-><AS::DISAnyResource.isReferred> ($pe);
3300 wakaba 1.7 $self-><M::ManakaiDISDatabase.loadResource>
3301     ($mod, $parentResource, $res, $el,
3302     for_arg => $forArg,
3303 wakaba 1.32 forp_arg => [@{$forpArg}, $for_uri],
3304     on_resource_read => $onResourceRead);
3305 wakaba 1.7 }
3306     }
3307     }
3308 wakaba 1.48 ($onResourceRead or sub {})->($self, $res);
3309     }__; # DEEP
3310 wakaba 1.2
3311 wakaba 1.48 @Method:
3312     @@Name: readProperties
3313     @@enDesc:
3314     Reads property values in the source tree and
3315     removes the source tree from the database.
3316     @@NamedParam:
3317     @@@Name: onResourceRead
3318     @@@Type:
3319     Perl:CODE::ManakaiDOM:all
3320     @@@enDesc:
3321     An event handler called when a resource is read.
3322     @@@nullCase:
3323     @@@@enDesc:
3324     No event handler is read.
3325     @@Return:
3326     @@@RaiseException:
3327     @@@@@: UNSUPPORTED_ELEMENT_TYPE_ERR
3328     @@@@enDesc:
3329     There is an element whose element type is not supported.
3330 wakaba 1.2 @@@PerlDef:
3331 wakaba 1.48 __DEEP{
3332     for my $fd (values %{$self->{modDef}},
3333     values %{$self->{forDef}},
3334     values %{$self->{resDef}}) {
3335     if ($fd-><AG::DISAnyResource.isDefined>) {
3336     $fd-><M::DISAnyResource.readProperties>
3337     (on_resource_read => $onResourceRead);
3338     }
3339     }
3340 wakaba 1.53 CORE::delete $self->{<H::DIS|sourceFile>};
3341 wakaba 1.48 }__;
3342 wakaba 1.10
3343 wakaba 1.48 @Method:
3344     @@Name: checkUndefinedResource
3345 wakaba 1.44 @@enDesc:
3346 wakaba 1.48 Checks whether there is referred but undefined resource or not.
3347     @@Return:
3348     @@@RaiseException:
3349     @@@@@: FOR_NOT_DEFINED_ERR
3350     @@@@enDesc:
3351     There is a <QUOTE::for> that is referred but not defined.
3352     @@@RaiseException:
3353     @@@@@: RESOURCE_NOT_DEFINED_ERR
3354     @@@@enDesc:
3355     There is a resource that is referred but not defined.
3356 wakaba 1.44 @@@PerlDef:
3357 wakaba 1.48 for my $fd (values %{$self->{forDef}}) {
3358     if (my $ref = $fd-><AG::DISAnyResource.isReferred> and
3359     not $fd-><AG::DISAnyResource.isDefined>) {
3360     __EXCEPTION{FOR_NOT_DEFINED_ERR::
3361     DIS:uri => {$fd-><AG::DISAnyResource.uri>},
3362     DIS:sourceNodePath => {$ref},
3363     }__;
3364     }
3365     }
3366     for my $fd (values %{$self->{resDef}}) {
3367     if (my $ref = $fd-><AG::DISAnyResource.isReferred> and
3368     not $fd-><AG::DISAnyResource.isDefined>) {
3369     __EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
3370     DIS:uri => {$fd-><AG::DISAnyResource.uri>},
3371     DIS:sourceNodePath => {$ref},
3372     }__;
3373     }
3374     }
3375    
3376     @Method:
3377     @@Name: xcrefToResource
3378 wakaba 1.10 @@enDesc:
3379 wakaba 1.48 Returns a resource object selected by an exception code
3380     reference (<Q::DOMMain:XCodeRef>).
3381 wakaba 1.10 @@Param:
3382 wakaba 1.48 @@@Name: xcref
3383 wakaba 1.10 @@@Type:
3384 wakaba 1.48 DOMMain:XCodeRef::ManakaiDOM:all
3385 wakaba 1.10 @@@enDesc:
3386 wakaba 1.48 Exception code to select.
3387 wakaba 1.2 @@Param:
3388 wakaba 1.48 @@@Name: contextNode
3389 wakaba 1.50 @@@Type: NSResolverDIS
3390 wakaba 1.48 @@@enDesc:
3391     A context element node. Namespace prefixes in
3392     <P::xcref> are resolved against this node.
3393     @@ForParam:
3394     @@NodeParam:
3395 wakaba 1.2 @@Return:
3396     @@@Type:
3397 wakaba 1.48 Perl:ARRAY::ManakaiDOM:all
3398     @@@enDesc:
3399     A reference to the array containing two or three
3400     resource definitions (<Class::ManakaiDISResourceDefinition>).
3401     The first (index <CODE::0>) resource is an exception class.
3402     The second (index <CODE::1>) resource is an exception code
3403     constant. The third (index <CODE::2>) resource
3404     is an exception subtype or <DOM::null> if the reference identifies
3405     no subtype.
3406     @@@RaiseException:
3407     @@@@@: RESOURCE_NOT_DEFINED_ERR
3408 wakaba 1.2 @@@@enDesc:
3409 wakaba 1.48 The resource identified by the <P::xcref> is not defined
3410     or not an exception.
3411 wakaba 1.2 @@@PerlDef:
3412 wakaba 1.48 my ($q1, $q2, $q3) = split /\s*\.\s*/, $xcref, 3;
3413     __DEEP{
3414     if (defined $q3) {
3415     $r->[2] = $self-><M::ManakaiDISDatabase.getResource>
3416     ($contextNode-><M::NSResolverDIS.tfqnamesToURI>
3417     ($q3, null, $forArg, node => $node));
3418 wakaba 1.54 $r->[1] = $r->[2]-><AG::DIS|DISResource.parentResource>;
3419 wakaba 1.48 } elsif (defined $q2) {
3420     if ($q2 =~ /:/) {
3421     $r->[1] = $self-><M::ManakaiDISDatabase.getResource>
3422     ($contextNode-><M::NSResolverDIS.tfqnamesToURI>
3423     ($q2, null, $forArg, node => $node));
3424     } else {
3425     $r->[0] = $self-><M::ManakaiDISDatabase.getResource>
3426     ($contextNode-><M::NSResolverDIS.tfqnamesToURI>
3427     ($q1, null, $forArg, node => $node));
3428     $r->[1] = $r->[0]-><M::ManakaiDISResourceDefinition
3429     .getConstResourceByName> ($q2);
3430     }
3431     } else { ## $q1 only
3432     $r->[2] = $self-><M::ManakaiDISDatabase.getResource>
3433     ($contextNode-><M::NSResolverDIS.tfqnamesToURI>
3434     ($q1, null, $forArg, node => $node));
3435     if ($r->[2]-><M::ManakaiDISResourceDefinition
3436     .isTypeURI> (<Q::ManakaiDOM:ExceptionOrWarningSubType>)) {
3437 wakaba 1.54 $r->[1] = $r->[2]-><AG::DIS|DISResource.parentResource>;
3438 wakaba 1.48 } else {
3439     $r->[1] = $r->[2]; CORE::delete $r->[2];
3440     }
3441     }
3442 wakaba 1.2
3443 wakaba 1.48 if ($r->[2] and
3444     not $r->[2]-><M::ManakaiDISResourceDefinition
3445     .isTypeURI> (<Q::ManakaiDOM:ExceptionOrWarningSubType>)) {
3446     __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
3447     DIS:uri => {$r->[2]->{uri}},
3448     DIS:expectedType => {<Q::ManakaiDOM:ExceptionOrWarningSubType>},
3449     DIS:sourceNode => {$node},
3450     DIS:sourceCode => {$xcref},
3451     }__}__;
3452     }
3453     $r->[2]-><AS::DISAnyResource.isReferred>
3454     ($node or $contextNode)
3455     if $r->[2];
3456    
3457     if (not $r->[1] or
3458     not $r->[1]-><M::ManakaiDISResourceDefinition
3459     .isTypeURI> (<Q::ManakaiDOM:Const>)) {
3460     __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
3461     DIS:uri => {$r->[1]->{uri}},
3462 wakaba 1.59 DIS:localName => {$r->[1]-><AG::DIS|DISAnyResource.localName>},
3463 wakaba 1.48 DIS:expectedType => {<Q::ManakaiDOM:Const>},
3464     DIS:sourceNode => {$node},
3465     DIS:sourceCode => {$xcref},
3466     }__}__;
3467     }
3468     $r->[1]-><AS::DISAnyResource.isReferred>
3469     ($node or $contextNode);
3470 wakaba 1.5
3471 wakaba 1.48 unless ($r->[0]) {
3472 wakaba 1.54 my $cg = $r->[1]-><AG::DIS|DISResource.parentResource>;
3473     $r->[0] = $cg-><AG::DIS|DISResource.parentResource> if $cg;
3474 wakaba 1.48 }
3475     if (not $r->[0] or
3476     not $r->[0]-><M::ManakaiDISResourceDefinition
3477     .isTypeURI> (<Q::DOMException:AnyExceptionAnyClass>)) {
3478     __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
3479     DIS:uri => {$r->[0]->{uri}},
3480 wakaba 1.59 DIS:localName => {$r->[0]-><AG::DIS|DISAnyResource.localName>},
3481 wakaba 1.48 DIS:expectedType => {<Q::DOMException:AnyExceptionAnyClass>},
3482     DIS:sourceNode => {$node},
3483     DIS:sourceCode => {$xcref},
3484     }__}__;
3485 wakaba 1.5 }
3486 wakaba 1.48 $r->[0]-><AS::DISAnyResource.isReferred>
3487     ($node or $contextNode);
3488 wakaba 1.7 }__;
3489 wakaba 1.5
3490 wakaba 1.38 @Method:
3491     @@Name: getFeature
3492     @@Description:
3493     @@@lang:en
3494     @@@@:
3495     Returns a specialized object that implements the specialized
3496     interfaces of the specified feature and version.
3497     @@Param:
3498     @@@Name: feature
3499     @@@Type:
3500     DISLang:String::ManakaiDOM:all
3501     @@@actualType:
3502     ManakaiDOM:ManakaiDOMFeatureName::ManakaiDOM:ManakaiDOMLatest
3503     @@@Description:
3504     @@@@lang:en
3505     @@@@@:
3506     A feature name to request.
3507     @@Param:
3508     @@@Name: version
3509     @@@Type:
3510     DISLang:String::ManakaiDOM:all
3511     @@@actualType:
3512     ManakaiDOM:ManakaiDOMFeatureVersion::ManakaiDOM:ManakaiDOMLatest
3513     @@@Description:
3514     @@@@lang:en
3515     @@@@@:
3516     A feature version number to request.
3517     @@Return:
3518 wakaba 1.39 @@@Type:
3519     DOMMain:Object::ManakaiDOM:all
3520 wakaba 1.38 @@@Description:
3521     @@@@lang:en
3522     @@@@@:
3523     An object that implements the specialized APIs of the
3524     <P::feature> and <P::version>.
3525 wakaba 1.49 @@@nullCase:
3526     @@@@enDesc:
3527 wakaba 1.38 There is no object available that implements interfaces
3528     associated with the <P::feature> and <P::version>.
3529     @@@PerlDef:
3530     $feature =~ s/^\+//;
3531     CLASS: for my $class (grep {
3532 wakaba 1.48 $Message::Util::DIS::ManakaiDISDatabase::CompatClass{$_}
3533     } keys %Message::Util::DIS::ManakaiDISDatabase::CompatClass) {
3534 wakaba 1.38 if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) {
3535 wakaba 1.39 $r = bless {o => $self}, $class;
3536 wakaba 1.38 last CLASS;
3537     }
3538     }
3539    
3540 wakaba 1.22 @Method:
3541 wakaba 1.48 @@Name: free
3542 wakaba 1.22 @@enDesc:
3543 wakaba 1.48 Marks the database, resources in the database, and source
3544     <QUOTE::dis> document trees in the database as no longer used.
3545     @@ForCheck: ManakaiDOM|ForClass
3546 wakaba 1.22 @@Return:
3547     @@@PerlDef:
3548 wakaba 1.53 for my $file (values %{$self->{<H::DIS|sourceFile>}}) {
3549 wakaba 1.48 $file-><M::ManakaiNode|ManakaiNodeRef||ManakaiDOM|Perl.free>
3550     if $file;
3551     }
3552     CORE::delete $self->{modDef};
3553     CORE::delete $self->{forDef};
3554     CORE::delete $self->{resDef};
3555     ##DISDatabase
3556    
3557     PropDef:
3558 wakaba 1.54 @QName: DIS|resourceModuleMap
3559     @enDesc:
3560     Resource-module mapping table.
3561     @DIS:key: rm
3562     @Type: DISPerl|HASH
3563    
3564     PropDef:
3565 wakaba 1.48 @QName: sourceNodeID
3566     @enDesc:
3567     The URI reference of the source node identifier.
3568 wakaba 1.55 @rdfs:domain: DIS|DISResource||DIS|ForEmpty
3569     @DIS:key: snid
3570     @Type: DISPerl|SCALAR
3571 wakaba 1.24
3572 wakaba 1.48 PropDef:
3573 wakaba 1.55 @QName: DIS|resource
3574     @enDesc:
3575 wakaba 1.48 Resources defined in a module.
3576 wakaba 1.55 @rdfs:range: DIS|DISResource||DIS|ForEmpty
3577     @rdfs:domain: DIS|DISModule||DIS|ForEmpty
3578     @DIS:key: mres
3579     @Type: DISPerl|ARRAY
3580 wakaba 1.22
3581 wakaba 1.48 PropDef:
3582 wakaba 1.54 @QName: DIS|parentResource
3583 wakaba 1.48 @enDesc:
3584     Static parent resource. No parent for root resources.
3585 wakaba 1.54 @DIS:key: puri
3586 wakaba 1.27
3587 wakaba 1.48 PropDef:
3588 wakaba 1.54 @QName: DIS|dynamicParentResource
3589 wakaba 1.48 @enDesc:
3590     Dynamic parent resource. No parent for root resources.
3591 wakaba 1.54 @DIS:key: dpuri
3592 wakaba 1.25
3593 wakaba 1.48 PropDef:
3594 wakaba 1.54 @QName: DIS|childResource
3595 wakaba 1.48 @enDesc:
3596     Static child resources.
3597 wakaba 1.54 @DIS:key: curis
3598 wakaba 1.35
3599 wakaba 1.48 PropDef:
3600 wakaba 1.54 @QName: DIS|dynamicChildResource
3601 wakaba 1.48 @enDesc:
3602     Dynamic child resources.
3603 wakaba 1.54 @DIS:key: dcuris
3604    
3605     PropDef:
3606     @QName: DIS|key
3607     @enDesc:
3608     Property name in resource objects.
3609     @rdfs:subPropertyOf: DISPerl|propHashKey
3610     @dataType: DISCore|String
3611     @multipleProperties: DISCore|Single
3612    
3613     ResourceDef:
3614     @QName: DIS|DISResourceList
3615     @enDesc:
3616     A reference to array whose items are resource
3617     (<IF::DIS|DISAnyResource||DIS|ForEmpty>) objects.
3618     @rdfs:subClassOf: DISPerl|ARRAY
3619     @For: =ManakaiDOM|all
3620     @rdf:type: DISLang|DataType
3621     @For: DIS|ForEmpty !=DIS|ForEmpty
3622     @AliasFor:
3623     @@@@: ||ManakaiDOM|all
3624     @@@For: DIS|ForEmpty
3625 wakaba 1.38
3626 wakaba 1.48 ElementTypeBinding:
3627     @Name: ForDefDupException
3628     @ElementType:
3629     ManakaiDOM:raises
3630     @ShadowContent:
3631     @@@: FOR_ALREADY_DEFINED_ERR
3632     @@Description:
3633     @@@lang:en
3634     @@@@:
3635     The <QUOTE::for> is already defined elsewhere.
3636 wakaba 1.27
3637 wakaba 1.48 ElementTypeBinding:
3638     @Name: ForDefNoQNameException
3639     @ElementType:
3640     ManakaiDOM:raises
3641     @ShadowContent:
3642     @@@: NO_FOR_QNAME_ERR
3643     @@Description:
3644     @@@lang:en
3645     @@@@:
3646     A <Q::dis:ForDef> element must have a <Q::dis:QName> attribute.
3647 wakaba 1.22
3648 wakaba 1.48 ElementTypeBinding:
3649     @Name: ResDefDupException
3650     @ElementType:
3651     ManakaiDOM:raises
3652     @ShadowContent:
3653     @@@: RESOURCE_ALREADY_DEFINED_ERR
3654     @@Description:
3655     @@@lang:en
3656     @@@@:
3657     The <QUOTE::dis> resource is already defined elsewhere.
3658 wakaba 1.24
3659 wakaba 1.48 ElementTypeBinding:
3660     @Name: ElementNotAllowedException
3661     @ElementType:
3662     ManakaiDOM:raises
3663     @ShadowContent:
3664     @@@: ELEMENT_NOT_ALLOWED_ERR
3665     @@Description:
3666     @@@lang:en
3667     @@@@:
3668     An element has found where it is not allowed.
3669 wakaba 1.24
3670 wakaba 1.48 IFClsDef:
3671     @IFQName: DISModuleResolver
3672     @ClsQName: ManakaiDISModuleResolver
3673 wakaba 1.22
3674 wakaba 1.48 @enDesc:
3675     Objects implementing <IF::DISModuleResolver> interface
3676     are used to convert module name into <QUOTE::dis> document object.
3677     \
3678     {NOTE:: It is also acceptable to pass a <Perl::CODE> reference
3679     as a method parameter where <IF::DISModuleResolver> is
3680     expected.
3681     \
3682     }
3683 wakaba 1.24 @Method:
3684 wakaba 1.48 @@Name: uriToDocument
3685 wakaba 1.32 @@enDesc:
3686 wakaba 1.48 Returns a <QUOTE::dis> document from module name information.
3687     @@Param:
3688     @@@Name: disDB
3689     @@@Type: DISDatabase
3690     @@@clsActualType: ManakaiDISDatabase
3691     @@@enDesc:
3692     The <QUOTE::dis> database.
3693     @@Param:
3694     @@@Name: moduleURI
3695     @@@Type: ModuleURI
3696     @@@enDesc:
3697     The URI reference of the module.
3698     \
3699     {NOTE:: This parameter is redundant, since it can be
3700     composed from other three parameters.
3701     \
3702     }
3703     @@Param:
3704     @@@Name: moduleNamespaceURI
3705     @@@Type: AnyURI
3706     @@@enDesc:
3707     The namespace URI of the module name.
3708     @@Param:
3709     @@@Name: moduleLocalName
3710     @@@Type:
3711     DISCore:LocalName::ManakaiDOM:all
3712     @@@enDesc:
3713     The local name of the module name.
3714 wakaba 1.24 @@Param:
3715 wakaba 1.48 @@@Name: moduleFor
3716     @@@Type: ForURI
3717 wakaba 1.24 @@@enDesc:
3718 wakaba 1.48 The <QUOTE::for> URI reference for which the module is defined.
3719 wakaba 1.24 @@Return:
3720 wakaba 1.48 @@@Type: DISDocument
3721     @@@clsActualType: ManakaiDISDocument
3722 wakaba 1.24 @@@enDesc:
3723 wakaba 1.48 The <QUOTE::dis> document. It don't have to be a newly created
3724     object.
3725     @@@nullCase:
3726     @@@@enDesc:
3727     The method is unable to resolve the reference.
3728 wakaba 1.24 @@@PerlDef:
3729 wakaba 1.48 $r = $self->(@_);
3730    
3731     @ResourceDef:
3732     @@rdf:type: DISLang|InputProcessor
3733     @@PerlDef:
3734     $INPUT = bless $INPUT, <ClassName::ManakaiDISModuleResolver>
3735     if ref $INPUT eq 'CODE';
3736     ##DISModuleResolver
3737 wakaba 1.22
3738 wakaba 1.24 PropDef:
3739 wakaba 1.48 @QName: sourceFile
3740     @enDesc:
3741     Source <QUOTE::dis> documents.
3742     @rdfs:domain: DISDatabase
3743     @rdfs:range: DISDocument
3744    
3745     IFClsDef:
3746     @IFQName: DISAnyResource
3747     @ClsQName: ManakaiDISAnyResource
3748    
3749 wakaba 1.52 @ClsISA: DOMFeature|ManakaiHasFeatureByGetFeature||ManakaiDOM|ManakaiDOMLatest
3750    
3751 wakaba 1.24 @enDesc:
3752 wakaba 1.48 {P:: A <IF::DISAnyResource> object represents a resource defined
3753     in <QUOTE::dis> files. In <QUOTE::dis> model, resources are
3754     categorized as:
3755    
3756     - Module::: A <QUOTE::dis> module is a file entity.
3757     This kind of objects <kwd:MUST> implement the
3758     <IF::DISModule> interface.
3759    
3760     - <QUOTE::For>::: A <QUOTE::for> is a target for which
3761     resources are defined. This kind of objects
3762     <kwd:MUST> implement the <IF::DISFor> interface.
3763    
3764     - <QUOTE::dis> Resource::: Something described in <QUOTE::dis>.
3765     This kind of objects <kwd:MUST> implement the
3766     <IF::DISModule> interface.
3767 wakaba 1.24
3768 wakaba 1.48 }
3769 wakaba 1.22
3770 wakaba 1.48 The objects implementing this interface <kwd:MUST> also implement
3771     the <IF::DOMMinImpl> interface.
3772 wakaba 1.47
3773 wakaba 1.48 @Attr:
3774     @@Name: uri
3775     @@Type: AnyURI
3776     @@Description:
3777     @@@lang:en
3778     @@@@:
3779     The URI reference of the resource.
3780     @@Get:
3781     @@@enDesc:
3782     The representive URI reference of the resource.
3783 wakaba 1.21
3784 wakaba 1.48 {NOTE:: The URI might be non-persistent if the
3785     resource is not assigned a URI in <QUOTE::dis> source file,
3786     in which case a URI is randomly-generated at the
3787     time of object generation.
3788     }
3789     @@@PerlDef:
3790     $r = $self->{uri};
3791 wakaba 1.54
3792     @Attr:
3793     @@Name: uriRef
3794     @@Type: DISPerl|SCALAR||ManakaiDOM|all
3795     @@enDesc:
3796     A reference to the URI of the resource.
3797    
3798     {NOTE:: Applications <kwd:MUST-NOT> modify the referenced
3799     value directly.
3800     }
3801     @@Get:
3802     @@@PerlDef: $r = \ ($self->{uri});
3803 wakaba 1.48
3804     @Attr:
3805     @@Name: uris
3806     @@Type:
3807     Perl:Array::ManakaiDOM:all
3808     @@enDesc:
3809     A set of URIs that identifies the resource.
3810     @@Get:
3811     @@@enDesc:
3812     A reference to array in which the URIs are contained
3813     in undefined order.
3814 wakaba 1.38
3815 wakaba 1.48 {NOTE:: The array is <EM::not> live; it is only a snapshot.
3816     }
3817 wakaba 1.47
3818 wakaba 1.48 @Method:
3819     @@Name: isSameResource
3820 wakaba 1.21 @@Operator:
3821     @@@@:eq
3822     @@@ContentType:
3823     lang:Perl
3824     @@enDesc:
3825 wakaba 1.48 Whether two resources are same or not. Two resources are
3826     same if and only if their <A::DISAnyResource.uri> are
3827     equivalent as strings (i.e. in character-by-character based matching).
3828 wakaba 1.21 @@Param:
3829     @@@Name: anotherResource
3830 wakaba 1.48 @@@Type: DISAnyResource
3831 wakaba 1.21 @@@enDesc:
3832 wakaba 1.48 Another resource object to compare.
3833 wakaba 1.21 @@Return:
3834     @@@Type:
3835     DOMMain:boolean::ManakaiDOM:all
3836     @@@enDesc:
3837 wakaba 1.48 Whether two resources are same or not.
3838     @@@TrueCase:
3839     @@@@enDesc: Two resources are same.
3840     @@@FalseCase:
3841     @@@@enDesc: Two resources are different.
3842 wakaba 1.21 @@@PerlDef:
3843     if (UNIVERSAL::isa ($anotherResource,
3844 wakaba 1.48 <ClassName::ManakaiDISAnyResource>)) {
3845 wakaba 1.21 $r = $self->{uri} eq $anotherResource->{uri};
3846     }
3847 wakaba 1.2
3848     @Attr:
3849     @@Name: nameURI
3850     @@Type: NameURI
3851     @@enDesc:
3852 wakaba 1.48 The URI reference of this module, without
3853 wakaba 1.2 <QUOTE::for> identifier.
3854     @@Get:
3855 wakaba 1.49 @@@enDesc:
3856     The name URI of the resource.
3857     @@@nullCase:
3858     @@@@enDesc:
3859     The resource has no name URI.
3860    
3861     {NOTE:: A resource has no URI if and only if the resource
3862     has no local name.
3863     }
3864 wakaba 1.3 @@@PerlDef:
3865 wakaba 1.49 if (defined $self->{localName}) {
3866     $r = defined $self->{namespaceURI}
3867 wakaba 1.59 ? ${$self->{namespaceURI}} . ${$self->{localName}}
3868     : ${$self->{localName}};
3869 wakaba 1.49 }
3870 wakaba 1.2
3871     @Attr:
3872 wakaba 1.48 @@Name: localName
3873 wakaba 1.32 @@enDesc:
3874 wakaba 1.48 The local name of this module.
3875 wakaba 1.32
3876 wakaba 1.48 {NOTE:: <QUOTE::for> resources has no local name.
3877     }
3878 wakaba 1.2 @@Type:
3879 wakaba 1.3 DISCore:LocalName::ManakaiDOM:all
3880 wakaba 1.2 @@Get:
3881     @@@PerlDef:
3882 wakaba 1.59 $r = defined $self->{localName} ? ${$self->{localName}} : null;
3883 wakaba 1.2
3884     @Attr:
3885     @@Name: namespaceURI
3886     @@Type: AnyURI
3887     @@enDesc:
3888     The namespace URI of the name of this resource.
3889 wakaba 1.48
3890     {NOTE:: <QUOTE::for> resources has no namespace URI.
3891     }
3892 wakaba 1.2 @@Get:
3893     @@@PerlDef:
3894 wakaba 1.59 $r = defined $self->{namespaceURI} ? ${$self->{namespaceURI}} : null;
3895 wakaba 1.2
3896     @Attr:
3897     @@Name: forURI
3898 wakaba 1.48 @@Type: ForURI
3899 wakaba 1.2 @@enDesc:
3900 wakaba 1.48 The <QUOTE::for> URI reference for which this module is defined.
3901 wakaba 1.2 @@Get:
3902     @@@PerlDef:
3903 wakaba 1.59 $r = defined $self->{for} ? ${$self->{for}} : null;
3904 wakaba 1.2
3905     @Attr:
3906     @@Name: forpURI
3907     @@enDesc:
3908     The <QUOTE::for+> URI references for which this resource is defined.
3909 wakaba 1.48
3910     {NOTE:: <QUOTE::for> resources has no <QUOTE::for+> URI.
3911     }
3912 wakaba 1.2 @@Type: ForURIList
3913     @@Get:
3914 wakaba 1.15 @@@enDesc:
3915     List of <QUOTE::for> URI references. Note that this list is
3916     <QUOTE::dead>.
3917 wakaba 1.3 @@@PerlDef:
3918 wakaba 1.15 $r = [@{$self->{forp}}];
3919    
3920     @Method:
3921     @@Name: isForURI
3922     @@enDesc:
3923     Tests whether this resource is defined for a <QUOTE::for>
3924     or <QUOTE::for+> URI reference or not.
3925     @@Param:
3926     @@@Name:forURI
3927     @@@Type:ForURI
3928     @@@enDesc:
3929     A <QUOTE::for> URI reference to test.
3930     @@Return:
3931     @@@Type:
3932     DOMMain:boolean::ManakaiDOM:all
3933     @@@TrueCase:
3934     @@@@enDesc:
3935     This resource is for <P::forURI>.
3936     @@@FalseCase:
3937     @@@@enDesc:
3938     This resource is not for <P::forURI>.
3939     @@@PerlDef:
3940     __DEEP{
3941 wakaba 1.59 C: for my $this_for_uri (${$self->{for}||\''}, @{$self->{forp}||[]}) {
3942 wakaba 1.15 if ($this_for_uri eq $forURI) { ## Shortcut
3943     $r = true;
3944 wakaba 1.48 last C;
3945 wakaba 1.15 }
3946 wakaba 1.48 my $this_for = $self->{db}-><M::DIS|DISDatabase.getFor>
3947 wakaba 1.15 ($this_for_uri);
3948 wakaba 1.48 if ($this_for-><M::DIS|DISFor.isaURI> ($forURI)) {
3949 wakaba 1.15 $r = true;
3950 wakaba 1.48 last C;
3951 wakaba 1.15 }
3952     }
3953     }__;
3954 wakaba 1.48
3955     @Attr:
3956     @@Name: isDefined
3957 wakaba 1.2 @@Description:
3958     @@@lang:en
3959     @@@@:
3960 wakaba 1.48 Whether this module is defined or not.
3961     @@Type:
3962     DOMMain:boolean::ManakaiDOM:all
3963     @@Get:
3964     @@@PerlDef:
3965 wakaba 1.53 $r = $self->{<H::DIS|isDefined>};
3966 wakaba 1.48
3967     @Attr:
3968     @@Name: ownerModule
3969     @@enDesc:
3970     The module in which the resource is defined. If the resource
3971     is a module, the module itself is the attribute value.
3972     @@Get:
3973     @@@Type: DISModule
3974     @@@clsActualType: ManakaiDISModuleDefinition
3975     @@@enDesc:
3976     The owner module object.
3977     @@@nullCase:
3978 wakaba 1.2 @@@@enDesc:
3979 wakaba 1.48 The resource is not part of any module since
3980     its definition is not read (i.e. <A::DISAnyResource.isDefined> is
3981     <DOM::false>).
3982 wakaba 1.2 @@@PerlDef:
3983 wakaba 1.48 $r = $self->{db}
3984     -><M::DISDatabase.getModule>
3985 wakaba 1.53 (${$self->{<H::DIS|definingModule>}})
3986     if defined $self->{<H::DIS|definingModule>};
3987 wakaba 1.2
3988 wakaba 1.48 @Attr:
3989 wakaba 1.54 @@Name: ownerModuleURI
3990     @@enDesc:
3991     A URI of the owner module of the resource.
3992     @@Type: DIS|AnyURI
3993     @@nullCase:
3994     @@@enDesc:
3995     The resource does not belong to any module since the
3996     resource definition is not read yet.
3997     @@Get:
3998     @@@PerlDef:
3999     if (defined $self->{<H::DIS|definingModule>}) {
4000     $r = ${$self->{<H::DIS|definingModule>}};
4001     }
4002    
4003     @Attr:
4004     @@Name: ownerModuleURIRef
4005     @@enDesc:
4006     A reference to a URI of the owner module of the resource.
4007     @@Type: DISPerl|SCALAR||ManakaiDOM|Perl
4008     @@nullCase:
4009     @@@enDesc:
4010     The resource does not belong to any module since the
4011     resource definition is not read yet.
4012     @@Get:
4013     @@@PerlDef:
4014     $r = $self->{<H::DIS|definingModule>};
4015    
4016     @Attr:
4017 wakaba 1.48 @@Name: isReferred
4018     @@Description:
4019     @@@lang:en
4020     @@@@:
4021     Whether the resource is referenced somewhere or not.
4022     @@Type: DISLang|String||ManakaiDOM|all
4023     @@Get:
4024     @@@enDesc:
4025     A node path string that identifies the node from
4026     which the resource is referenced.
4027     @@@nullCase:
4028     The resource is not referred.
4029     @@@PerlDef:
4030 wakaba 1.53 $r = $self->{<H::DIS|isReferred>};
4031 wakaba 1.48 @@Set:
4032 wakaba 1.7 @@@enDesc:
4033 wakaba 1.48 A node path string that identifies the node from
4034     which the resource is referenced.
4035     @@@InCase:
4036     @@@@Type: DISElement
4037     @@@@enDesc:
4038     The resource is referenced by the element. It's node path
4039     string is set as the attribute value.
4040     @@@PerlDef:
4041     if (defined $given) {
4042     if (ref $given) {
4043 wakaba 1.50 if ($given->isa (<IFName::dv|DVValue>)) {
4044     $given = $given-><AG::dv|DVValue.sourceNodePath>;
4045     } else {
4046     $given = $given-><M::SWCFGNode.flag> ('nodePath') ||
4047     $given-><M::SWCFGNode.nodePath>
4048 wakaba 1.52 (key => [qw/QName Name type Type/]);
4049 wakaba 1.50 }
4050 wakaba 1.48 }
4051 wakaba 1.53 $self->{<H::DIS|isReferred>} = $given;
4052 wakaba 1.48 }
4053    
4054     @Attr:
4055     @@Name: sourceNodeID
4056     @@enDesc:
4057     The identifier URI reference of the source node.
4058     @@enDesc:
4059     @@@ForCheck: ManakaiDOM|ForClass
4060     @@@@:
4061     Modules and <QUOTE::for>s does not have source node identifier
4062     in the current implementation.
4063     @@Type: AnyURI
4064     @@Get:
4065     @@@nullCase:
4066     @@@@enDesc:
4067     The resource is not (yet) associated with any source node.
4068     @@@PerlDef:
4069 wakaba 1.53 if (defined $self->{<H::DIS:sourceNodeID>}) {
4070     $r = ${$self->{<H::DIS:sourceNodeID>}};
4071 wakaba 1.50 } else {
4072     $r = null;
4073     }
4074     @@Set:
4075     @@@PerlDef:
4076     if (defined $given) {
4077 wakaba 1.53 $self->{<H::DIS:sourceNodeID>} = \$given;
4078 wakaba 1.50 } else {
4079 wakaba 1.53 CORE::delete $self->{<H::DIS:sourceNodeID>};
4080 wakaba 1.50 }
4081    
4082     @Attr:
4083     @@Name: sourceNodeIDRef
4084     @@enDesc:
4085     The identifier URI reference of the source node.
4086     @@enDesc:
4087     @@@ForCheck: ManakaiDOM|ForClass
4088     @@@@:
4089     Modules and <QUOTE::for>s does not have source node identifier
4090     in the current implementation.
4091     @@Type: pl|SCALAR||ManakaiDOM|all
4092     @@Get:
4093     @@@nullCase:
4094     @@@@enDesc:
4095     The resource is not (yet) associated with any source node.
4096     @@@PerlDef:
4097 wakaba 1.53 $r = $self->{<H::DIS:sourceNodeID>};
4098 wakaba 1.48 @@Set:
4099 wakaba 1.7 @@@PerlDef:
4100 wakaba 1.50 if (defined $given) {
4101 wakaba 1.53 $self->{<H::DIS:sourceNodeID>} = $given;
4102 wakaba 1.50 } else {
4103 wakaba 1.53 CORE::delete $self->{<H::DIS:sourceNodeID>};
4104 wakaba 1.50 }
4105 wakaba 1.7
4106 wakaba 1.2 @Attr:
4107 wakaba 1.48 @@Name: isAnonymous
4108     @@enDesc:
4109     Whether the resource has persistent name or not.
4110     @@Type:
4111 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
4112 wakaba 1.2 @@Get:
4113     @@@TrueCase:
4114 wakaba 1.48 This resource does <EM::not> have any globally unique name.
4115     <A::DISAnyResource.uri> is a temporary URI reference.
4116 wakaba 1.2 @@@FalseCase:
4117 wakaba 1.48 This resource does have its formal name.
4118     <A::DISAnyResource.uri> is a URI reference
4119     generated from the name and the <QUOTE::for> URI reference
4120     of this resource.
4121 wakaba 1.2 @@@PerlDef:
4122 wakaba 1.53 $r = $self->{<H::DIS|isAnon>};
4123 wakaba 1.2
4124     @Attr:
4125 wakaba 1.48 @@Name: sourceElement
4126     @@enDesc:
4127     The source <QUOTE::dis> element node from which this
4128     definition is read.
4129 wakaba 1.2 @@Get:
4130 wakaba 1.48 @@@Type: DISElement
4131     @@@clsActualType: ManakaiDISElement
4132     @@@InCase:
4133     @@@@Type: DISModuleElement
4134     @@@@clsActualType: ManakaiDISModuleElement
4135     @@@@enDesc: If this resource is a module.
4136     @@@PerlDef: $r = $self->{src};
4137 wakaba 1.2 @@@nullCase:
4138 wakaba 1.48 @@@@enDesc:
4139     The definition is not yet read.
4140 wakaba 1.2
4141     @Attr:
4142 wakaba 1.48 @@Name: database
4143     @@enDesc:
4144     The <QUOTE::dis> database to which the resource belongs.
4145     @@Type: DISDatabase
4146     @@clsActualType: ManakaiDISDatabase
4147 wakaba 1.2 @@Get:
4148     @@@PerlDef:
4149 wakaba 1.48 $r = $self->{db};
4150    
4151 wakaba 1.6 @Method:
4152 wakaba 1.48 @@Name: readProperties
4153 wakaba 1.6 @@enDesc:
4154 wakaba 1.48 Reads property values in the source tree and
4155     removes reference to the source node.
4156     @@NamedParam:
4157     @@@Name: onResourceRead
4158     @@@Type:
4159     Perl:CODE::ManakaiDOM:all
4160 wakaba 1.6 @@@enDesc:
4161 wakaba 1.48 An event handler called when a resource is read.
4162     @@@nullCase:
4163     @@@@enDesc:
4164     No event handler is read.
4165 wakaba 1.6 @@Return:
4166 wakaba 1.11 @@@RaiseException:
4167 wakaba 1.48 @@@@@: UNSUPPORTED_ELEMENT_TYPE_ERR
4168     @@@@enDesc:
4169     There is an element whose element type is not supported.
4170 wakaba 1.11 @@@PerlDef:
4171 wakaba 1.6 __DEEP{
4172 wakaba 1.48 if (my $src = $self->{src}) {
4173 wakaba 1.49 my $for = $self-><AG::DISAnyResource.forURI>;
4174     my $forp = $self-><AG::DISAnyResource.forpURI>;
4175     my $db = $self-><AG::DISAnyResource.database>;
4176 wakaba 1.48 for my $el (@{$src-><M::DISElement.disChildElements>
4177 wakaba 1.49 (for_arg => $for,
4178     forp_arg => $forp,
4179     database_arg => $db)}) {
4180 wakaba 1.48 my $xu = $el-><AG::SWCFGElement.expandedURI>;
4181     if ({
4182     <Q::dis:AliasFor> => true,
4183     <Q::dis:ContentType> => true,
4184     <Q::dis:dataType> => true,
4185     <Q::dis:For> => true,
4186     <Q::dis:ForCheck> => true,
4187     <Q::dis:Name> => true,
4188     <Q::dis:Namespace> => true,
4189     <Q::dis:multipleProperties> => true,
4190     <Q::rdf:type> => true,
4191     <Q::dis:QName> => true,
4192     <Q::dis:Require> => true,
4193     <Q::dis:resourceFor> => true,
4194     }->{$xu}) {
4195     #
4196 wakaba 1.49 } elsif ($el-><M::DISElement.isPropertyElement>
4197     (database_arg => $db)) {
4198 wakaba 1.48 my $add_prop;
4199     $add_prop = sub ($$$) {
4200     my ($self, $el, $db) = @_;
4201     my $prop = $db-><M::DISDatabase.getResource>
4202     ($el-><AG::SWCFGElement.expandedURI>);
4203     my $prop_uri = $prop-><AG::DISAnyResource.uri>;
4204     my $prop_mult = $prop-><AG::DISResource.multiplePropertiesURI>;
4205     my $new_value;
4206     my $base_type;
4207     my $copy_tree = false;
4208    
4209 wakaba 1.49 my %mtopt = (for_arg => $for,
4210     forp_arg => $forp,
4211 wakaba 1.48 default_media_type => $prop-><AG::DISResource
4212 wakaba 1.49 .defaultLextypeURI>,
4213     database_arg => $db);
4214 wakaba 1.51 my $new_value_type = $el-><M::DISElement.mediaTypeURI>(%mtopt);
4215    
4216 wakaba 1.48 if ($el-><M::DISElement.mediaTypeMatch>
4217     (<Q::dis:TypeQName>, $mtopt{default_media_type}, %mtopt)) {
4218     __CODE{dv|createValue::
4219     $value => {null},
4220     $base_type => {$base_type = <Q::dis:TypeQName>},
4221 wakaba 1.50 $type => {$new_value_type},
4222 wakaba 1.48 $result => $new_value,
4223     }__;
4224     $new_value-><AS::dv|DVQNameValue.localName>
4225     ($el-><AG::DISElement.qnameValueLocalName>);
4226     $new_value-><AS::dv|DVQNameValue.prefix>
4227 wakaba 1.49 (my $prefix = $el-><AG::DISElement.qnameValuePrefix>);
4228     if (not defined $prefix) {
4229     if ($el-><M::DISElement.mediaTypeMatch>
4230     (<Q::DISCore:LanguageTag>,
4231     $mtopt{default_media_type}, %mtopt)) {
4232     $new_value-><AS::dv|DVQNameValue.namespaceURI>
4233     ('urn:x-suika-fam-cx:lang:');
4234     } elsif ($el-><M::DISElement.mediaTypeMatch>
4235     (<Q::DISCore:ScriptTag>,
4236     $mtopt{default_media_type}, %mtopt)) {
4237     $new_value-><AS::dv|DVQNameValue.namespaceURI>
4238     ('http://suika.fam.cx/~wakaba/archive/2005/5/script#');
4239     } else {
4240     $new_value-><AS::dv|DVQNameValue.namespaceURI>
4241     ($el-><AG::DISElement.qnameValueNamespaceURI>);
4242     }
4243     } else {
4244     $new_value-><AS::dv|DVQNameValue.namespaceURI>
4245     ($el-><AG::DISElement.qnameValueNamespaceURI>);
4246     }
4247 wakaba 1.48 ## TODO: Check whether defined
4248     } elsif ($el-><M::DISElement.mediaTypeMatch>
4249     (<Q::dis:TFQNames>, $mtopt{default_media_type}, %mtopt) or
4250     $el-><M::DISElement.mediaTypeMatch>
4251     (<Q::DISCore:TFPQNames>, $mtopt{default_media_type}, %mtopt)) {
4252     __CODE{dv|createURI::
4253     $uri => {$el-><M::DISElement.tfqnamesValueURI>
4254     ($self-><AG::DISAnyResource.sourceNodeID>,
4255     $self-><AG::DISAnyResource.forURI>,
4256     for_arg => $self-><AG::DISAnyResource.forURI>,
4257 wakaba 1.49 forp_arg => $self-><AG::DISAnyResource.forpURI>,
4258     database_arg => $db)},
4259 wakaba 1.48 $result => $new_value,
4260     }__;
4261     ## TODO: Check whether defined
4262 wakaba 1.50 $new_value_type = <Q::DISCore:URI>;
4263 wakaba 1.48 } elsif ($el-><M::DISElement.mediaTypeMatch>
4264     (<Q::lang:Perl>, $mtopt{default_media_type},
4265     %mtopt)) {
4266     $el-><M::DISElement.preserveNodePath>;
4267 wakaba 1.50 __CODE{dv|createValueRef::
4268     $value_ref => {$el-><AG::SWCFGNode.valueRef>},
4269 wakaba 1.49 $base_type => {$base_type = <Q::lang:Perl>},
4270 wakaba 1.50 $type => {$new_value_type},
4271 wakaba 1.48 $result => $new_value,
4272     }__;
4273     for my $p (<Q::dis:Type>, <Q::dis:actualType>) {
4274     if (UNIVERSAL::isa ($self->{$p},<IFName::dv|DVURIValue>)) {
4275     my $v;
4276     __CODE{dv|createURI::
4277     $uri => {$self->{$p}-><AG::dv|DVURIValue.uri>},
4278     $result => $v,
4279     }__;
4280     $new_value-><M::dv|DVValue.setProperty> ($p => $v);
4281     }
4282     }
4283 wakaba 1.49 $new_value-><AS::dv|DVNSValue.defaultNamespaceURIRef>
4284     ($el-><M::DISElement.getDefaultNamespaceURIRef>);
4285     $new_value-><AS::dv|DVNSValue.namespaceBindingList>
4286     ($el-><M::DISElement.getNamespaceBindingList> ($db));
4287     $new_value-><AS::dv|DVValue.sourceNodePath>
4288     ($el-><M::SWCFGNode.flag> ('nodePath'));
4289 wakaba 1.48 } elsif ($el-><M::DISElement.mediaTypeMatch>
4290     (<Q::lang:disdoc>, $mtopt{default_media_type},
4291     %mtopt) or
4292     $el-><M::DISElement.mediaTypeMatch>
4293     (<Q::lang:disdocInline>, $mtopt{default_media_type},
4294 wakaba 1.49 %mtopt) or
4295     $el-><M::DISElement.mediaTypeMatch>
4296     (<Q::lang:muf>, $mtopt{default_media_type},
4297     %mtopt)) {
4298     $el-><M::DISElement.preserveNodePath>;
4299 wakaba 1.50 __CODE{dv|createValueRef::
4300     $value_ref => {$el-><AG::SWCFGNode.valueRef>},
4301 wakaba 1.49 $base_type => {$base_type = <Q::lang:disdoc>},
4302 wakaba 1.50 $type => $new_value_type,
4303 wakaba 1.49 $result => $new_value,
4304     }__;
4305     $new_value-><AS::dv|DVNSValue.defaultNamespaceURIRef>
4306     ($el-><M::DISElement.getDefaultNamespaceURIRef>);
4307     $new_value-><AS::dv|DVNSValue.namespaceBindingList>
4308     ($el-><M::DISElement.getNamespaceBindingList> ($db));
4309     $new_value-><AS::dv|DVValue.sourceNodePath>
4310     ($el-><M::SWCFGNode.flag> ('nodePath'));
4311     } elsif ($el-><M::DISElement.mediaTypeMatch>
4312 wakaba 1.52 (<Q::dx|XCRef>,
4313     $mtopt{default_media_type}, %mtopt)) {
4314     my $x = $db-><M::DISDatabase.xcrefToResource>
4315     ($el-><M::SWCFGNode.value>,
4316 wakaba 1.59 $el, node => $el,
4317     for_arg => $self-><AG::DIS|DISAnyResource.forURI>);
4318 wakaba 1.52 __CODE{dv|createURI::
4319     $uri => {($x->[2] or $x->[1] or $x->[0])
4320     -><AG::DISAnyResource.uri>},
4321     $result => $new_value,
4322     }__;
4323     $new_value-><M::dv|DVURIValue.getResource> ($db)
4324     -><AS::DISAnyResource.isReferred> ($el);
4325     $new_value_type = <Q::DISCore:URI>;
4326     } elsif ($el-><M::DISElement.mediaTypeMatch>
4327     (<Q::DISLang|MemberRef>,
4328     $mtopt{default_media_type}, %mtopt)) {
4329     my $v = $el-><M::SWCFGNode.value>;
4330     $v =~ s/^\s+//; $v =~ s/\s+$//;
4331     my ($clsq, $mem, $gs) = split /\s*\.\s*/, $v, 3;
4332     my $res;
4333     if (defined $mem) {
4334     my $cls = $db-><M::DISDatabase.getResource>
4335     ($el-><M::DISElement.tfqnamesValueURI>
4336     ($clsq, $self-><AG::DISAnyResource.sourceNodeID>,
4337     $self-><AG::DISAnyResource.forURI>, node => $el));
4338     $cls-><AS::DISAnyResource.isReferred> ($el);
4339     $res = $cls-><M::DISResource.getChildResourceByNameAndType>
4340     ($mem, <Q::DISLang:AnyMethod>);
4341     unless ($res) {
4342     __UNDEEP{__EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
4343     DIS:localName => {$mem},
4344     DIS:parentURI => {$cls-><AG::DISAnyResource.uri>},
4345     DIS:elementType => {$el-><AG::SWCFGElement
4346     .expandedURI>},
4347     DIS:sourceNode => {$el},
4348     DIS:sourceCode => {$v},
4349     DIS:expectedType => {
4350     defined $gs ? <Q::DISLang:Attribute>
4351     : <Q::DISLang:Method>
4352     },
4353     }__}__;
4354     }
4355     if (defined $gs) {
4356     $res = $res-><M::DISResource.getChildResourceByType>
4357     ($gs eq 'get' ? <Q::DISLang|AttributeGet>
4358     : <Q::DISLang|AttributeSet>);
4359     unless ($res) {
4360     __UNDEEP{__EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
4361     DIS:parentURI => {$res-><AG::DISAnyResource.uri>},
4362     DIS:elementType => {$el-><AG::SWCFGElement
4363     .expandedURI>},
4364     DIS:sourceNode => {$el},
4365     DIS:sourceCode => {$v},
4366     DIS:expectedType => {
4367     $gs eq 'get' ? <Q::DISLang:AttributeGet>
4368     : <Q::DISLang:AttributeSet>
4369     },
4370     }__}__;
4371     }
4372     }
4373     } else {
4374     $res = $db-><M::DISDatabase.getResource>
4375     ($el-><M::DISElement.tfqnamesValueURI>
4376     ($clsq, $self-><AG::DISAnyResource.sourceNodeID>,
4377     $self-><AG::DISAnyResource.forURI>, node => $el));
4378     }
4379     $res-><AS::DISAnyResource.isReferred> ($el);
4380     __CODE{dv|createURI::
4381     $uri => {$el-><AG::DISAnyResource.uri>},
4382     $result => $new_value,
4383     }__;
4384     $new_value_type = <Q::DISCore:URI>;
4385     } elsif ($el-><M::DISElement.mediaTypeMatch>
4386 wakaba 1.49 (<Q::lang:dis>, $mtopt{default_media_type},
4387     %mtopt)) {
4388     $copy_tree = true;
4389 wakaba 1.48 $el-><M::DISElement.preserveNodePath>;
4390     my $elc = $el->clone;
4391     __CODE{dv|createValue::
4392     $value => {$elc},
4393 wakaba 1.49 $base_type => {$base_type = <Q::lang:dis>},
4394 wakaba 1.50 $type => $new_value_type,
4395 wakaba 1.48 $result => $new_value,
4396     }__;
4397 wakaba 1.49 $elc-><M::DISElement.unlinkFromDocument> ($db);
4398 wakaba 1.48 } else {
4399     __CODE{dv|createValue::
4400     $value => {$el-><M::SWCFGNode.value>},
4401     $base_type => {$base_type = <Q::DISCore:String>},
4402 wakaba 1.50 $type => $new_value_type,
4403 wakaba 1.48 $result => $new_value,
4404     }__;
4405     }
4406    
4407     unless ($copy_tree) {
4408     for my $ce (@{$el-><M::DISElement.disChildElements>
4409 wakaba 1.49 (for_arg => $for,
4410     forp_arg => $forp,
4411     database_arg => $db)}) {
4412 wakaba 1.48 my $xu = $ce-><AG::SWCFGElement.expandedURI>;
4413     if ({
4414     <Q::dis:AliasFor> => true,
4415     <Q::dis:For> => true,
4416     <Q::dis:ForCheck> => true,
4417     <Q::dis:ContentType> => true,
4418     <Q::dis:resourceFor> => true,
4419     }->{$xu}) {
4420     #
4421 wakaba 1.49 } elsif ($ce-><M::DISElement.isPropertyElement>
4422     (database_arg => $db)) {
4423 wakaba 1.48 my $pr;
4424     __DEEP{
4425     $pr = $add_prop->($self, $ce, $db);
4426     }__;
4427     if ($pr->{prop_mult} eq <Q::DISCore|OrderedList>) {
4428     my $cpv = $new_value-><M::dv|DVValue.getProperty> ($xu);
4429     if (not $cpv) {
4430     __CODE{dv|createOrderedList::
4431     $result => {$cpv},
4432     $type => {$mtopt{default_media_type}},
4433     $base_type => {<Q::DISCore:String>},
4434     }__;
4435     $new_value-><M::dv|DVValue.setProperty> ($xu => $cpv);
4436     }
4437     $cpv-><M::dv|DVList.addItem> ($pr->{new_value});
4438     } elsif ($pr->{prop_mult} eq <Q::DISCore|UnorderedList>) {
4439     my $cpv = $new_value-><M::dv|DVValue.getProperty> ($xu);
4440     if (not $cpv) {
4441     __CODE{dv|createUnorderedList::
4442     $result => {$cpv},
4443     $type => {$mtopt{default_media_type}},
4444     $base_type => {<Q::DISCore:String>},
4445     }__;
4446     $new_value-><M::dv|DVValue.setProperty> ($xu => $cpv);
4447     }
4448     $cpv-><M::dv|DVList.addItem> ($pr->{new_value});
4449     } else {
4450     $new_value-><M::dv|DVValue.setProperty>
4451     ($xu => $pr->{new_value});
4452     }
4453     } else {
4454     __UNDEEP{__EXCEPTION{UNSUPPORTED_ELEMENT_TYPE_ERR::
4455     DIS:elementType => {$xu},
4456     DIS:sourceNode => {$ce},
4457     }__}__;
4458     }
4459     }} # copy_tree
4460    
4461     {new_value => $new_value, base_type => $base_type,
4462 wakaba 1.50 prop_uri => $prop_uri, prop_mult => $prop_mult,
4463     new_value_type => $new_value_type};
4464 wakaba 1.48 };
4465    
4466     my $pr;
4467     __DEEP{
4468 wakaba 1.49 $pr = $add_prop->($self, $el, $db);
4469 wakaba 1.48 }__;
4470     if ($pr->{prop_mult} eq <Q::DISCore|OrderedList>) {
4471     if (not $self->{$pr->{prop_uri}}) {
4472     __CODE{dv|createOrderedList::
4473     $result => {$self->{$pr->{prop_uri}}},
4474 wakaba 1.50 $type => {$pr->{new_value_type}},
4475 wakaba 1.48 $base_type => {$pr->{base_type} || <Q::DISCore:String>},
4476     }__;
4477     }
4478     $self->{$pr->{prop_uri}}-><M::dv|DVList.addItem>
4479     ($pr->{new_value});
4480     } elsif ($pr->{prop_mult} eq <Q::DISCore|UnorderedList>) {
4481     if (not $self->{$pr->{prop_uri}}) {
4482     __CODE{dv|createUnorderedList::
4483     $result => {$self->{$pr->{prop_uri}}},
4484 wakaba 1.50 $type => {$pr->{new_value_type}},
4485 wakaba 1.48 $base_type => {$pr->{base_type} || <Q::DISCore:String>},
4486     }__;
4487     }
4488     $self->{$pr->{prop_uri}}-><M::dv|DVList.addItem>
4489     ($pr->{new_value});
4490     } else {
4491     $self->{$pr->{prop_uri}} = $pr->{new_value};
4492     }
4493 wakaba 1.53
4494     if ($el-><M::DISElement.elementTypeMatch>
4495     (<Q::DISPerl:propHashKey>, database_arg => $db)) {
4496     $db-><M::dp|DISDatabasePerl.plAddHashKey>
4497     ($xu => $pr->{new_value}-><AG::dv|DVValue.stringValue>
4498     => $self);
4499     }
4500 wakaba 1.48 } elsif ($el-><AG::DISElement.isResourceElement>) {
4501     ## TODO: Should rdf:type be validated?
4502     } else {
4503     __UNDEEP{__EXCEPTION{UNSUPPORTED_ELEMENT_TYPE_ERR::
4504     DIS:elementType => {$xu},
4505     DIS:sourceNode => {$el},
4506     }__}__;
4507     }
4508 wakaba 1.6 }
4509 wakaba 1.48 CORE::delete $self->{src};
4510     ($onResourceRead or sub () {})->($self, $self);
4511 wakaba 1.6 }
4512     }__;
4513 wakaba 1.48 ##DISAnyResource
4514    
4515     IFClsDef:
4516     @IFQName: DISModule
4517     @ClsQName: ManakaiDISModuleDefinition
4518    
4519     @ClsISA: ManakaiDISPropertyAccessor
4520     @ClsISA: ManakaiDISExceptionTarget
4521     @ClsISA: ManakaiDISPerlModuleDefinition
4522     @ClsISA: dp|ManakaiDISModulePerl
4523     @ClsISA: dp|ManakaiDISAnyResourcePerl
4524     @ClsISA: ManakaiDISAnyResource
4525    
4526     @Implement: DOMMinImpl
4527    
4528     @enDesc:
4529     <QUOTE::dis> module definitions.
4530    
4531     @enDesc:
4532     @@ForCheck: ManakaiDOM|ForIF
4533     @@@:
4534     The objects implementing the <IF::DISModule> interface <kwd:MUST>
4535     also implement the <IF::DISAnyResource> interface.
4536 wakaba 1.7
4537 wakaba 1.48 @DISLang:role: ModuleRole
4538    
4539     @Attr:
4540     @@ForCheck: ManakaiDOM|ForClass
4541     @@Name: uris
4542     @@Type:
4543     Perl:Array::ManakaiDOM:all
4544 wakaba 1.7 @@enDesc:
4545 wakaba 1.48 A reference to the snapshot array containing the URI reference
4546     of the module.
4547     @@Get:
4548 wakaba 1.7 @@@PerlDef:
4549 wakaba 1.48 $r = [$self->{uri}];
4550 wakaba 1.8
4551     @Attr:
4552 wakaba 1.48 @@ForCheck: ManakaiDOM|ForClass
4553     @@Name: ownerModule
4554     @@ManakaiDOM:isRedefining:1
4555 wakaba 1.8 @@enDesc:
4556 wakaba 1.48 This module itself.
4557     @@Get:
4558     @@@Type: DISModule
4559     @@@clsActualType: ManakaiDISModuleDefinition
4560     @@@nullCase:
4561     @@@@enDesc:
4562     The resource is not part of any module since
4563     its definition is not read (<IF::DISModule.isDefined> is <DOM::false>).
4564     @@@PerlDef: $r = $self;
4565    
4566     @Method:
4567     @@ForCheck: ManakaiDOM|ForClass
4568     @@Name: getFeature
4569     @@Description:
4570     @@@lang:en
4571     @@@@:
4572     Returns a specialized object that implements the specialized
4573     interfaces of the specified feature and version.
4574     @@Param:
4575     @@@Name: feature
4576     @@@Type:
4577     DISLang:String::ManakaiDOM:all
4578     @@@actualType: DOMFeature|FeatureNameString||ManakaiDOM|ManakaiDOMLatest
4579     @@@Description:
4580     @@@@lang:en
4581     @@@@@:
4582     A feature name to request.
4583     @@Param:
4584     @@@Name: version
4585     @@@Type:
4586     DISLang:String::ManakaiDOM:all
4587     @@@actualType:
4588     DOMFeature|FeatureVersionString||ManakaiDOM|ManakaiDOMLatest
4589     @@@Description:
4590     @@@@lang:en
4591     @@@@@:
4592     A feature version number to request.
4593     @@Return:
4594     @@@Type:
4595     DOMMain:Object::ManakaiDOM:all
4596     @@@Description:
4597     @@@@lang:en
4598     @@@@@:
4599     An object that implements the specialized APIs of the
4600     <P::feature> and <P::version>.
4601 wakaba 1.49 @@@nullCase:
4602     @@@@enDesc:
4603 wakaba 1.48 There is no object available that implements interfaces
4604     associated with the <P::feature> and <P::version>.
4605     @@@PerlDef:
4606     $feature =~ s/^\+//;
4607     CLASS: for my $class (grep {
4608     $Message::Util::DIS::ManakaiDISModuleDefinition::CompatClass{$_}
4609     } keys %Message::Util::DIS::ManakaiDISModuleDefinition::CompatClass) {
4610     if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) {
4611     $r = bless {o => $self}, $class;
4612     last CLASS;
4613 wakaba 1.27 }
4614 wakaba 1.8 }
4615    
4616     @Attr:
4617 wakaba 1.48 @@Name: isAnonymous
4618 wakaba 1.8 @@enDesc:
4619 wakaba 1.48 Whether the resource has persistent name or not.
4620     @@Type:
4621     DOMMain:boolean::ManakaiDOM:all
4622     @@ForCheck: ManakaiDOM|ForClass
4623 wakaba 1.8 @@Get:
4624 wakaba 1.48 @@@TrueCase:
4625 wakaba 1.8 @@@@enDesc:
4626 wakaba 1.48 A module <kwd:MUST> have a name.
4627 wakaba 1.55 @@@PerlDef: $r = false;
4628    
4629     @Method:
4630     @@Name: addResourceList
4631     @@ForCheck: ManakaiDOM|ForClass
4632     @@enDesc:
4633     Adds a resource to the list of resources belongs to the module.
4634     @@Param:
4635     @@@Name: disResource
4636     @@@Type: DIS|DISResource
4637     @@@enDesc: The resource to add.
4638     @@Return:
4639     @@@PerlDef:
4640     __DEEP{
4641     push @{$self->{<H::DIS|resource>}||=[]},
4642     $disResource-><AG::DIS|DISAnyResource.uriRef>;
4643     }__;
4644    
4645     @Method:
4646     @@Name: getResourceList
4647     @@enDesc:
4648     Returns the list of resources belongs to the module.
4649     @@Return:
4650     @@@Type: DIS|ResourceList
4651     @@@enDesc:
4652     The current snapshot of children.
4653     @@@PerlDef:
4654     __DEEP{
4655     my $db = $self-><AG::DIS|DISAnyResource.database>;
4656     $r = [map {
4657     $db-><M::DIS|DISDatabase.getResource> ($$_)
4658     } @{$self->{<H::DIS|resource>}}];
4659     }__;
4660 wakaba 1.57
4661     @Attr:
4662     @@Name: targetNamespaceURI
4663     @@enDesc:
4664     The default namespace URI of the resources defined in the module.
4665     @@Type: DIS|AnyURI
4666     @@Get:
4667     @@@PerlDef:
4668     $r = defined $self->{<H::DIS|defaultNamespaceURI>}
4669     ? ${$self->{<H::DIS|defaultNamespaceURI>}} : null;
4670     @@Set:
4671     @@@ForCheck: ManakaiDOM|ForClass
4672     @@@PerlDef:
4673     if (defined $given) {
4674     $self->{<H::DIS|defaultNamespaceURI>} = \$given;
4675     } else {
4676     CORE::delete $self->{<H::DIS|defaultNamespaceURI>};
4677     }
4678 wakaba 1.48 ##DISModule
4679 wakaba 1.55
4680     ClsDef:
4681     @ClsQName: ManakaiDISModuleLite
4682    
4683     @ClsISA: DIS|ManakaiDISAnyResource
4684 wakaba 1.57 @ClsISA: dx|ManakaiDefaultErrorHandler||ManakaiDOM|Perl
4685 wakaba 1.55
4686     @Implement: DOMMinImpl
4687     @Implement: DIS|DISResourceProp
4688     @Implement: dp|DISAnyResourcePerl
4689     @Implement: dp|DISModulePerl
4690     @Implement: dp|DISResourcePerlModule
4691    
4692     @enDesc:
4693     The <Class::ManakaiDISModuleLite> class provides very small
4694     subset of <Class::ManakaiDISModuleDefinition> class. If a
4695     method or attribute which is not implemented by the class, then
4696     the object is updated to the <Class::ManakaiDISModuleDefinition>
4697     by reading additional properties from the <QUOTE::dis> database.
4698    
4699     @Attr:
4700     @@ForCheck: ManakaiDOM|ForClass
4701     @@Name: uris
4702     @@Type:
4703     Perl:Array::ManakaiDOM:all
4704     @@enDesc:
4705     A reference to the snapshot array containing the URI reference
4706     of the module.
4707     @@Get:
4708     @@@PerlDef:
4709     $r = [$self->{uri}];
4710    
4711     @Attr:
4712     @@ForCheck: ManakaiDOM|ForClass
4713     @@Name: ownerModule
4714     @@ManakaiDOM:isRedefining:1
4715     @@enDesc:
4716     This module itself.
4717     @@Get:
4718     @@@Type: DISModule
4719     @@@clsActualType: ManakaiDISModuleDefinition
4720     @@@nullCase:
4721     @@@@enDesc:
4722     The resource is not part of any module since
4723     its definition is not read (<IF::DISModule.isDefined> is <DOM::false>).
4724     @@@PerlDef: $r = $self;
4725    
4726     @Attr:
4727     @@Name: isAnonymous
4728     @@enDesc:
4729     Whether the resource has persistent name or not.
4730     @@Type:
4731     DOMMain:boolean::ManakaiDOM:all
4732     @@ForCheck: ManakaiDOM|ForClass
4733     @@Get:
4734     @@@TrueCase:
4735     @@@@enDesc:
4736     A module <kwd:MUST> have a name.
4737     @@@PerlDef: $r = false;
4738    
4739     @Method:
4740     @@Operator:
4741     @@@@: AUTOLOAD
4742     @@@ContentType: lang|Perl
4743     @@Return:
4744     @@@PerlDef:
4745 wakaba 1.57 my $al = our $AUTOLOAD;
4746     $al =~ s/.+:://;
4747     if ($al ne 'DESTROY') {
4748    
4749 wakaba 1.55 __DEEP{
4750     $self-><AG::DIS|DISAnyResource.database>
4751     -><M::dp|ManakaiDISDatabasePerl.plLoadDISDatabaseModule> ($self);
4752     }__;
4753     if (ref $self eq <ClassName::ManakaiDISModuleLite>) {
4754     __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
4755     DIS:uri => {$self-><AG::DIS|DISAnyResource.uri>},
4756     DIS:moduleURI => {$self-><AG::DIS|DISAnyResource.uri>},
4757     }__;
4758     }
4759    
4760     my $code = $self->can ($al);
4761     if ($code) {
4762     goto &$code;
4763     } else {
4764     require Carp;
4765     local $Carp::CarpLevel = $Error::Level;
4766     Carp::croak (qq<Can't locate method "$AUTOLOAD">);
4767     }
4768 wakaba 1.57
4769     } # $al
4770    
4771     @Attr:
4772     @@Name: targetNamespaceURI
4773     @@enDesc:
4774     The default namespace URI of the resources defined in the module.
4775     @@Type: DIS|AnyURI
4776     @@Get:
4777     @@@PerlDef:
4778     $r = defined $self->{<H::DIS|defaultNamespaceURI>}
4779     ? ${$self->{<H::DIS|defaultNamespaceURI>}} : null;
4780 wakaba 1.55 ##DISModuleLite
4781 wakaba 1.48
4782     IFClsDef:
4783     @IFQName: DISFor
4784     @ClsQName: ManakaiDISForDefinition
4785    
4786     @ClsISA: dp|ManakaiDISAnyResourcePerl
4787     @ClsISA: ManakaiDISAnyResource
4788     @ClsISA: ManakaiDISExceptionTarget
4789    
4790     @DISLang:role: ForRole
4791    
4792     @Description:
4793     @@lang:en
4794     @@@:
4795     <QUOTE::dis> <QUOTE::for> definitions.
4796 wakaba 1.8
4797     @Attr:
4798 wakaba 1.48 @@ForCheck: ManakaiDOM|ForClass
4799     @@Name: uris
4800     @@Type:
4801     Perl:Array::ManakaiDOM:all
4802     @@actualType: ForURIList
4803 wakaba 1.15 @@enDesc:
4804 wakaba 1.48 A reference to the snapshot array containing the URI reference
4805     of the <QUOTE::for>.
4806 wakaba 1.15 @@Get:
4807     @@@PerlDef:
4808 wakaba 1.48 $r = [$self->{uri}];
4809 wakaba 1.18
4810 wakaba 1.48 @Method:
4811     @@Name: isaURI
4812     @@Description:
4813     @@@lang:en
4814     @@@@:
4815     Whether this <QUOTE::for> is-a another <QUOTE::for> or not.
4816     @@Param:
4817     @@@Name: superURI
4818     @@@Type: ForURI
4819     @@@Description:
4820     @@@@lang:en
4821     @@@@@:
4822     Another <QUOTE::for> URI reference to test.
4823     @@Return:
4824     @@@Type:
4825     DOMMain:boolean::ManakaiDOM:all
4826     @@@TrueCase:
4827     @@@@enDesc:
4828     <P::superURI> is a super-<QUOTE::for> of this <QUOTE::for>.
4829     @@@FalseCase:
4830     @@@@enDesc:
4831     <P::superURI> is not a super-<QUOTE::for> of this <QUOTE::for>.
4832 wakaba 1.18 @@@PerlDef:
4833 wakaba 1.48 $r = $self->{uri} eq $superURI ? true : $self->{isa}->{$superURI};
4834 wakaba 1.15
4835 wakaba 1.48 @Method:
4836     @@Name: addISA
4837 wakaba 1.8 @@enDesc:
4838 wakaba 1.48 Adds a <QUOTE::for> to the list of super-<QUOTE::for> of this
4839     <QUOTE::for>.
4840     @@Param:
4841     @@@Name: superFor
4842     @@@Type: DISFor
4843     @@@clsActualType: ManakaiDISForDefinition
4844 wakaba 1.8 @@@enDesc:
4845 wakaba 1.48 A <QUOTE::for> definition object.
4846     @@Return:
4847 wakaba 1.8 @@@PerlDef:
4848 wakaba 1.48 my @from = ($self->{uri},
4849     grep {$self->{revISA}->{$_}} keys %{$self->{revISA}});
4850     my @to = ($superFor->{uri},
4851     grep {$superFor->{isa}->{$_}} keys %{$superFor->{isa}});
4852 wakaba 1.8 __DEEP{
4853 wakaba 1.48 for my $from (@from) {
4854     for my $to (@to) {
4855     $self->{db}-><M::ManakaiDISDatabase.getFor>
4856     ($from)->{isa}->{$to} = true;
4857     $self->{db}-><M::ManakaiDISDatabase.getFor>
4858     ($to)->{revISA}->{$from} = true;
4859 wakaba 1.8 }
4860     }
4861     }__;
4862    
4863 wakaba 1.48 @Method:
4864     @@Name: getFeature
4865     @@Description:
4866     @@@lang:en
4867     @@@@:
4868     Returns a specialized object that implements the specialized
4869     interfaces of the specified feature and version.
4870     @@Param:
4871     @@@Name: feature
4872     @@@Type:
4873     DISLang:String::ManakaiDOM:all
4874     @@@actualType:
4875     ManakaiDOM:ManakaiDOMFeatureName::ManakaiDOM:ManakaiDOMLatest
4876     @@@Description:
4877     @@@@lang:en
4878     @@@@@:
4879     A feature name to request.
4880     @@Param:
4881     @@@Name: version
4882     @@@Type:
4883     DISLang:String::ManakaiDOM:all
4884     @@@actualType:
4885     ManakaiDOM:ManakaiDOMFeatureVersion::ManakaiDOM:ManakaiDOMLatest
4886     @@@Description:
4887     @@@@lang:en
4888     @@@@@:
4889     A feature version number to request.
4890     @@Return:
4891     @@@Type:
4892     DOMMain:Object::ManakaiDOM:all
4893     @@@Description:
4894     @@@@lang:en
4895     @@@@@:
4896     An object that implements the specialized APIs of the
4897     <P::feature> and <P::version>.
4898 wakaba 1.49 @@@nullCase:
4899     @@@@enDesc:
4900 wakaba 1.48 There is no object available that implements interfaces
4901     associated with the <P::feature> and <P::version>.
4902     @@@PerlDef:
4903     $feature =~ s/^\+//;
4904     CLASS: for my $class (grep {
4905     $Message::Util::DIS::ManakaiDISForDefinition::CompatClass{$_}
4906     } keys %Message::Util::DIS::ManakaiDISForDefinition::CompatClass) {
4907     if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) {
4908     $r = bless {o => $self}, $class;
4909     last CLASS;
4910 wakaba 1.8 }
4911     }
4912    
4913     @Attr:
4914 wakaba 1.48 @@Name: isAnonymous
4915 wakaba 1.8 @@enDesc:
4916 wakaba 1.48 Whether the resource has persistent name or not.
4917     @@Type:
4918     DOMMain:boolean::ManakaiDOM:all
4919     @@ForCheck: ManakaiDOM|ForClass
4920 wakaba 1.8 @@Get:
4921 wakaba 1.48 @@@TrueCase:
4922 wakaba 1.8 @@@@enDesc:
4923 wakaba 1.48 A <QUOTE::for> <kwd:MUST> have a name.
4924     @@@PerlDef: $r = true;
4925 wakaba 1.8
4926     @Attr:
4927 wakaba 1.48 @@ForCheck: ManakaiDOM|ForClass
4928     @@Name: forURI
4929     @@Type: ForURI
4930 wakaba 1.8 @@enDesc:
4931 wakaba 1.48 The <QUOTE::for> URI reference for which this module is defined.
4932 wakaba 1.8 @@Get:
4933 wakaba 1.48 @@@InCase:
4934     @@@@Value:
4935     @@@@@@: ManakaiDOM|all
4936     @@@@@ContentType: dis|TypeQName
4937 wakaba 1.8 @@@@enDesc:
4938 wakaba 1.48 The attribute value is always <Q::ManakaiDOM|all> for a
4939     <QUOTE::for> resource.
4940 wakaba 1.8 @@@PerlDef:
4941 wakaba 1.48 $r = <Q::ManakaiDOM|all>;
4942 wakaba 1.8
4943     @Attr:
4944 wakaba 1.48 @@Name: forpURI
4945 wakaba 1.8 @@enDesc:
4946 wakaba 1.48 The <QUOTE::for+> URI references for which this resource is defined.
4947     @@Type: ForURIList
4948 wakaba 1.8 @@Get:
4949 wakaba 1.48 @@@enDesc:
4950     List of <QUOTE::for> URI references. Note that this list is
4951     <QUOTE::dead>.
4952     @@@InCase:
4953     @@@@Value:
4954     @@@@@@: []
4955     @@@@@ContentType: lang|Perl
4956 wakaba 1.8 @@@@enDesc:
4957 wakaba 1.48 The attribute value is always an empty array reference
4958     for a <QUOTE::for> resource.
4959     @@@PerlDef: $r = [];
4960 wakaba 1.9
4961 wakaba 1.48 @Method:
4962     @@Name: isForURI
4963 wakaba 1.9 @@enDesc:
4964 wakaba 1.48 Tests whether this resource is defined for a <QUOTE::for>
4965     or <QUOTE::for+> URI reference or not.
4966 wakaba 1.9 @@Param:
4967 wakaba 1.48 @@@Name:forURI
4968     @@@Type:ForURI
4969     @@@enDesc:
4970     A <QUOTE::for> URI reference to test.
4971 wakaba 1.9 @@Return:
4972     @@@Type:
4973 wakaba 1.48 DOMMain:boolean::ManakaiDOM:all
4974     @@@TrueCase:
4975     @@@@enDesc:
4976     This resource is for <P::forURI>. The attribute
4977     always takes this value for <QUOTE::for> resources.
4978     @@@PerlDef: $r = true;
4979 wakaba 1.12
4980     @Attr:
4981 wakaba 1.48 @@ForCheck: ManakaiDOM|ForClass
4982     @@Name: nameURI
4983     @@Type: NameURI
4984 wakaba 1.12 @@enDesc:
4985 wakaba 1.48 The URI reference of this module, without
4986     <QUOTE::for> identifier.
4987 wakaba 1.12 @@Get:
4988 wakaba 1.49 @@@enDesc:
4989     The attribute value is always equals to
4990     <A::DISAnyResource.uri> for <QUOTE::for> resources.
4991     @@@PerlDef: $r = $self->{uri};
4992 wakaba 1.48 ##DISFor
4993 wakaba 1.18
4994 wakaba 1.48 PropDef:
4995     @QName: isFeatureImplemented
4996     @enDesc:
4997     The list of whether a feature is implemented or not.
4998 wakaba 1.18
4999 wakaba 1.48 IFClsDef:
5000     @IFQName: DISResource
5001     @ClsQName: ManakaiDISResourceDefinition
5002 wakaba 1.19
5003 wakaba 1.48 @ClsISA: ManakaiDISResourceMV
5004     @ClsISA: dp|ManakaiDISResourcePerl
5005     @ClsISA: ManakaiDISPerlModuleDefinition
5006     @ClsISA: dp|ManakaiDISAnyResourcePerl
5007     @ClsISA: ManakaiDISPropertyAccessor
5008     @ClsISA: ManakaiDISAnyResource
5009     @ClsISA: ManakaiDISExceptionTarget
5010 wakaba 1.19
5011 wakaba 1.48 @DISLang:role: ResourceRole
5012 wakaba 1.19
5013 wakaba 1.48 @enDesc:
5014     <QUOTE::dis> resource definitions.
5015 wakaba 1.19
5016 wakaba 1.48 @enDesc:
5017     @@ForCheck: ManakaiDOM|ForIF
5018     @@@:
5019     The objects implementing the <IF::DISResource> interface
5020     <kwd:MUST> also implement the <IF::DISAnyResource> interface.
5021 wakaba 1.12
5022 wakaba 1.46 @Attr:
5023 wakaba 1.48 @@ForCheck: ManakaiDOM|ForClass
5024     @@Name: uris
5025     @@Type:
5026     Perl:Array::ManakaiDOM:all
5027 wakaba 1.46 @@enDesc:
5028 wakaba 1.48 Returns the current <EM::snapshot> of the URI references
5029     for this resource, including the alias URI references.
5030 wakaba 1.46 @@Get:
5031     @@@PerlDef:
5032 wakaba 1.48 $r = [grep {$self->{aliasURI}->{$_}} keys %{$self->{aliasURI}}];
5033 wakaba 1.46
5034 wakaba 1.12 @Method:
5035 wakaba 1.48 @@Name: isSubsetOfURI
5036     @@Description:
5037 wakaba 1.37 @@@lang:en
5038     @@@@:
5039 wakaba 1.48 Whether this resource is a subset of another resource or not.
5040     @@Param:
5041     @@@Name: superURI
5042     @@@Type: ResourceURI
5043     @@@Description:
5044     @@@@lang:en
5045     @@@@@:
5046     Another resource URI reference to test.
5047 wakaba 1.12 @@Return:
5048 wakaba 1.48 @@@Type:
5049     DOMMain:boolean::ManakaiDOM:all
5050     @@@TrueCase:
5051     @@@@enDesc:
5052     <P::superURI> is a super-resource of this resource.
5053     @@@FalseCase:
5054 wakaba 1.12 @@@@enDesc:
5055 wakaba 1.48 <P::superURI> is not a super-resource of this resource.
5056 wakaba 1.12 @@@PerlDef:
5057 wakaba 1.48 $r = $self->{aliasURI}->{$superURI} || $self->{subOf}->{$superURI};
5058 wakaba 1.13
5059     @Method:
5060 wakaba 1.48 @@Name: addSuperResource
5061 wakaba 1.13 @@enDesc:
5062 wakaba 1.48 Adds a <QUOTE::dis> resource to the list of super-resource
5063     of this <QUOTE::dis> resource.
5064 wakaba 1.13 @@Param:
5065 wakaba 1.48 @@@Name: superRes
5066 wakaba 1.47 @@@Type: DISResource
5067     @@@clsActualType: ManakaiDISResourceDefinition
5068 wakaba 1.13 @@@enDesc:
5069 wakaba 1.48 A <QUOTE::dis> resource definition object.
5070     @@Return:
5071 wakaba 1.13 @@@PerlDef:
5072 wakaba 1.48 my @from = ($self->{uri},
5073 wakaba 1.50 grep {$self->{supOf}->{$_}} keys %{$self->{supOf}||{}});
5074 wakaba 1.48 my @to = ($superRes->{uri},
5075 wakaba 1.50 grep {$superRes->{subOf}->{$_}} keys %{$superRes->{subOf}||{}});
5076 wakaba 1.13 __DEEP{
5077 wakaba 1.48 for my $from (@from) {
5078     for my $to (@to) {
5079     $self->{db}-><M::ManakaiDISDatabase.getResource>
5080     ($from)->{subOf}->{$to} = true;
5081     $self->{db}-><M::ManakaiDISDatabase.getResource>
5082     ($to)->{supOf}->{$from} = true;
5083 wakaba 1.13 }
5084     }
5085     }__;
5086 wakaba 1.48
5087 wakaba 1.13 @Method:
5088 wakaba 1.48 @@Name: mergeAsAlias
5089 wakaba 1.13 @@enDesc:
5090 wakaba 1.48 Merges another resource definition as an alias of this resource.
5091 wakaba 1.13 @@Param:
5092 wakaba 1.48 @@@Name: aliasResource
5093 wakaba 1.47 @@@Type: DISResource
5094     @@@clsActualType: ManakaiDISResourceDefinition
5095 wakaba 1.13 @@@enDesc:
5096 wakaba 1.48 A resource to merge.
5097     \
5098     {NOTE:: After merging all references to <P::aliasResource>
5099     should be discarded.
5100     \
5101     }
5102     @@NodeParam:
5103     @@Return:
5104     @@@RaiseException:
5105     @@@@@:MERGE_ITSELF_ERR
5106     @@@@@@enDesc:
5107     An attempt is made to merge this resource itself.
5108 wakaba 1.13 @@@PerlDef:
5109 wakaba 1.48 if ($self eq $aliasResource) {
5110     __EXCEPTION{MERGE_ITSELF_ERR::
5111     DIS:uri => {$self->{uri}},
5112     DIS:sourceNode => {$node},
5113     }__;
5114     }
5115     for my $uri ($aliasResource->{uri},
5116     grep {$aliasResource->{aliasURI}->{$_}}
5117     keys %{$aliasResource->{aliasURI}}) {
5118     $self->{aliasURI}->{$uri} = true;
5119     $self->{db}->{resDef}->{$uri} = $self;
5120     $self->{subOf}->{$uri} = true;
5121     $self->{supOf}->{$uri} = true;
5122     }
5123     for my $uri (grep {$aliasResource->{subOf}->{$_}}
5124 wakaba 1.50 keys %{$aliasResource->{subOf}||{}}) {
5125 wakaba 1.48 $self->{subOf}->{$uri} = true;
5126     }
5127     for my $uri (grep {$aliasResource->{supOf}->{$_}}
5128 wakaba 1.50 keys %{$aliasResource->{supOf}||{}}) {
5129 wakaba 1.48 $self->{supOf}->{$uri} = true;
5130     }
5131 wakaba 1.50 my @from = grep {$self->{supOf}->{$_}} keys %{$self->{supOf}||{}};
5132     my @to = grep {$self->{subOf}->{$_}} keys %{$self->{subOf}||{}};
5133 wakaba 1.13 __DEEP{
5134 wakaba 1.48 for my $from (@from) {
5135     for my $to (@to) {
5136     $self->{db}-><M::ManakaiDISDatabase.getResource>
5137     ($from)->{subOf}->{$to} = true;
5138     $self->{db}-><M::ManakaiDISDatabase.getResource>
5139     ($to)->{supOf}->{$from} = true;
5140 wakaba 1.13 }
5141     }
5142     }__;
5143    
5144     @Method:
5145 wakaba 1.48 @@Name: isTypeURI
5146 wakaba 1.13 @@enDesc:
5147 wakaba 1.48 Tests whether this resource is of a type or not.
5148 wakaba 1.13 @@Param:
5149 wakaba 1.48 @@@Name: typeURI
5150     @@@Type: ResourceURI
5151 wakaba 1.13 @@@enDesc:
5152 wakaba 1.48 A type URI reference to test.
5153     @@Return:
5154 wakaba 1.17 @@@Type:
5155 wakaba 1.48 DOMMain:boolean::ManakaiDOM:all
5156     @@@TrueCase:
5157 wakaba 1.17 @@@@enDesc:
5158 wakaba 1.48 This is a <P::typeURI> resource.
5159     @@@FalseCase:
5160 wakaba 1.17 @@@@enDesc:
5161 wakaba 1.48 This is not a <P::typeURI> resource.
5162 wakaba 1.13 @@@PerlDef:
5163 wakaba 1.48 if (not $self->{<Q::rdf:type>}) {
5164     #
5165     } elsif ($self->{<Q::rdf:type>}->{$typeURI}) {
5166     $r = true;
5167     } else {
5168     __DEEP{
5169     C: for my $t_type_uri (grep {$self->{<Q::rdf:type>}->{$_}}
5170     keys %{$self->{<Q::rdf:type>}}) {
5171     my $t_type = $self-><AG::DISAnyResource.database>
5172     -><M::DISDatabase.getResource> ($t_type_uri);
5173     if ($t_type-><M::DISResource.isSubsetOfURI> ($typeURI)) {
5174     $self-><M::DISResourceProp.addPropertyURIUList>
5175     (<Q::rdf:type>, $typeURI);
5176     $r = true;
5177     last C;
5178     }
5179     }
5180 wakaba 1.15 }__;
5181     }
5182    
5183 wakaba 1.48 @Attr:
5184     @@Name: disDataTypeResource
5185     @@enDesc:
5186     The resource referenced by <Q::dis:Type> property.
5187 wakaba 1.15
5188 wakaba 1.48 = If the resource has the <Q::dis:Type> property,
5189     then its value references the data type resource.
5190 wakaba 1.15
5191 wakaba 1.48 = If the resource has no <Q::dis:Type> property but
5192     the dynamic parent resource has the <Q::dis:Type> property,
5193     then its value references the data type resource.
5194    
5195     = Otherwise, the resource has no associated data type resoruce;
5196     this method throws a <X::NO_DIS_TYPE_ERR> exception.
5197     @@Type: DISResource
5198     @@clsActualType: ManakaiDISResourceDefinition
5199     @@Get:
5200     @@@RaiseException:
5201     @@@@@:NO_DIS_TYPE_ERR
5202 wakaba 1.16 @@@@enDesc:
5203 wakaba 1.48 <Q::dis:Type> attribute is not specified.
5204 wakaba 1.13 @@@PerlDef:
5205 wakaba 1.48 __DEEP{
5206     if (UNIVERSAL::isa ($self->{<Q::dis:Type>}, <IFName::dv|DVURIValue>)) {
5207     $r = $self->{<Q::dis:Type>}-><M::dv|DVURIValue.getResource>
5208     ($self-><AG::DISAnyResource.database>);
5209     } else {
5210 wakaba 1.54 my $pr = $self-><AG::DIS|DISResource.dynamicParentResource>;
5211 wakaba 1.48 $r = $pr-><AG::DISResource.disDataTypeResource> if $pr;
5212     }
5213     }__;
5214     unless ($r) {
5215     __EXCEPTION{NO_DIS_TYPE_ERR::
5216     DIS:uri => {$self-><AG::DISAnyResource.uri>},
5217     DIS:sourceNode => {$self-><AG::DISAnyResource.sourceElement>},
5218 wakaba 1.13 }__;
5219     }
5220 wakaba 1.48
5221     @Attr:
5222     @@Name: disDataTypeValue
5223     @@enDesc:
5224     The <Q::dis:Type> property value for the resource.
5225     @@Get:
5226     @@@Type: dv|DVURIValue
5227     @@@clsActualType: dv|ManakaiDVURIValue
5228     @@@RaiseException:
5229     @@@@@:NO_DIS_TYPE_ERR
5230     @@@@enDesc:
5231     <Q::dis:Type> attribute is not specified.
5232     @@@PerlDef:
5233 wakaba 1.13 __DEEP{
5234 wakaba 1.48 if (UNIVERSAL::isa ($self->{<Q::dis:Type>}, <IFName::dv|DVURIValue>)) {
5235     $r = $self->{<Q::dis:Type>};
5236 wakaba 1.16 } else {
5237 wakaba 1.54 my $pr = $self-><AG::DIS|DISResource.dynamicParentResource>;
5238 wakaba 1.48 $r = $pr-><AG::DISResource.disDataTypeValue> if $pr;
5239 wakaba 1.16 }
5240 wakaba 1.48 }__;
5241     unless ($r) {
5242     __EXCEPTION{NO_DIS_TYPE_ERR::
5243     DIS:uri => {$self-><AG::DISAnyResource.uri>},
5244     DIS:sourceNode => {$self-><AG::DISAnyResource.sourceElement>},
5245     }__;
5246     }
5247 wakaba 1.13
5248     @Attr:
5249 wakaba 1.48 @@Name: disActualDataTypeResource
5250 wakaba 1.13 @@enDesc:
5251 wakaba 1.48 <Q::dis:actualType> attribute value of this resource.
5252     @@Type: DISResource
5253     @@clsActualType: ManakaiDISResourceDefinition
5254 wakaba 1.13 @@Get:
5255 wakaba 1.48 @@@RaiseException:
5256     @@@@@:NO_DIS_TYPE_ERR
5257 wakaba 1.13 @@@@enDesc:
5258 wakaba 1.48 <Q::dis:actualType> attribute is not specified,
5259     and <Q::dis:Type> attribute, neigher.
5260 wakaba 1.13 @@@PerlDef:
5261 wakaba 1.48 __DEEP{
5262     if (UNIVERSAL::isa ($self->{<Q::dis:actualType>},
5263     <IFName::dv|DVURIValue>)) {
5264     $r = $self->{<Q::dis:actualType>}-><M::dv|DVURIValue.getResource>
5265     ($self-><AG::DISAnyResource.database>);
5266     } elsif (UNIVERSAL::isa ($self->{<Q::dis:Type>},
5267     <IFName::dv|DVURIValue>)) {
5268     $r = $self->{<Q::dis:Type>}-><M::dv|DVURIValue.getResource>
5269     ($self-><AG::DISAnyResource.database>);
5270     } else {
5271 wakaba 1.54 my $pr = $self-><AG::DIS|DISResource.dynamicParentResource>;
5272 wakaba 1.48 $r = $pr-><AG::DISResource.disActualDataTypeResource> if $pr;
5273     }
5274     }__;
5275     unless ($r) {
5276     __EXCEPTION{NO_DIS_TYPE_ERR::
5277     DIS:uri => {$self-><AG::DISAnyResource.uri>},
5278     DIS:sourceNode => {$self-><AG::DISAnyResource.sourceElement>},
5279 wakaba 1.13 }__;
5280     }
5281 wakaba 1.48
5282     @Attr:
5283     @@Name: disActualDataTypeValue
5284 wakaba 1.13 @@enDesc:
5285 wakaba 1.48 <Q::dis:actualType> node for this resource.
5286     @@Get:
5287     @@@Type: DISElement
5288     @@@clsActualType: ManakaiDISElement
5289 wakaba 1.13 @@@RaiseException:
5290 wakaba 1.48 @@@@@:NO_DIS_TYPE_ERR
5291 wakaba 1.13 @@@@enDesc:
5292 wakaba 1.48 <Q::dis:actualType> attribute is not specified,
5293     and <Q::dis:Type> attribute, neigher.
5294 wakaba 1.13 @@@PerlDef:
5295 wakaba 1.48 __DEEP{
5296     if (UNIVERSAL::isa ($self->{<Q::dis:actualType>},
5297     <IFName::dv|DVURIValue>)) {
5298     $r = $self->{<Q::dis:actualType>};
5299     } elsif (UNIVERSAL::isa ($self->{<Q::dis:Type>},
5300     <IFName::dv|DVURIValue>)) {
5301     $r = $self->{<Q::dis:Type>};
5302 wakaba 1.13 } else {
5303 wakaba 1.54 my $pr = $self-><AG::DIS|DISResource.dynamicParentResource>;
5304 wakaba 1.48 $r = $pr-><AG::DISResource.disActualDataTypeValue> if $pr;
5305 wakaba 1.13 }
5306 wakaba 1.48 }__;
5307     unless ($r) {
5308     __EXCEPTION{NO_DIS_TYPE_ERR::
5309     DIS:uri => {$self-><AG::DISAnyResource.uri>},
5310     DIS:sourceNode => {$self-><AG::DISAnyResource.sourceElement>},
5311 wakaba 1.13 }__;
5312     }
5313    
5314 wakaba 1.15 @IntMethod:
5315 wakaba 1.48 @@Operator:
5316     @@@@: <=>
5317     @@@ContentType:
5318     lang:Perl
5319 wakaba 1.15 @@enDesc:
5320 wakaba 1.54 Compares two resources. If the first character of the
5321     node in the source tree by which the resource is defined
5322     occures before the other resource's first character, then
5323     the former resource is <DFN::less> than the later resource.
5324     If two resources are the same resource, they are <DFN::equal>.
5325     Otherwise, the former resource is <DFN::greater> than
5326     the later resource.
5327    
5328     There are two exceptions. If two resources belongs to
5329     two different modules, i.e. their <A::DIS|DISAnyResource.ownerModule>s
5330     are different, the order is not defined. Also, if
5331     one of resources is not yet defined, i.e. one's
5332     <A::DIS|DISAnyResource.isDefined> takes <DOM::false> value,
5333     then the order is not defined. Even in these cases, two
5334     calls for the method with the same parameter would return
5335     the same result while the resources are left unchanged.
5336 wakaba 1.48 @@Param:
5337     @@@Name: anotherResource
5338     @@@Type: DISResource
5339     @@@enDesc: Another resource to compare.
5340 wakaba 1.15 @@Return:
5341     @@@Type:
5342 wakaba 1.48 DOMMain:unsigned-long::ManakaiDOM:all
5343 wakaba 1.15 @@@PerlDef:
5344 wakaba 1.48 if (UNIVERSAL::isa ($anotherResource,
5345     <ClassName::ManakaiDISResourceDefinition>)) {
5346     $r = $self->{seq} <=> $anotherResource->{seq};
5347     } else {
5348 wakaba 1.54 $r = $self->{uri} <=> $anotherResource;
5349 wakaba 1.48 }
5350 wakaba 1.15
5351     @Method:
5352 wakaba 1.54 @@ForCheck: ManakaiDOM|ForClass
5353     @@ManakaiDOM:isForInternal:1
5354     @@Name: addChildResource
5355     @@enDesc:
5356     Registers a resource as a static child of the resource.
5357     @@Param:
5358     @@@Name: disResource
5359     @@@Type: DIS|DISResource
5360     @@@enDesc:
5361     The resurce to add.
5362     @@Return:
5363     @@@PerlDef:
5364     __DEEP{
5365     push @{$self->{<H::DIS|childResource>}||=[]},
5366     $disResource-><AG::DIS|DISAnyResource.uriRef>;
5367     }__;
5368    
5369     @Method:
5370     @@ForCheck: ManakaiDOM|ForClass
5371     @@ManakaiDOM:isForInternal:1
5372     @@Name: addDynamicChildResource
5373     @@enDesc:
5374     Registers a resource as a dynamic child of the resource.
5375     @@Param:
5376     @@@Name: disResource
5377     @@@Type: DIS|DISResource
5378     @@@enDesc:
5379     The resurce to add.
5380     @@Return:
5381     @@@PerlDef:
5382     __DEEP{
5383     push @{$self->{<H::DIS|dynamicChildResource>}||=[]},
5384     $disResource-><AG::DIS|DISAnyResource.uriRef>;
5385     }__;
5386    
5387     @Method:
5388     @@Name: getChildResourceList
5389     @@enDesc:
5390     Returns the list of static child resources of the resource.
5391     @@Return:
5392     @@@Type: DIS|ResourceList
5393     @@@enDesc:
5394     The current snapshot of children.
5395     @@@PerlDef:
5396     __DEEP{
5397     my $db = $self-><AG::DIS|DISAnyResource.database>;
5398     $r = [map {
5399     $db-><M::DIS|DISDatabase.getResource> ($$_)
5400     } @{$self->{<H::DIS|childResource>}}];
5401     }__;
5402    
5403     @Method:
5404     @@Name: getDynamicChildResourceList
5405     @@enDesc:
5406     Returns the list of dynamic child resources of the resource.
5407     @@Return:
5408     @@@Type: DIS|ResourceList
5409     @@@enDesc:
5410     The current snapshot of children.
5411     @@@PerlDef:
5412     __DEEP{
5413     my $db = $self-><AG::DIS|DISAnyResource.database>;
5414     $r = [map {
5415     $db-><M::DIS|DISDatabase.getResource> ($$_)
5416     } @{$self->{<H::DIS|dynamicChildResource>}}];
5417     }__;
5418    
5419     @Method:
5420 wakaba 1.48 @@Name: getChildResourceByType
5421 wakaba 1.15 @@enDesc:
5422 wakaba 1.48 Gets a static child resource selected by its type.
5423     @@Param:
5424     @@@Name:typeURI
5425     @@@Type:ResourceURI
5426     @@@enDesc:
5427     A URI reference identifying a resource type.
5428     @@ImplNote:
5429     @@@lang:en
5430     @@@@:
5431 wakaba 1.54 {ISSUE:: Some inheritance tracing required for
5432 wakaba 1.48 e.g. <Q::DISLang:InputProcessor> and <Q::DOMMain:ReflectGet>?
5433 wakaba 1.54 }
5434 wakaba 1.15 @@Return:
5435 wakaba 1.47 @@@Type: DISResource
5436     @@@clsActualType: ManakaiDISResourceDefinition
5437 wakaba 1.15 @@@enDesc:
5438 wakaba 1.48 The first child resource (in document order) whose
5439     type matches with <P::typeURI>.
5440 wakaba 1.15 @@@nullCase:
5441     @@@@enDesc:
5442 wakaba 1.48 There is no resource whose type is <P::typeURI>.
5443 wakaba 1.15 @@@PerlDef:
5444 wakaba 1.48 __DEEP{
5445 wakaba 1.54 my $db = $self-><AG::DIS|DISAnyResource.database>;
5446     C: for my $cr_uri (@{$self->{<H::DIS:childResource>}||[]}) {
5447     my $cr = $db-><M::DIS|DISDatabase.getResource> ($$cr_uri);
5448     if ($cr-><M::DIS|DISResource.isTypeURI> ($typeURI)) {
5449 wakaba 1.48 $r = $cr;
5450 wakaba 1.54 last C;
5451 wakaba 1.48 }
5452 wakaba 1.15 }
5453 wakaba 1.48 }__;
5454 wakaba 1.15
5455 wakaba 1.48 @Method:
5456 wakaba 1.54 @@Name: getChildResourceListByType
5457     @@enDesc:
5458     Returns a list of child resources of a specific type.
5459     @@Param:
5460     @@@Name: typeURI
5461     @@@Type: DIS|AnyURI
5462     @@@enDesc:
5463     A URI of the type.
5464     @@Return:
5465     @@@Type: DIS|ResourceList
5466     @@@enDesc:
5467     The current snapshot of the child resources of type <P::typeURI>.
5468     @@@PerlDef:
5469     __DEEP{
5470     my $db = $self-><AG::DIS|DISAnyResource.database>;
5471     $r = [grep {
5472     $_-><M::DIS|DISResource.isTypeURI> ($typeURI)
5473     } map {
5474     $db-><M::DIS|DISDatabase.getResource> ($$_)
5475     } @{$self->{<H::DIS|childResource>}||[]}];
5476     }__;
5477    
5478     @Method:
5479 wakaba 1.48 @@Name: getChildResourceByNameAndType
5480 wakaba 1.15 @@enDesc:
5481 wakaba 1.48 Gets a static child resource selected by its local name and type.
5482 wakaba 1.15 @@Param:
5483 wakaba 1.48 @@@Name: localName
5484     @@@Type:
5485     DISCore:LocalName::ManakaiDOM:all
5486 wakaba 1.15 @@@enDesc:
5487 wakaba 1.48 A local name.
5488 wakaba 1.15 @@Param:
5489 wakaba 1.48 @@@Name:typeURI
5490     @@@Type:ResourceURI
5491 wakaba 1.15 @@@enDesc:
5492 wakaba 1.48 A URI reference identifying a resource type.
5493     @@Return:
5494 wakaba 1.47 @@@Type: DISResource
5495     @@@clsActualType: ManakaiDISResourceDefinition
5496 wakaba 1.15 @@@enDesc:
5497 wakaba 1.48 The first (by document order) child resource whose
5498     type matches for <P::localName> and <P::typeURI>.
5499 wakaba 1.15 @@@nullCase:
5500     @@@@enDesc:
5501 wakaba 1.48 There is no resource whose name is <P::localName> and
5502     whose type is <P::typeURI>.
5503     @@@PerlDef:
5504     __DEEP{
5505 wakaba 1.54 my $db = $self-><AG::DIS|DISAnyResource.database>;
5506     C: for my $cr_uri (@{$self->{<H::DIS:childResource>}||[]}) {
5507     my $cr = $db-><M::DIS|DISDatabase.getResource> ($$cr_uri);
5508     my $ln = $cr-><AG::DIS|DISAnyResource.localName>;
5509 wakaba 1.48 if (defined $ln and $ln eq $localName and
5510 wakaba 1.54 $cr-><M::DIS|DISResource.isTypeURI> ($typeURI)) {
5511 wakaba 1.48 $r = $cr;
5512 wakaba 1.54 last C;
5513 wakaba 1.48 }
5514     }
5515     }__;
5516    
5517     @Method:
5518     @@Name: getConstResourceByName
5519     @@enDesc:
5520     Gets a constant value resource by its local name.
5521 wakaba 1.15 @@Param:
5522 wakaba 1.48 @@@Name:localName
5523 wakaba 1.15 @@@Type:
5524 wakaba 1.48 DISLang:String::ManakaiDOM:all
5525 wakaba 1.15 @@@enDesc:
5526 wakaba 1.48 Constant name.
5527 wakaba 1.15 @@Return:
5528 wakaba 1.48 @@@Type: DISResource
5529     @@@clsActualType: ManakaiDISResourceDefinition
5530     @@@enDesc:
5531     The constant resource identified by <P::localName>.
5532     @@@nullCase:
5533 wakaba 1.16 @@@@enDesc:
5534 wakaba 1.48 There is no such constant resource.
5535 wakaba 1.15 @@@PerlDef:
5536 wakaba 1.48 __DEEP{
5537     my @constGroup;
5538 wakaba 1.54 my $db = $self-><AG::DIS|DISAnyResource.database>;
5539     C: for my $cr_uri (@{$self->{<H::DIS:childResource>}||[]}) {
5540     my $cr = $db-><M::DIS|DISDatabase.getResource> ($$cr_uri);
5541     my $ln = $cr-><AG::DIS|DISAnyResource.localName>;
5542 wakaba 1.48 if ($ln and $ln eq $localName and
5543 wakaba 1.54 $cr-><M::DIS|DISResource.isTypeURI> (<Q::DISLang:Const>)) {
5544 wakaba 1.48 $r = $cr;
5545 wakaba 1.54 last C;
5546     } elsif ($cr-><M::DIS|DISResource.isTypeURI>
5547     (<Q::DISLang:ConstGroup>)) {
5548 wakaba 1.48 push @constGroup, $cr;
5549     }
5550     }
5551     unless ($r) {
5552 wakaba 1.54 D: for my $cg (@constGroup) {
5553     $r = $cg-><M::DIS|DISResource.getChildResourceByNameAndType>
5554     ($localName, <Q::DISLang:Const>);
5555     last D if $r;
5556 wakaba 1.15 }
5557     }
5558 wakaba 1.48 }__;
5559 wakaba 1.15
5560 wakaba 1.18 @Attr:
5561 wakaba 1.54 @@Name: parentResource
5562     @@enDesc:
5563     The static parent resource of the resource.
5564     @@Type: DIS|DISResource
5565     @@nullCase:
5566     @@@enDesc: No parent resource.
5567     @@Get:
5568     @@@PerlDef:
5569     __DEEP{
5570     if ($self->{<H::DIS|parentResource>}) {
5571     $r = $self-><AG::DIS|DISAnyResource.database>
5572     -><M::DIS|DISDatabase.getResource>
5573     (${$self->{<H::DIS|parentResource>}});
5574     }
5575     }__;
5576     @@Set:
5577     @@@ForCheck: ManakaiDOM|ForClass
5578     @@@PerlDef:
5579     __DEEP{
5580     if ($given) {
5581     $self->{<H::DIS|parentResource>}
5582     = $given-><AG::DIS|DISAnyResource.uriRef>;
5583     } else {
5584     CORE::delete $self->{<H::DIS|parentResource>};
5585     }
5586     }__;
5587    
5588     @Attr:
5589     @@Name: dynamicParentResource
5590     @@enDesc:
5591     The dynamic parent resource of the resource.
5592     @@Type: DIS|DISResource
5593     @@nullCase:
5594     @@@enDesc: No parent resource.
5595     @@Get:
5596     @@@PerlDef:
5597     __DEEP{
5598     if ($self->{<H::DIS|dynamicParentResource>}) {
5599     $r = $self-><AG::DIS|DISAnyResource.database>
5600     -><M::DIS|DISDatabase.getResource>
5601     (${$self->{<H::DIS|dynamicParentResource>}});
5602     }
5603     }__;
5604     @@Set:
5605     @@@ForCheck: ManakaiDOM|ForClass
5606     @@@PerlDef:
5607     __DEEP{
5608     if ($given) {
5609     $self->{<H::DIS|dynamicParentResource>}
5610     = $given-><AG::DIS|DISAnyResource.uriRef>;
5611     } else {
5612     CORE::delete $self->{<H::DIS|dynamicParentResource>};
5613     }
5614     }__;
5615    
5616     @Attr:
5617 wakaba 1.48 @@Name: ownerClassNodeURI
5618 wakaba 1.18 @@enDesc:
5619 wakaba 1.48 The node URI reference of the class resource this resource
5620     belongs to.
5621     @@Type: ResourceURI
5622 wakaba 1.18 @@Get:
5623 wakaba 1.48 @@@enDesc:
5624     The URI reference of the <Q::ManakaiDOM:Class> resource.
5625     If this resource is a class, then the URI reference
5626     of this resource is returned.
5627     @@@nullCase:
5628 wakaba 1.18 @@@@enDesc:
5629 wakaba 1.48 This resource does not belong to any class.
5630 wakaba 1.18 @@@PerlDef:
5631 wakaba 1.53 if (exists $self->{<H::DIS:ownerClass>}) {
5632     $r = $self->{<H::DIS:ownerClass>};
5633 wakaba 1.48 } else {
5634     my $res = $self;
5635     __DEEP{
5636     RES: {
5637     if ($res-><M::ManakaiDISResourceDefinition.isTypeURI>
5638     (<Q::ManakaiDOM:Class>)) {
5639     $r = $res-><AG::DISAnyResource.sourceNodeID>;
5640     } else {
5641 wakaba 1.54 $res = $res-><AG::DIS|DISResource.parentResource>;
5642 wakaba 1.48 redo RES if $res;
5643     }
5644 wakaba 1.18 }
5645 wakaba 1.48 }__;
5646 wakaba 1.53 $self->{<H::DIS:ownerClass>} = $r;
5647 wakaba 1.48 }
5648 wakaba 1.18
5649     @Attr:
5650     @@Name: disIsNullValue
5651     @@enDesc:
5652     Whether this resource have <DOM::null> value or not.
5653     A resource have <DOM::null> value iff it has
5654     <Q::dis:Value> attribute node that in turn has
5655     <Q::dis:is-null> attribute whose value set to <DOM::true>.
5656     @@Type:
5657     DOMMain:boolean::ManakaiDOM:all
5658     @@Get:
5659     @@@PerlDef:
5660 wakaba 1.51 if ($self->{<Q::dis:Value>}) {
5661     $r = $self->{<Q::dis:Value>}-><AG::dv|DVValue.isNull>;
5662 wakaba 1.18 }
5663 wakaba 1.19
5664 wakaba 1.24 @Method:
5665     @@Name: isFeatureProvided
5666     @@enDesc:
5667     Whether a feature is provided by this resource or not.
5668     Note that the feature is actually available (implemented)
5669     or not is other thing (use <M::ManakaiDISPerlModuleDefinition
5670     .plIsFeatureImplemented> instead).
5671     @@Param:
5672     @@@Name: featureResourceURI
5673     @@@Type: ResourceURI
5674     @@@enDesc:
5675     The URI reference of the resource definition for the feature to test.
5676     @@Return:
5677     @@@Type:
5678     DOMMain:boolean::ManakaiDOM:all
5679     @@@enDesc:
5680     Whether the feature is provided or not.
5681     @@@PerlDef:
5682     __DEEP{
5683     my @f = @{$self-><M::ManakaiDISPropertyAccessor
5684     .getPropertyResourceList>
5685     (<Q::DOMMain:implementFeature>,
5686 wakaba 1.26 isa_recursive => true,
5687 wakaba 1.24 default_media_type => <Q::dis:TypeQName>)};
5688     if (@f) {
5689     for my $f (@f) {
5690     if ($f-><M::ManakaiDISResourceDefinition.isSubsetOfURI>
5691     ($featureResourceURI)) {
5692     $r = true;
5693     last;
5694     }
5695     }
5696     } else {
5697 wakaba 1.54 my $parent = $self-><AG::DIS|DISResource.parentResource>;
5698 wakaba 1.24 $r = $parent-><M::ManakaiDISResourceDefinition.isFeatureProvided>
5699     ($featureResourceURI)
5700     if $parent;
5701     }
5702     }__;
5703    
5704     @Attr:
5705     @@Name: featureNameList
5706     @@enDesc:
5707     The list of the names of the feature defined by this resource.
5708 wakaba 1.48
5709     = If the resource has one or more <Q::dis:AppName> attributes,
5710     their text values are feature names.
5711    
5712     = If there is no <Q::dis:AppName> attributes but the resource
5713     is a <Q::DOMFeature:instanceOf> another feature, then
5714     the set of the feature names of the resource is equal
5715     to the one of another feature's feature names.
5716    
5717     {OLI:: If two operation above does not result in one or more
5718     feature names,
5719    
5720     = and if the resource has a name (the <A::DISAnyResource
5721     .isAnonymous> attribute returns <DOM::false>), then
5722     the <A::DISAnyResource.nameURI> of the resource is
5723     a feature name.
5724    
5725     = otherwise, i.e. <A::DISAnyResource.isAnonymous> is
5726     <DOM::true>, then the <A::DISAnyResource.localName>
5727     of the resource, if non-<DOM::null>, is a feature name.
5728    
5729     }
5730    
5731 wakaba 1.24 @@Type:
5732     Perl:ARRAY::ManakaiDOM:all
5733     @@Get:
5734 wakaba 1.48 @@@enDesc:
5735     A reference to the array containing feature names.
5736     Note that the order in the array is <EM::not> significant.
5737     The array might be empty if the resource has no feature name.
5738     This array is dead.
5739    
5740     {NOTE:: The attribute value array might be non-empty
5741     even if the resource is not of type <Q::DOMFeature:Feature>
5742     as far as the algorithm defined above returns
5743     some feature names.
5744     }
5745 wakaba 1.24 @@@RaiseException:
5746     @@@@@:UNSUPPORTED_MEDIA_TYPE_ERR
5747     @@@@enDesc:
5748     There is an <Q::dis:AppName> attribute whose media
5749     type is not supported.
5750     @@@RaiseException:
5751     @@@@@: NO_SOURCE_NODE_ERR
5752     @@@@enDesc:
5753     This resource definition does not have associated node
5754     in the source tree.
5755     @@@PerlDef:
5756     __DEEP{
5757 wakaba 1.49 $r = [map {lc} @{$self-><M::DISResourceProp.getPropertyTextList>
5758 wakaba 1.52 (<Q::DOMFeature:name>)}];
5759 wakaba 1.24 unless (@$r) {
5760 wakaba 1.48 ## TODO: instance feature
5761 wakaba 1.54 my $pr = $self-><AG::DIS|DISResource.parentResource>;
5762 wakaba 1.28 if ($pr) {
5763 wakaba 1.52 if ($pr-><M::DISResource.isTypeURI> (<Q::DOMFeature:Feature>) and
5764 wakaba 1.48 not $pr-><AG::DISAnyResource.isAnonymous>) {
5765     push @$r, @{$pr-><AG::DISResource.featureNameList>};
5766 wakaba 1.28 }
5767     }
5768     }
5769     unless (@$r) {
5770 wakaba 1.48 if ($self-><AG::DISAnyResource.isAnonymous>) {
5771     my $ln = $self-><AG::DISAnyResource.localName>;
5772 wakaba 1.28 push @$r, lc $ln if defined $ln;
5773 wakaba 1.24 } else {
5774 wakaba 1.48 push @$r, lc $self-><AG::DISAnyResource.nameURI>;
5775     }
5776     }
5777     }__;
5778    
5779     @Method:
5780     @@ForCheck: ManakaiDOM|ForClass
5781     @@Name: getFeature
5782     @@Description:
5783     @@@lang:en
5784     @@@@:
5785     Returns a specialized object that implements the specialized
5786     interfaces of the specified feature and version.
5787     @@Param:
5788     @@@Name: feature
5789     @@@Type:
5790     DISLang:String::ManakaiDOM:all
5791     @@@actualType:
5792     ManakaiDOM:ManakaiDOMFeatureName::ManakaiDOM:ManakaiDOMLatest
5793     @@@Description:
5794     @@@@lang:en
5795     @@@@@:
5796     A feature name to request.
5797     @@Param:
5798     @@@Name: version
5799     @@@Type:
5800     DISLang:String::ManakaiDOM:all
5801     @@@actualType:
5802     ManakaiDOM:ManakaiDOMFeatureVersion::ManakaiDOM:ManakaiDOMLatest
5803     @@@Description:
5804     @@@@lang:en
5805     @@@@@:
5806     A feature version number to request.
5807     @@Return:
5808     @@@Type:
5809     DOMMain:Object::ManakaiDOM:all
5810     @@@Description:
5811     @@@@lang:en
5812     @@@@@:
5813     An object that implements the specialized APIs of the
5814     <P::feature> and <P::version>.
5815 wakaba 1.49 @@@nullCase:
5816     @@@@enDesc:
5817 wakaba 1.48 There is no object available that implements interfaces
5818     associated with the <P::feature> and <P::version>.
5819     @@@PerlDef:
5820     $feature =~ s/^\+//;
5821     CLASS: for my $class (grep {
5822     $Message::Util::DIS::ManakaiDISResourceDefinition::CompatClass{$_}
5823     } keys %Message::Util::DIS::ManakaiDISResourceDefinition::CompatClass){
5824     if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) {
5825     $r = bless {o => $self}, $class;
5826     last CLASS;
5827 wakaba 1.24 }
5828     }
5829 wakaba 1.48
5830     @Attr:
5831     @@Name: multiplePropertiesURI
5832     @@enDesc:
5833     Whether the property allows multiple occurence of the attribute
5834     in the <QUOTE::dis> source tree.
5835     @@Type: DISLang|String||ManakaiDOM|all
5836     @@Get:
5837     @@@PerlDef:
5838     __DEEP{
5839     if ($self->{<Q::dis|multipleProperties>}) {
5840     $r = $self->{<Q::dis|multipleProperties>}
5841     -><M::dv|DVURIValue.getResource>
5842     ($self-><AG::DISAnyResource.database>)
5843     -><AG::DISAnyResource.uri>;
5844     } else {
5845     $r = <Q::DISCore|OrderedList>;
5846     }
5847     }__;
5848    
5849     @Attr:
5850     @@Name: defaultLextypeURI
5851     @@enDesc:
5852     The URI of the default lexical type for the <QUOTE::dis> attribute.
5853     @@Type: DISLang|String||ManakaiDOM|all
5854     @@Get:
5855     @@@PerlDef:
5856     __DEEP{
5857     if ($self->{<Q::dis:dataType>}) {
5858     $r = $self->{<Q::dis:dataType>}
5859     -><M::dv|DVURIValue.getResource>
5860     ($self-><AG::DISAnyResource.database>)
5861     -><AG::DISAnyResource.uri>;
5862     } else {
5863     $r = <Q::DISCore|String>;
5864     }
5865 wakaba 1.24 }__;
5866 wakaba 1.48 ##DISResource
5867    
5868     IFClsDef:
5869     @IFQName: DISResourceMV
5870     @ClsQName: ManakaiDISResourceMV
5871    
5872     @enDesc:
5873     The objects implementing the <IF::DISResourceMV> <kwd:MUST>
5874     also implement the <IF::DISResource> interface.
5875 wakaba 1.32
5876     @Attr:
5877     @@Name: mvLocalName
5878     @@enDesc:
5879     The local name of the markup vocabulary element defined by this
5880     resource.
5881     @@Type:
5882     DISLang:String::ManakaiDOM:all
5883     @@Get:
5884     @@@nullCase:
5885     @@@@enDesc:
5886     Either this resource does not define a markup vocabulary element
5887     or it does define an element but it does not have a local name.
5888     @@@PerlDef:
5889     __DEEP{
5890 wakaba 1.48 if (UNIVERSAL::isa ($self->{<Q::dis|AppName>},
5891     <IFName::dv|DVQNameValue>)) {
5892     $r = $self->{<Q::dis|AppName>}-><AG::dv|DVQNameValue.localName>;
5893 wakaba 1.43 } else {
5894 wakaba 1.59 $r = $self-><AG::DIS|DISAnyResource.localName>;
5895 wakaba 1.43 }
5896     }__;
5897    
5898     @Attr:
5899     @@Name: mvPrefix
5900     @@enDesc:
5901     A typical namespace prefix of the markup vocabulary element defined
5902     by this resource.
5903     @@Type:
5904     DISLang:String::ManakaiDOM:all
5905     @@Get:
5906     @@@nullCase:
5907     @@@@enDesc:
5908     Either this resource does not define a markup vocabulary element
5909     or it does define an element but it does not have a namespace URI.
5910     @@@PerlDef:
5911     __DEEP{
5912 wakaba 1.48 if (UNIVERSAL::isa ($self->{<Q::dis|AppName>},
5913     <IFName::dv|DVQNameValue>)) {
5914     $r = $self->{<Q::dis|AppName>}-><AG::dv|DVQNameValue.prefix>;
5915 wakaba 1.43 }
5916     unless (defined $r) {
5917 wakaba 1.48 my $nsuri = $self-><AG::DISResourceMV.mvNamespaceURI>;
5918 wakaba 1.43 if (defined $nsuri and $nsuri =~ /([A-Za-z]\w*)\W*$/) {
5919 wakaba 1.53 $r = $1;
5920 wakaba 1.43 } elsif (defined $nsuri) {
5921 wakaba 1.53 $r = 'ns';
5922 wakaba 1.43 }
5923 wakaba 1.32 }
5924     }__;
5925    
5926     @Attr:
5927     @@Name: mvNamespaceURI
5928     @@enDesc:
5929     The namespace URI of the markup vocabulary element defined by this
5930     resource.
5931     @@Type: AnyURI
5932     @@Get:
5933     @@@nullCase:
5934     @@@@enDesc:
5935     Either this resource does not define a markup vocabulary element
5936     or it does define an element but it does not have a namespace URI.
5937     @@@PerlDef:
5938     __DEEP{
5939 wakaba 1.48 if (UNIVERSAL::isa ($self->{<Q::dis|AppName>},
5940     <IFName::dv|DVQNameValue>)) {
5941     $r = $self->{<Q::dis|AppName>}-><AG::dv|DVQNameValue.namespaceURI>;
5942 wakaba 1.32 } else {
5943 wakaba 1.59 $r = $self-><AG::DIS|DISAnyResource.namespaceURI>;
5944 wakaba 1.32 }
5945     }__;
5946    
5947     @Attr:
5948     @@Name: mvOwnerElementResource
5949     @@enDesc:
5950     An <QUOTE::owner element> resource of the markup vocabulary
5951     element defined by this resource.
5952 wakaba 1.47 @@Type: DISResource
5953     @@clsActualType: ManakaiDISResourceDefinition
5954 wakaba 1.32 @@Get:
5955     @@@nullCase:
5956     @@@@enDesc:
5957     Either this resource does not define a markup vocabulary element
5958     or it does define an element but it does not have an owner.
5959     @@@PerlDef:
5960     __DEEP{
5961 wakaba 1.53 if (exists $self->{<H::DIS:mvOwnerElementURI>}) {
5962 wakaba 1.32 $r = $self->{db}-><M::ManakaiDISDatabase.getResource>
5963 wakaba 1.53 ($self->{<H::DIS:mvOwnerElementURI>})
5964     if defined $self->{<H::DIS:mvOwnerElementURI>};
5965 wakaba 1.54 } else {
5966     $r = $self-><AG::DIS|DISResource.parentResource>;
5967     undef $r unless $r-><M::DIS|DISResource
5968 wakaba 1.32 .isTypeURI> (<Q::s:AnyOwnerElement>);
5969 wakaba 1.53 $self->{<H::DIS:mvOwnerElementURI>} = $r->{uri} if $r;
5970 wakaba 1.32 }
5971 wakaba 1.48 }__;
5972     ##DISResourceMV
5973 wakaba 1.27
5974     PropDef:
5975 wakaba 1.32 @QName: mvLocalName
5976     @enDesc:
5977     <A::ManakaiDISResourceDefinition.mvLocalName>.
5978    
5979     PropDef:
5980 wakaba 1.43 @QName: mvPrefix
5981     @enDesc:
5982     <A::ManakaiDISResourceDefinition.mvPrerix>.
5983    
5984     PropDef:
5985 wakaba 1.32 @QName: mvNamespaceURI
5986     @enDesc:
5987     <A::ManakaiDISResourceDefinition.mvNamespaceURI>.
5988    
5989     PropDef:
5990     @QName: mvOwnerElementURI
5991     @enDesc:
5992     <A::ManakaiDISResourceDefinition.mvOwnerElementResource>
5993     (<QUOTE::dis> resource URI reference).
5994    
5995     PropDef:
5996 wakaba 1.13 @QName: ownerClass
5997     @enDesc:
5998     The class to which this resource belongs.
5999     @Type: ResourceURI
6000     @rdfs:range:
6001     rdf:Resource
6002     @rdfs:domain:
6003     ManakaiDOM:Class
6004    
6005 wakaba 1.12 ResourceDef:
6006     @QName: DOMMinImpl
6007     @AliasFor:
6008 wakaba 1.46 DOMFeature:GetFeature::ManakaiDOM:ManakaiDOMLatest
6009 wakaba 1.49 @For: DIS|ForEmpty
6010 wakaba 1.20
6011     ResourceDef:
6012 wakaba 1.12 @QName: SWCFGNode
6013     @AliasFor:
6014     swcfg21:SWCFGNode::swcfg21:ForLatest
6015 wakaba 1.49 @For: DIS|ForEmpty
6016 wakaba 1.12
6017     ResourceDef:
6018 wakaba 1.48 @QName: SWCFGElement
6019     @AliasFor:
6020     swcfg21:SWCFGElement::swcfg21:ForLatest
6021 wakaba 1.49 @For: DIS|ForEmpty
6022 wakaba 1.48
6023     ResourceDef:
6024 wakaba 1.12 @QName: SWCFGDoc
6025     @AliasFor:
6026     swcfg21:SWCFGDocument::swcfg21:ForLatest
6027 wakaba 1.49 @For: DIS|ForEmpty
6028 wakaba 1.12
6029     XParamDef:
6030 wakaba 1.48 @QName: sourceNodePath
6031     @enDesc:
6032     A node path string of the source node.
6033    
6034     XParamDef:
6035 wakaba 1.12 @QName: errResource
6036     @enDesc:
6037     A resource on which an error has occurred.
6038    
6039 wakaba 1.8 XParamDef:
6040     @QName: generatedName
6041     @enDesc:
6042     A generated name.
6043    
6044 wakaba 1.47 IFClsDef:
6045     @IFQName: DISResourceProp
6046 wakaba 1.2 @ClsQName: ManakaiDISPropertyAccessor
6047 wakaba 1.47
6048 wakaba 1.3 @enDesc:
6049 wakaba 1.2 Accessor methods for resource or module properties.
6050 wakaba 1.48
6051     @Method:
6052     @@Name: getPropertyValue
6053 wakaba 1.22 @@enDesc:
6054 wakaba 1.48 Returns a property value object.
6055     @@PropNameParam:
6056     @@Return:
6057     @@@Type: dv|DVValue
6058     @@@enDesc: The property value.
6059 wakaba 1.22 @@@nullCase:
6060     @@@@enDesc:
6061 wakaba 1.48 The property has no value.
6062 wakaba 1.22 @@@PerlDef:
6063 wakaba 1.52 if ($self->{$propName}) {
6064 wakaba 1.54 $r = $self->{$propName}->[0];
6065 wakaba 1.52 } else {
6066     my $pr = $self-><AG::DISAnyResource.database>
6067     -><M::DISDatabase.getResource> ($propName);
6068 wakaba 1.53 A: for (grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6069     (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) {
6070 wakaba 1.52 my $v = $self->{$_};
6071     if ($v) {
6072     $r = $v->[0];
6073     last A;
6074     }
6075     }
6076     }
6077 wakaba 1.22
6078 wakaba 1.48 @Method:
6079     @@Name: getPropertyValueList
6080 wakaba 1.22 @@enDesc:
6081 wakaba 1.48 Returns a property value objects.
6082     @@PropNameParam:
6083     @@Return:
6084     @@@Type: Perl|ARRAY||ManakaiDOM|all
6085     @@@enDesc: The property value.
6086     @@@PerlDef:
6087     my $pr = $self-><AG::DISAnyResource.database>
6088     -><M::DISDatabase.getResource> ($propName);
6089     $r = [map {@$_}
6090 wakaba 1.49 grep {defined $_}
6091 wakaba 1.48 map {$self->{$_}}
6092 wakaba 1.53 grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6093     (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})];
6094 wakaba 1.22
6095 wakaba 1.2 @Method:
6096 wakaba 1.8 @@Name: getPropertyBoolean
6097     @@enDesc:
6098     Gets boolean property value.
6099     @@PropNameParam:
6100     @@Param:
6101     @@@Name:default
6102     @@@Type:
6103     DOMMain:boolean::ManakaiDOM:all
6104     @@@enDesc:
6105     The default value that is returned if no explicit property
6106     value specification found for this resource.
6107     @@Return:
6108     @@@Type:
6109     DOMMain:boolean::ManakaiDOM:all
6110     @@@enDesc:
6111     The property value.
6112     @@@PerlDef:
6113 wakaba 1.48 if (ref $self->{$propName}) {
6114     $r = $self->{$propName}-><AG::dv|DVValue.value> ? true : false;
6115 wakaba 1.8 $r = $default unless defined $r;
6116     } else {
6117 wakaba 1.48 my $pr = $self-><AG::DISAnyResource.database>
6118     -><M::DISDatabase.getResource> ($propName);
6119     C: {
6120     for (map {$self->{$_}}
6121 wakaba 1.53 grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6122     (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) {
6123 wakaba 1.48 if (defined $_) {
6124     $r = $_-><AG::dv|DVValue.value> ? true : false;
6125     last C;
6126     }
6127     }
6128     $r = $default;
6129     } # C
6130 wakaba 1.8 }
6131    
6132     @Method:
6133 wakaba 1.2 @@Name: getPropertyText
6134     @@enDesc:
6135     Gets property value text.
6136     @@PropNameParam:
6137     @@Param:
6138     @@@Name:default
6139     @@@Type:
6140 wakaba 1.3 swcfg21:SWCFGString::swcfg21:ForLatest
6141 wakaba 1.2 @@@enDesc:
6142     The default value that is returned if no explicit property
6143     value specification found for this resource.
6144     @@@nullCase:
6145     @@@@enDesc:
6146     No default value supplied; <DOM::null> is returned if
6147     no value specified.
6148     @@Return:
6149     @@@Type:
6150 wakaba 1.3 swcfg21:SWCFGString::swcfg21:ForLatest
6151 wakaba 1.2 @@@enDesc:
6152     The property value string.
6153     @@@nullCase:
6154     @@@@enDesc:
6155     No value nor default value has specified.
6156     @@@PerlDef:
6157 wakaba 1.48 if (defined $self->{$propName}) {
6158     $r = $self->{$propName}-><AG::dv|DVValue.stringValue>;
6159     $r = $default unless defined $r;
6160     } else {
6161     my $pr = $self-><AG::DISAnyResource.database>
6162     -><M::DISDatabase.getResource> ($propName);
6163     C: {
6164     for (map {$self->{$_}}
6165 wakaba 1.53 grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6166     (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) {
6167 wakaba 1.48 if (defined $_) {
6168     $r = $_-><AG::dv|DVValue.stringValue>;
6169     last C;
6170     }
6171     }
6172 wakaba 1.8 $r = $default;
6173 wakaba 1.48 } # C
6174 wakaba 1.2 }
6175    
6176     @Method:
6177 wakaba 1.48 @@Name: getPropertyTextList
6178     @@enDesc:
6179     Returns a list of property value text.
6180     @@PropNameParam:
6181     @@MediaTypeDefaultParam:
6182     @@Return:
6183     @@@Type: Perl|ARRAY||ManakaiDOM|all
6184     @@@enDesc:
6185     A list of the property value strings.
6186     @@@RaiseException:
6187     @@@@@:UNSUPPORTED_MEDIA_TYPE_ERR
6188     @@@@enDesc:
6189     There is an attribute whose media
6190     type is not supported.
6191     @@@PerlDef:
6192     my $pr = $self-><AG::DISAnyResource.database>
6193     -><M::DISDatabase.getResource> ($propName);
6194     $r = [map {$_-><AG::dv|DVValue.stringValue>}
6195     map {@$_}
6196     grep {$_}
6197     map {$self->{$_}}
6198 wakaba 1.53 grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6199     (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})];
6200 wakaba 1.48
6201     @Method:
6202 wakaba 1.2 @@Name: getPropertyResource
6203     @@enDesc:
6204     Gets property value resource.
6205     @@PropNameParam:
6206 wakaba 1.10 @@NamedParam:
6207     @@@Name: defaultMediaType
6208     @@@Type: ResourceURI
6209     @@@enDesc:
6210     The URI reference of the default media type which is used
6211     when the property value is retrieved from the source tree
6212     and the source tree element does not have its <Q::dis:ContentType>
6213     attribute specified.
6214     @@@nullCase:
6215     @@@@enDesc:
6216     Defaulted to <Q::dis:TypeQName>.
6217 wakaba 1.2 @@Return:
6218 wakaba 1.47 @@@Type: DISResource
6219     @@@clsActualType: ManakaiDISResourceDefinition
6220 wakaba 1.2 @@@enDesc:
6221     The property value resource.
6222     @@@nullCase:
6223     @@@@enDesc:
6224     No value has specified.
6225 wakaba 1.8 @@@UndeclaredPrefixException:
6226 wakaba 1.12 @@@RaiseException:
6227     @@@@@:UNSUPPORTED_MEDIA_TYPE_ERR
6228     @@@@enDesc:
6229     The media type of the attribute node in the source tree
6230     corresponding to this resource is not supported.
6231 wakaba 1.2 @@@PerlDef:
6232 wakaba 1.48 __DEEP{
6233     my $v = $self-><M::DISResourceProp.getPropertyValue>
6234     ($propName);
6235     if (UNIVERSAL::isa ($v, <IFName::dv|DVURIValue>)) {
6236     $r = $v-><M::dv|DVURIValue.getResource>
6237     ($self-><AG::DISAnyResource.database>);
6238     }
6239     }__;
6240 wakaba 1.2
6241     @Method:
6242 wakaba 1.10 @@Name: getPropertyResourceList
6243     @@enDesc:
6244     Gets property value resource list.
6245     @@PropNameParam:
6246     @@NamedParam:
6247 wakaba 1.24 @@@Name: recursive
6248     @@@Type:
6249     DOMMain:boolean::ManakaiDOM:all
6250     @@@enDesc:
6251     Whether property resource values of this resource
6252     should also be included to the returned list or not.
6253     @@NamedParam:
6254 wakaba 1.10 @@@Name: recursiveISA
6255     @@@Type:
6256 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
6257 wakaba 1.10 @@@enDesc:
6258 wakaba 1.26 Whether the <Q::dis:ISA> ancestors of the resources
6259     that are property values should also be included in the returned list
6260     or not.
6261     @@@TrueCase:
6262     @@@@enDesc:
6263     If a property value is a resource <VAR::R> and
6264     the resource <VAR::R> <Q::dis:ISA>'s (or inherits) <VAR::S>, then
6265     the resource <VAR::S> is also a value in the list.
6266     @@@FalseCase:
6267     @@@@enDesc:
6268     Only the resources directly specified as property values is returned.
6269     @@NamedParam:
6270     @@@Name: isaRecursive
6271     @@@Type:
6272     DOMMain:boolean::ManakaiDOM:all
6273     @@@enDesc:
6274     Whether property resource values of <Q::dis:ISA> resources
6275     of this resource should also be included to the returned list or not.
6276     @@@TrueCase:
6277     @@@@enDesc:
6278     If this resource <Q::dis:ISA>'s (or inherits) another resource
6279     <VAR::S> and the <VAR::S> resource has a <P::propName>
6280     property value of <VAR::R>, then the resource <VAR::R>
6281     is also a value in the list.
6282     @@@FalseCase:
6283     @@@@enDesc:
6284     Only the resource directly specified is the returned.
6285 wakaba 1.10 @@NamedParam:
6286     @@@Name: defaultMediaType
6287     @@@Type: ResourceURI
6288     @@@enDesc:
6289     The URI reference of the default media type which is used
6290     when the property value is retrieved from the source tree
6291     and the source tree element does not have its <Q::dis:ContentType>
6292     attribute specified.
6293     @@@nullCase:
6294     @@@@enDesc:
6295     Defaulted to <Q::dis:TypeQName>.
6296     @@Return:
6297     @@@Type: ResourceList
6298     @@@enDesc:
6299     An array reference of the property value resources.
6300     \
6301     {NOTE:: This list is <QUOTE::dead>.
6302     \
6303     }
6304     @@@UndeclaredPrefixException:
6305 wakaba 1.12 @@@RaiseException:
6306     @@@@@:UNSUPPORTED_MEDIA_TYPE_ERR
6307     @@@@enDesc:
6308     The media type of the attribute node in the source tree
6309     corresponding to this resource is not supported.
6310 wakaba 1.10 @@@PerlDef:
6311     $r = [];
6312 wakaba 1.48 __DEEP{
6313     my $v = $self-><M::DISResourceProp.getPropertyValueList> ($propName);
6314     my $db = $self-><AG::DISAnyResource.database>;
6315     for my $a (@$v) {
6316     if ($a->isa (<IFName::dv|DVURIValue>)) {
6317     push @$r, $a-><M::dv|DVURIValue.getResource> ($db);
6318     }
6319     if ($isaRecursive) {
6320     my $b = $a-><M::dv|DVValue.getProperty>
6321     (<Q::DISCore:stopISARecursive>);
6322     if ($b and $b-><AG::dv|DVValue.value>) {
6323     $isaRecursive = false;
6324 wakaba 1.32 }
6325 wakaba 1.10 }
6326 wakaba 1.48 }
6327     }__;
6328    
6329 wakaba 1.24 if ($recursive) {
6330     __DEEP{
6331     $opt{___recursive_isa_done} ||= {$self->{uri} => true};
6332     my @p_res = @$r;
6333     for my $p_res (@p_res) {
6334     next if $opt{___recursive_isa_done}->{$p_res->{uri}};
6335     $opt{___recursive_isa_done}->{$p_res->{uri}} = true;
6336 wakaba 1.48 push @$r, @{$p_res-><M::DISResourceProp.getPropertyResourceList>
6337 wakaba 1.24 ($propName, recursive => true,
6338     recursive_isa => $recursiveISA,
6339     ___recursive_isa_done => $opt{___recursive_isa_done},
6340     default_media_type => $defaultMediaType)};
6341     }
6342     }__;
6343     }
6344 wakaba 1.10 if ($recursiveISA) {
6345     __DEEP{
6346     $opt{___recursive_isa_done} ||= {$self->{uri} => true};
6347     my @p_res = @$r;
6348     for my $p_res (@p_res) {
6349     next if $opt{___recursive_isa_done}->{$p_res->{uri}};
6350     $opt{___recursive_isa_done}->{$p_res->{uri}} = true;
6351 wakaba 1.48 push @$r, @{$p_res-><M::DISResourceProp.getPropertyResourceList>
6352 wakaba 1.33 (<Q::dis:ISA>,
6353     recursive => true,
6354 wakaba 1.10 ___recursive_isa_done => $opt{___recursive_isa_done},
6355     default_media_type => $defaultMediaType)};
6356     }
6357     }__;
6358     }
6359 wakaba 1.26 if ($isaRecursive) {
6360 wakaba 1.25 __DEEP{
6361     $opt{___recursive_isa_done} ||= {$self->{uri} => true};
6362 wakaba 1.37 $opt{___isa_recursive_done} ||= {$self->{uri} => true};
6363 wakaba 1.48 my @p_res = @{$self-><M::DISResourceProp.getPropertyResourceList>
6364 wakaba 1.26 (<Q::dis:ISA>, recursive_isa => false,
6365 wakaba 1.37 recursive => false,
6366 wakaba 1.26 default_media_type => <Q::dis:TFQNames>)};
6367 wakaba 1.25 for my $p_res (@p_res) {
6368 wakaba 1.37 next if $opt{___isa_recursive_done}->{$p_res->{uri}};
6369     $opt{___isa_recursive_done}->{$p_res->{uri}} = true;
6370 wakaba 1.48 push @$r, @{$p_res-><M::DISResourceProp.getPropertyResourceList>
6371 wakaba 1.26 ($propName, recursive_isa => false,
6372     recursive => false,
6373 wakaba 1.37 isa_recursive => true,
6374     ___isa_recursive_done =>
6375     $opt{___isa_recursive_done},
6376 wakaba 1.26 default_media_type => $defaultMediaType)};
6377 wakaba 1.25 }
6378     }__;
6379     }
6380    
6381     @Method:
6382 wakaba 1.2 @@Name: addPropertyResourceList
6383     @@enDesc:
6384     Adds a resource to a resource-list property value.
6385     \
6386     {ISSUE:: Should an exception be thrown if the property is
6387     not of list?
6388     \
6389     }
6390 wakaba 1.10 \
6391     {NOTE:: If the property is not <QUOTE::get>ten ever, adding
6392     an item clears the list --- i.e. the property values
6393     in the source tree will be ignored. Call
6394     <M::ManakaiDISPropertyAccessor.getPropertyResourceList>
6395     before adding to avoid this behavior.
6396     \
6397     }
6398 wakaba 1.2 @@PropNameParam:
6399     @@Param:
6400     @@@Name: res
6401 wakaba 1.47 @@@Type: DISResource
6402     @@@clsActualType: ManakaiDISResourceDefinition
6403 wakaba 1.2 @@@enDesc:
6404     A resource to add.
6405     @@Return:
6406     @@@PerlDef:
6407 wakaba 1.48 if ($self->{$propName}) {
6408     my $uriv;
6409     __CODE{dv|createURI::
6410     $uri => {$res-><AG::DISAnyResource.uri>},
6411     $result => $uriv,
6412     }__;
6413     $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
6414     } else {
6415     __CODE{dv|createOrderedList::
6416     $result => {$self->{$propName}},
6417     $type => {<Q::DISCore:URI>},
6418     $base_type => {<Q::DISCore:URI>},
6419     }__;
6420     my $uriv;
6421     __CODE{dv|createURI::
6422     $uri => {$res-><AG::DISAnyResource.uri>},
6423     $result => $uriv,
6424     }__;
6425     $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
6426     }
6427    
6428     @Method:
6429     @@Name: addPropertyResourceUList
6430 wakaba 1.52 @@plMName: add_property_resource_ulist
6431 wakaba 1.48 @@enDesc:
6432     Adds a resource to a resource-list property value.
6433     \
6434     {ISSUE:: Should an exception be thrown if the property is
6435     not of list?
6436     \
6437     }
6438     \
6439     {NOTE:: If the property is not <QUOTE::get>ten ever, adding
6440     an item clears the list --- i.e. the property values
6441     in the source tree will be ignored. Call
6442     <M::ManakaiDISPropertyAccessor.getPropertyResourceList>
6443     before adding to avoid this behavior.
6444     \
6445     }
6446     @@PropNameParam:
6447     @@Param:
6448     @@@Name: res
6449     @@@Type: DISResource
6450     @@@clsActualType: ManakaiDISResourceDefinition
6451     @@@enDesc:
6452     A resource to add.
6453     @@Return:
6454     @@@PerlDef:
6455     if ($self->{$propName}) {
6456     my $uriv;
6457     __CODE{dv|createURI::
6458     $uri => {$res-><AG::DISAnyResource.uri>},
6459     $result => $uriv,
6460     }__;
6461     $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
6462 wakaba 1.25 } else {
6463 wakaba 1.48 __CODE{dv|createUnorderedList::
6464     $result => {$self->{$propName}},
6465     $type => {<Q::DISCore:URI>},
6466     $base_type => {<Q::DISCore:URI>},
6467     }__;
6468     my $uriv;
6469     __CODE{dv|createURI::
6470     $uri => {$res-><AG::DISAnyResource.uri>},
6471     $result => $uriv,
6472 wakaba 1.25 }__;
6473 wakaba 1.48 $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
6474 wakaba 1.2 }
6475    
6476 wakaba 1.48 @Method:
6477     @@Name: addPropertyURIUList
6478 wakaba 1.52 @@plMName: add_peoperty_uri_ulist
6479 wakaba 1.48 @@enDesc:
6480     Adds a resource to a resource-list property value.
6481     \
6482     {ISSUE:: Should an exception be thrown if the property is
6483     not of list?
6484     \
6485     }
6486     \
6487     {NOTE:: If the property is not <QUOTE::get>ten ever, adding
6488     an item clears the list --- i.e. the property values
6489     in the source tree will be ignored. Call
6490     <M::ManakaiDISPropertyAccessor.getPropertyResourceList>
6491     before adding to avoid this behavior.
6492     \
6493     }
6494     @@PropNameParam:
6495     @@Param:
6496     @@@Name: uri
6497     @@@Type: AnyURI
6498     @@@enDesc:
6499     A resource to add.
6500     @@Return:
6501     @@@PerlDef:
6502     __DEEP{
6503     if ($self->{$propName}) {
6504     my $uriv;
6505     __CODE{dv|createURI::
6506     $uri => $uri,
6507     $result => $uriv,
6508     }__;
6509     $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
6510     } else {
6511     __CODE{dv|createUnorderedList::
6512     $result => {$self->{$propName}},
6513     $type => {<Q::DISCore|URI>},
6514     $base_type => {<Q::DISCore:URI>},
6515     }__;
6516     my $uriv;
6517     __CODE{dv|createURI::
6518     $uri => $uri,
6519     $result => $uriv,
6520     }__;
6521     $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
6522     }
6523     }__;
6524     ##DISResourceProp
6525    
6526 wakaba 1.3 ElementTypeBinding:
6527     @Name: PropNameParam
6528     @ElementType:
6529     dis:ResourceDef
6530     @ShadowContent:
6531     @@rdf:type:
6532     DISLang:MethodParameter
6533     @@Name: propName
6534     @@Type: ResourceURI
6535     @@Description:
6536     @@@lang:en
6537     @@@@:
6538     The name of the property.
6539    
6540 wakaba 1.2 PropDef:
6541     @QName:isAnon
6542     @Description:
6543     @@lang:en
6544     @@@:
6545     Whether the subject resource is anonymous or not.
6546     @Type:
6547 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
6548 wakaba 1.2
6549     PropDef:
6550     @QName:isDefined
6551     @Description:
6552     @@lang:en
6553     @@@:
6554     Whether the subject resource is defined or not.
6555    
6556     PropDef:
6557 wakaba 1.3 @QName:isReferred
6558 wakaba 1.2 @Description:
6559     @@lang:en
6560     @@@:
6561     Whether the subject resource is referred or not.
6562     @Type:
6563     DOMMain:any
6564    
6565     PropDef:
6566     @QName:definingModule
6567     @Description:
6568     @@lang:en
6569     @@@:
6570     The <QUOTE::dis> module in which the subject resource is defined.
6571 wakaba 1.22 \
6572     {NOTE:: The local name should have been <QUOTE::ownerModule> or some.
6573     \
6574     }
6575 wakaba 1.2 @rdfs:domain:
6576     DISCore:Module
6577 wakaba 1.1
6578     ## -- Datatypes
6579    
6580     URITypeDef:
6581 wakaba 1.3 @QName: AnyURI
6582     @Description:
6583     @@lang:en
6584     @@@:
6585     Any URI references.
6586    
6587     URITypeDef:
6588     @QName: FileURI
6589     @enDesc:
6590     URI references identifying file.
6591    
6592     URITypeDef:
6593 wakaba 1.1 @QName: ForURI
6594     @Description:
6595     @@lang:en
6596     @@@:
6597     <QUOTE::For> URI references.
6598    
6599     DataTypeDef:
6600     @QName: ForURIList
6601     @Description:
6602     @@lang:en
6603     @@@:
6604     References to the array containing <QUOTE::for> URI references.
6605    
6606     URITypeDef:
6607 wakaba 1.3 @QName: ResourceURI
6608     @Description:
6609     @@lang:en
6610     @@@:
6611     A URI reference for a <QUOTE::dis> resource.
6612    
6613     URITypeDef:
6614 wakaba 1.1 @QName: MediaTypeURI
6615     @Description:
6616     @@lang:en
6617     @@@:
6618     Media type URI references.
6619 wakaba 1.3 @rdfs:subClassOf: ResourceURI
6620    
6621     URITypeDef:
6622     @QName: ModuleURI
6623     @enDesc:
6624 wakaba 1.47 URI references for <QUOTE::dis> modules.
6625 wakaba 1.3 @rdfs:subClassOf: ResourceURI
6626    
6627     URITypeDef:
6628     @QName: NameURI
6629     @enDesc:
6630     URI references identifying a resource.
6631     @rdfs:subClassOf: ResourceURI
6632 wakaba 1.10
6633     DataTypeDef:
6634     @QName: ResourceList
6635     @enDesc:
6636     References to array containing resource definition objects.
6637     @rdfs:subClassOf:
6638     Perl:ARRAY::ManakaiDOM:all
6639 wakaba 1.3
6640     ElementTypeBinding:
6641     @Name: DataTypeDef
6642     @ElementType:
6643     dis:ResourceDef
6644     @ShadowContent:
6645     @@rdf:type:
6646     ManakaiDOM:DataType
6647    
6648     ElementTypeBinding:
6649     @Name: URITypeDef
6650     @ElementType:
6651     dis:ResourceDef
6652     @ShadowContent:
6653     @@rdf:type:
6654     ManakaiDOM:DataType
6655     @@rdfs:subClassOf: AnyURI
6656 wakaba 1.1
6657     ## -- Exceptions
6658    
6659     XParamDef:
6660 wakaba 1.5 @QName: anotherSourceNode
6661     @enDesc:
6662     Another source node in which an error has occurred. In cases
6663     of <QUOTE::already defined> errors, it is the node that
6664     defines the resource first.
6665     @Type: ManakaiDISNode
6666 wakaba 1.3
6667 wakaba 1.12 ResourceDef:
6668     @QName: UNDECLARED_NS_PREFIX_ERR
6669 wakaba 1.49 @For: ForEmpty
6670 wakaba 1.12 @AliasFor:
6671     DIS:UNDECLARED_NS_PREFIX_ERR::swcfg21:ForLatest
6672    
6673 wakaba 1.47 ResourceDef:
6674     @rdf:type:
6675     @@@: dis|MultipleResource
6676     @@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
6677     @resourceFor: ManakaiDOM|ForIF
6678     @resourceFor:
6679     @@@: ManakaiDOM|ForClass
6680     @@ForCheck: ForEmpty !=ForEmpty
6681     @For: ForLatest
6682     @For: =ForEmpty
6683    
6684     @rdf:type:
6685     @@@: ManakaiDOM|ExceptionIF
6686     @@ForCheck: ManakaiDOM|ForIF
6687    
6688     @rdf:type:
6689     @@@: ManakaiDOM|ExceptionClass
6690     @@ForCheck: ManakaiDOM|ForClass
6691    
6692     @Implement:
6693     @@@: ||ForEmpty||ManakaiDOM|ForIF
6694     @@ContentType: DISCore|TFPQNames
6695     @@ForCheck: ManakaiDOM|ForClass ForEmpty
6696     @Implement:
6697     @@@: ||ForLatest||ManakaiDOM|ForIF
6698     @@ContentType: DISCore|TFPQNames
6699     @@ForCheck: ManakaiDOM|ForClass ForLatest
6700    
6701     @DOMMain:implementFeature:
6702     @@@: CoreFeature10
6703     @@For: ForLatest
6704    
6705     @Implement:
6706     @@@: DOMMain|ManakaiDOMExceptionIF||ManakaiDOM|Perl
6707     @@ForCheck: ManakaiDOM|ForClass
6708    
6709     @ISA:
6710     @@@: ManakaiDOM|ManakaiDOMException||ManakaiDOM|Perl
6711     @@ForCheck: ManakaiDOM|ForClass
6712    
6713     @IFQName: DISException
6714 wakaba 1.3 @ClsQName: ManakaiDISException
6715 wakaba 1.47
6716     @Description:
6717     @@lang:en
6718     @@@:
6719     Exceptions for the <QUOTE::dis> operations.
6720    
6721     @ResourceDef:
6722     @@rdf:type: ManakaiDOM|ConstGroup
6723     @@ForCheck: !=ForEmpty
6724    
6725     @@IFQName: DISExceptionCode
6726 wakaba 1.3 @@ClsQName: ManakaiDISExceptionCode
6727 wakaba 1.52 @@plCName: DISExceptionCode
6728 wakaba 1.47
6729     @@rdfs:subClassOf:
6730     DOMMain:unsigned-short::ManakaiDOM:all
6731     @@Type:
6732     DOMMain:unsigned-short::ManakaiDOM:all
6733    
6734 wakaba 1.3 @@enDesc:
6735     Exception codes for <Class::ManakaiDISException>.
6736 wakaba 1.47
6737 wakaba 1.3 @@XConstDef:
6738 wakaba 1.11 @@@Name: HIERARCHY_REQUEST_ERR
6739 wakaba 1.49 @@@Value:
6740     @@@@@:3
6741     @@@@ContentType: DISCore|Integer
6742 wakaba 1.11 @@@enDesc:
6743     An attempt is made to break the hierarchy.
6744     @@@XSubTypeDef:
6745     @@@@QName: MERGE_ITSELF_ERR
6746     @@@@enDesc:
6747     An attempt is made to merge the resource to itself.
6748     @@@@XSourceNodeParam:
6749     @@@@XParam:
6750     @@@@@QName:uri
6751     @@@@@enDesc:
6752     The URI reference of the resource to merge.
6753     @@@@enMufDef:
6754     An attempt is made to merge the resource <%p (name => {<Q::DIS:uri>}
6755     );> to itself
6756     @@XConstDef:
6757 wakaba 1.8 @@@Name: NOT_SUPPORTED_ERR
6758 wakaba 1.49 @@@Value:
6759     @@@@@:9
6760     @@@@ContentType: DISCore|Integer
6761 wakaba 1.8 @@@enDesc:
6762     An attempt is made to do something the implementation does not support.
6763     @@@XSubTypeDef:
6764     @@@@QName: UNSUPPORTED_MEDIA_TYPE_ERR
6765     @@@@enDesc:
6766     The implementation does not support the media type.
6767     @@@@XParam:
6768     @@@@@QName: uri
6769     @@@@@enDesc:
6770     The URI reference of the media type that is not supported.
6771     @@@@XSourceNodeParam:
6772 wakaba 1.30 @@@@XParam:
6773     @@@@@QName:elementType
6774     @@@@@enDesc:
6775     The URI reference of the element type of the element
6776     in which the media type is referenced.
6777 wakaba 1.12 @@@@enMufDef:
6778 wakaba 1.30 %p (name => {<Q::DIS:sourceCode>}, prefix => {"}, suffix => {": }
6779     );%p (name => {<Q::DIS:elementType>}, prefix => { (Element type: <},
6780     suffix => {>) }
6781     );Media type <%p (name => {<Q::DIS:uri>});> is not supported
6782 wakaba 1.3 @@@XSubTypeDef:
6783 wakaba 1.13 @@@@QName: UNSUPPORTED_ELEMENT_TYPE_ERR
6784     @@@@enDesc:
6785     An unsupported type of element is encounted.
6786     @@@@XSourceNodeParam:
6787     @@@@XParam:
6788     @@@@@QName:elementType
6789     @@@@@enDesc:
6790     The element type URI reference of the element.
6791 wakaba 1.16 @@@@enMufDef:
6792     Element type "%p (name => {<Q::DIS:elementType>});" is not supported
6793 wakaba 1.13 @@@XSubTypeDef:
6794 wakaba 1.12 @@@@QName: NO_PERL_CODE_IMPL_ERR
6795 wakaba 1.3 @@@@enDesc:
6796 wakaba 1.12 There is no implementation that supports the
6797     <Feature::Util:PerlCode> feature, version
6798     <FeatureVer::1.0>.
6799 wakaba 1.3 @@XConstDef:
6800     @@@Name: INVALID_STATE_ERR
6801 wakaba 1.49 @@@Value:
6802     @@@@@:11
6803     @@@@ContentType: DISCore|Integer
6804 wakaba 1.3 @@@enDesc:
6805     An attempt is made to use an object that is not (or no longer) usable.
6806     @@@XSubTypeDef:
6807     @@@@QName: NO_ASSOCIATED_DB_ERR
6808     @@@@enDesc:
6809     No <QUOTE::dis> database has been associated with this document.
6810 wakaba 1.4 @@XConstDef:
6811     @@@Name: INVALID_SOURCE_ERR
6812 wakaba 1.49 @@@Value:
6813     @@@@@: 200
6814     @@@@ContentType: DISCore|Integer
6815 wakaba 1.4 @@@enDesc:
6816     The source input is well-formed but invalid.
6817     @@@XSubTypeDef:
6818     @@@@QName: NO_MODULE_QNAME_ERR
6819     @@@@enDesc:
6820     The <Q::dis:Module> element must have its <Q::dis:QName>
6821     attribute.
6822 wakaba 1.8 @@@@XSourceNodeParam:
6823     @@@XSubTypeDef:
6824     @@@@QName: NO_LOCAL_NAME_ERR
6825     @@@@enDesc:
6826     The resource does not have a local name.
6827     @@@@XSourceNodeParam:
6828 wakaba 1.4 @@@XSubTypeDef:
6829     @@@@QName: UNABLE_TO_GET_MODULE_ERR
6830     @@@@enDesc:
6831     The implementation is unable to get the module source.
6832     @@@@Def:
6833     @@@@@ContentType:
6834     lang:muf
6835     @@@@@lang:en
6836     @@@@@@:
6837     Unable to get the module source of <%p (name => {<Q::DIS:uri>});>
6838     @@@@XParam:
6839     @@@@@QName: uri
6840     @@@@@enDesc:
6841     The URI reference of the module.
6842     @@@@XParam:
6843     @@@@@QName: namespaceURI
6844     @@@@@enDesc:
6845     The namespace URI of the module name.
6846     @@@@XParam:
6847     @@@@@QName: localName
6848     @@@@@enDesc:
6849     The local name of the module name.
6850     @@@@XParam:
6851     @@@@@QName: for
6852     @@@@@enDesc:
6853     The <QUOTE::for> of the module.
6854 wakaba 1.5 @@@XSubTypeDef:
6855     @@@@QName: NO_FOR_QNAME_ERR
6856     @@@@enDesc:
6857     A <Q::dis:ForDef> element must have <Q::dis:QName> attribute.
6858     @@@@XSourceNodeParam:
6859     @@@XSubTypeDef:
6860     @@@@QName: FOR_ALREADY_DEFINED_ERR
6861     @@@@enDesc:
6862     The <QUOTE::for> named as the same URI reference has
6863     already defined.
6864     @@@@XSourceNodeParam:
6865     @@@@XParam:
6866     @@@@@QName: anotherSourceNode
6867     @@@@@enDesc:
6868     The node that defines the <QUOTE::for> URI reference before.
6869 wakaba 1.7 @@@@XParam:
6870     @@@@@Name: uri
6871     @@@@@enDesc:
6872     The URI reference of the <QUOTE::for> attempted to define.
6873     @@@@enMufDef:
6874     <QUOTE::For> <%p (name => {<Q::DIS:uri>});> is already defined
6875 wakaba 1.5 @@@XSubTypeDef:
6876     @@@@QName: RESOURCE_ALREADY_DEFINED_ERR
6877     @@@@enDesc:
6878     The <QUOTE::dis> resource named as the same URI reference has
6879     already defined.
6880     @@@@XSourceNodeParam:
6881     @@@@XParam:
6882 wakaba 1.54 @@@@@@: anotherSourceNode
6883 wakaba 1.5 @@@@@enDesc:
6884     The node that defines the <QUOTE::for> URI reference before.
6885 wakaba 1.7 @@@@XParam:
6886 wakaba 1.54 @@@@@@: uri
6887 wakaba 1.7 @@@@@enDesc:
6888     The URI reference of the resource attempted to define.
6889 wakaba 1.54 @@@@XParam:
6890     @@@@@@: moduleURI
6891     @@@@@enDesc:
6892     A URI of the module in which the <Q::DIS|uri> resource is
6893     defined.
6894 wakaba 1.7 @@@@enMufDef:
6895 wakaba 1.54 %p (name => {<Q::DIS:moduleURI>}, prefix => {Module <},
6896     suffix => {>: })
6897     ;Resource <%p (name => {<Q::DIS:uri>});> is already defined
6898 wakaba 1.5 @@@XSubTypeDef:
6899     @@@@QName: ELEMENT_NOT_ALLOWED_ERR
6900     @@@@enDesc:
6901     An element has occured where it is not allowed.
6902     @@@@enMufDef:
6903     Module <%p (name => {<Q::DIS:uri>});>:
6904     Element of type <%p (name => {<Q::DIS:elementType>});>
6905     is not allowed here
6906     @@@@XSourceNodeParam:
6907     @@@@XParam:
6908     @@@@@QName: elementType
6909     @@@@@enDesc:
6910     The expanded element type name of the element.
6911     @@@@XParam:
6912     @@@@@QName: uri
6913     @@@@@enDesc:
6914     The URI reference of the module.
6915 wakaba 1.7 @@@XSubTypeDef:
6916     @@@@QName: NO_REQUIRED_ATTR_ERR
6917     @@@@enDesc:
6918     A required attribute is not specified.
6919     @@@@XSourceNodeParam:
6920     @@@@XParam:
6921     @@@@@QName: elementType
6922     @@@@@enDesc:
6923     The expanded URI reference of the attribute name.
6924     @@@@enMufDef:
6925     Attribute <%p (name => {<Q::DIS:elementType>});> must be specified
6926 wakaba 1.8 @@@XSubTypeDef:
6927     @@@@QName: FOR_NOT_DEFINED_ERR
6928     @@@@enDesc:
6929     A <QUOTE::for> is referred but not defined.
6930     @@@@XSourceNodeParam:
6931     @@@@XParam:
6932     @@@@@QName: uri
6933     @@@@@enDesc:
6934     The URI reference of the <QUOTE::for> that is not defined.
6935     @@@@enMufDef:
6936     <QUOTE::For> <%p (name => {<Q::DIS:uri>});> is not defined
6937     @@@XSubTypeDef:
6938     @@@@QName: RESOURCE_NOT_DEFINED_ERR
6939     @@@@enDesc:
6940 wakaba 1.13 A <QUOTE::dis> resource is referred but not defined
6941     or the resource referred does not have the type expected.
6942 wakaba 1.8 @@@@XSourceNodeParam:
6943     @@@@XParam:
6944 wakaba 1.48 @@@@@@: sourceNodePath
6945     @@@@@enDesc:
6946     A node path string of the source node.
6947     @@@@XParam:
6948 wakaba 1.8 @@@@@QName: uri
6949     @@@@@enDesc:
6950     The URI reference of the resource that is not defined.
6951 wakaba 1.13 @@@@XParam:
6952     @@@@@QName: elementType
6953     @@@@@enDesc:
6954     <QUOTE::dis> element type (either tree element type
6955     or preprocessing element type) of the element
6956     in which a reference to the undefined resource is contained.
6957     @@@@XParam:
6958 wakaba 1.30 @@@@@QName:parentURI
6959     @@@@@enDesc:
6960     The URI reference of the resource from whose child resources
6961     a resource is tried to find.
6962     @@@@XParam:
6963 wakaba 1.54 @@@@@QName: moduleURI
6964     @@@@@enDesc:
6965     The URI of the module in which the resourece should be included.
6966     @@@@XParam:
6967 wakaba 1.13 @@@@@QName: localName
6968     @@@@@enDesc:
6969     The local name of the undefined resource.
6970     @@@@XParam:
6971     @@@@QName: sourceCode
6972     @@@@enDesc:
6973     Source code fragment that referres this resource.
6974     @@@@XParam:
6975     @@@@@QName:expectedType
6976     @@@@@enDesc:
6977     Expected resource type.
6978 wakaba 1.8 @@@@enMufDef:
6979 wakaba 1.54 %p (name => {<Q::DIS:moduleURI>}, prefix => {Module <},
6980     suffix => {>: })
6981     ;%p (name => {<Q::DIS:sourceNodePath>}, suffix => {: })
6982     ;%p (name => {<Q::DIS:sourceCode>}, prefix => {"}, suffix => {": })
6983     ;%p (name => {<Q::DIS:parentURI>}, prefix => {(In <}, suffix => {>) })
6984     ;Resource%p (name => {<Q::DIS:uri>}, prefix => { <},
6985 wakaba 1.13 suffix => {>});%p (name => {<Q::DIS:localName>},
6986     prefix => { "}, suffix => {"}); is not defined or wrong type%p
6987     (name => {<Q::DIS:expectedType>}, prefix => { (<},
6988     suffix => {> is expected)});
6989     @@@XSubTypeDef:
6990     @@@@QName: NO_SOURCE_NODE_ERR
6991     @@@@enDesc:
6992     A resource does not have associated node in the source tree.
6993     @@@@XSourceNodeParam:
6994     @@@@XParam:
6995     @@@@@QName:uri
6996     @@@@@enDesc:
6997     The URI reference of the resource.
6998 wakaba 1.8 @@@XSubTypeDef:
6999     @@@@QName: RESERVED_PERL_METHOD_NAME_ERR
7000     @@@@enDesc:
7001     A reserved Perl method name is used.
7002     @@@@XParam:
7003     @@@@@QName:uri
7004     @@@@@enDesc:
7005     The URI reference of the method resource.
7006     @@@@XSourceNodeParam:
7007     @@@@XParam:
7008     @@@@@QName: generatedName
7009     @@@@@enDesc:
7010     A reserved method name.
7011     @@@XSubTypeDef:
7012     @@@@QName: NO_DIS_TYPE_ERR
7013     @@@@enDesc:
7014     <Q::dis:Type> attribute is not found.
7015     @@@@XSourceNodeParam:
7016 wakaba 1.48 @@@@enMufDef:
7017     Resource "%t (name => {<Q::DIS:uri>});" has no "dis:Type" attribute
7018 wakaba 1.12 @@@XSubTypeDef:
7019     @@@@QName: NO_METHOD_RETURN_ERR
7020     @@@@enDesc:
7021     A <Q::DISLang:Method> resource does not have any
7022     <Q::DISLang:MethodReturn> child.
7023     @@@@XSourceNodeParam:
7024 wakaba 1.22 @@@@XParam:
7025     @@@@@QName:errResource
7026     @@@@@enDesc: The method resource.
7027     @@@@XParam:
7028     @@@@@QName:uri
7029     @@@@@enDesc:
7030     The URI reference of the method.
7031     @@@@XParam:
7032     @@@@@QName:localName
7033     @@@@@enDesc:
7034     The local name of the resource.
7035     @@@@enMufDef:
7036     Method "%p (name => {<Q::DIS:localName>});" does not have
7037     "Return" child
7038 wakaba 1.12 @@@XSubTypeDef:
7039     @@@@QName: NO_ATTR_GET_ERR
7040     @@@@enDesc:
7041     A <Q::DISLang:Attribute> resource does not have any
7042     <Q::DISLang:AttributeGet> child.
7043     @@@@XSourceNodeParam:
7044 wakaba 1.13 @@@XSubTypeDef:
7045     @@@@QName:INTERFACE_CLASS_METHOD_ERR
7046     @@@@enDesc:
7047     An attempt is made to call a static (class) method
7048     from an interface.
7049     @@@@XSourceNodeParam:
7050     @@@@XParam:
7051     @@@@@QName:uri
7052     @@@@@enDesc:
7053     The URI reference of the interface.
7054     @@@@XParam:
7055     @@@@@QName:sourceCode
7056     @@@@@enDesc:
7057     Source code fragment that calls a class method.
7058     @@@@XParam:
7059     @@@@@QName:elementType
7060     @@@@@enDesc:
7061     The element type URI reference of the element
7062     that calls a method.
7063     @@@XSubTypeDef:
7064     @@@@QName: BROKEN_PARAM_SPEC_ERR
7065     @@@@enDesc:
7066     A parameter specification is broken.
7067     @@@@XParam:
7068     @@@@@QName: sourceCode
7069     @@@@@enDesc:
7070     Source code fragment that contains the broken parameter
7071     specification.
7072     @@@@XSourceNodeParam:
7073 wakaba 1.15 @@@@enMufDef:
7074     %p (name => {<Q::DIS:sourceCode>}, prefix => {"},
7075     suffix => {": });Broken parameter specification
7076 wakaba 1.13 @@@XSubTypeDef:
7077     @@@@QName:PERL_PREPROCESS_NO_ELEMENT_TYPE_ERR
7078     @@@@enDesc:
7079     A preprocessing instruction does not have its element
7080     type.
7081     @@@@XSourceNodeParam:
7082     @@@@XParam:
7083     @@@@@QName:sourceCode
7084     @@@@@enDesc:
7085     Source code fragment.
7086 wakaba 1.16 @@@@enMufDef:
7087     %p (name => {<Q::DIS:sourceCode>}, prefix => {"},
7088     suffix => {": });Element type name is not specified
7089 wakaba 1.13 @@@XSubTypeDef:
7090 wakaba 1.15 @@@@QName: NO_PERL_PACKAGE_NAME_ERR
7091 wakaba 1.13 @@@@enDesc:
7092 wakaba 1.15 No Perl package name is defined for the resource referred.
7093 wakaba 1.13 @@@@XSourceNodeParam:
7094     @@@@XParam:
7095 wakaba 1.15 @@@@@QName:sourceCode
7096 wakaba 1.13 @@@@@enDesc:
7097     Source code fragment.
7098     @@@@XParam:
7099 wakaba 1.15 @@@@@QName:uri
7100     @@@@@enDesc:
7101     THe URI reference of the resource referred.
7102     @@@@XParam:
7103     @@@@@QName:elementType
7104     @@@@@enDesc:
7105     The element type of Perl preprocessing instruction
7106     in which the resource is referred.
7107     @@@@enMufDef:
7108     %p (name => {<Q::DIS:uri>}, prefix => {<}, suffix => {>: });Perl
7109     package name is not defined
7110     @@@XSubTypeDef:
7111     @@@@QName: PERL_PREPROCESS_NO_EXCEPTION_TYPE_ERR
7112     @@@@enDesc:
7113     An exception type specification is required.
7114     @@@@XSourceNodeParam:
7115     @@@@XSourceCodeParam:
7116     @@@@XParam:
7117     @@@@@QName:elementType
7118     @@@@@enDesc:
7119     The element type of the preprocessing instruction.
7120     @@@XSubTypeDef:
7121     @@@@QName: PERL_PREPROCESS_NO_CODE_NAME_ERR
7122     @@@@enDesc:
7123     A code name specification is required.
7124     @@@@XSourceNodeParam:
7125     @@@@XSourceCodeParam:
7126     @@@@XParam:
7127 wakaba 1.13 @@@@@QName:elementType
7128     @@@@@enDesc:
7129 wakaba 1.15 The element type of the preprocessing instruction.
7130 wakaba 1.13 @@@XSubTypeDef:
7131     @@@@QName: PERL_CODE_NOT_DEFINED_ERR
7132     @@@@enDesc:
7133 wakaba 1.15 The specified resource does not have its Perl definition.
7134 wakaba 1.13 @@@@XSourceNodeParam:
7135 wakaba 1.15 @@@@XSourceCodeParam:
7136 wakaba 1.13 @@@@XParam:
7137 wakaba 1.15 @@@@@QName:elementType
7138     @@@@@enDesc:
7139     The element type of the preprocessing instruction.
7140     @@@@XParam:
7141     @@@@@QName:uri
7142 wakaba 1.13 @@@@@enDesc:
7143 wakaba 1.15 The URI reference of the resource referred.
7144 wakaba 1.13 @@@@XParam:
7145     @@@@@QName:localName
7146     @@@@@enDesc:
7147     The local name of the resource referred.
7148 wakaba 1.51 @@@@enMufDef:
7149     Resource%p (name => {<Q::DIS:uri>}, prefix => { "}, suffix => {"});
7150     has no Perl code definition
7151 wakaba 1.15 @@@XSubTypeDef:
7152     @@@@QName: PERL_PREPROCESS_NO_METHOD_ERR
7153     @@@@enDesc:
7154     A preprocessing instruction which is only allowed in
7155     method definitions is used in a code which is not a method.
7156     @@@@XSourceNodeParam:
7157     @@@@XSourceCodeParam:
7158 wakaba 1.13 @@@@XParam:
7159 wakaba 1.15 @@@@@QName:elementType
7160 wakaba 1.13 @@@@@enDesc:
7161 wakaba 1.15 The element type of the preprocessing instruction.
7162 wakaba 1.14 @@@XSubTypeDef:
7163 wakaba 1.15 @@@@QName: PERL_PREPROCESS_NO_FOR_ERR
7164 wakaba 1.14 @@@@enDesc:
7165 wakaba 1.15 A <QUOTE::for> specification is required.
7166 wakaba 1.14 @@@@XSourceNodeParam:
7167 wakaba 1.15 @@@@XSourceCodeParam:
7168 wakaba 1.14 @@@@XParam:
7169 wakaba 1.15 @@@@@QName:elementType
7170 wakaba 1.14 @@@@@enDesc:
7171 wakaba 1.15 The element type of the preprocessing instruction.
7172     @@@XSubTypeDef:
7173     @@@@QName: PERL_PREPROCESS_NO_ASSERT_TYPE_ERR
7174     @@@@enDesc:
7175     An assertion type specification is required.
7176     @@@@XSourceNodeParam:
7177     @@@@XSourceCodeParam:
7178 wakaba 1.14 @@@@XParam:
7179 wakaba 1.15 @@@@@QName:elementType
7180 wakaba 1.14 @@@@@enDesc:
7181 wakaba 1.15 The element type of the preprocessing instruction.
7182     @@@XSubTypeDef:
7183     @@@@QName: PERL_PREPROCESS_BLOCK_NOT_ALLOWED_ERR
7184     @@@@enDesc:
7185     A preprocessing instruction block occurred with
7186     element type which does not allow it.
7187     @@@@XSourceNodeParam:
7188     @@@@XSourceCodeParam:
7189 wakaba 1.14 @@@@XParam:
7190     @@@@@QName:elementType
7191     @@@@@enDesc:
7192 wakaba 1.15 The element type of the preprocessing instruction.
7193 wakaba 1.18 @@@XSubTypeDef:
7194     @@@@QName: NON_NAMED_PARAMETER_AFTER_NAMED_ERR
7195     @@@@enDesc:
7196     A non-named method parameter following
7197     any named method parameter is occurred.
7198     @@@@XSourceNodeParam:
7199     @@@@XParam:
7200     @@@@@QName:uri
7201     @@@@@enDesc:
7202     The URI reference of the non-named method parameter resource.
7203     @@@@XParam:
7204     @@@@@QName:localName
7205     @@@@@enDesc:
7206     The local name of the non-named method parameter.
7207 wakaba 1.19 @@@XSubTypeDef:
7208     @@@@QName:DISPERL_NO_VALUE_ALLOWED_ERR
7209     @@@@enDesc:
7210     An element node have a value but the definition
7211     of that element type does not allow it.
7212     @@@@XSourceNodeParam:
7213     @@@@XParam:
7214     @@@@@QName:elementType
7215     @@@@@enDesc:
7216     The element type URI reference of the element.
7217     @@@XSubTypeDef:
7218     @@@@QName:NO_CONST_VALUE_ERR
7219     @@@@enDesc:
7220     The source element node for a constant value resource
7221     does not have <Q::dis:Value> attribute.
7222     @@@@XSourceNodeParam:
7223     @@@@XParam:
7224     @@@@@QName:elemntType
7225     @@@@@enDesc:
7226     The element type URI reference of the element from which
7227     a constant value resource is referred.
7228     @@@@XParam:
7229     @@@@@QName:uri
7230     @@@@@enDesc:
7231     The resource URI reference of the constant value resource.
7232     @@@@XParam:
7233     @@@@@QName:localName
7234     @@@@@enDesc:
7235     The local name of the constant value resource.
7236     @@@XSubTypeDef:
7237     @@@@QName:NO_ATTR_SET_ERR
7238     @@@@enDesc:
7239     An attribute setter is referred but the attribute
7240     does not define any setter.
7241     @@@@XSourceNodeParam:
7242     @@@@XParam:
7243     @@@@@QName:errResource
7244     @@@@@enDesc:
7245     The attribute resource.
7246     @@@@XParam:
7247     @@@@@QName:elementType
7248     @@@@@enDesc:
7249     The type of the element by which this attribute
7250     is referred.
7251 wakaba 1.20 @@@XSubTypeDef:
7252     @@@@QName: PERL_SUBROUTINE_ALREADY_DEFINED_ERR
7253     @@@@enDesc:
7254     A resource defines a Perl subroutine whose name is
7255     same as another subroutine.
7256     @@@@XSourceNodeParam:
7257     @@@@XParam:
7258     @@@@@QName:uri
7259     @@@@@enDesc:
7260     The URI reference of the resource that defines the Perl subroutine.
7261     @@@@XParam:
7262     @@@@@QName:
7263     PerlCode:localName
7264     @@@@@enDesc:
7265     The name of the Perl subroutine.
7266     @@@XSubTypeDef:
7267     @@@@QName: PERL_OPERATOR_ALREADY_OVERLOADED_ERR
7268     @@@@enDesc:
7269     A resource is defined to overload a Perl operator which
7270     is already overloaded by another resource.
7271     @@@@XSourceNodeParam:
7272     @@@@XParam:
7273     @@@@@QName:uri
7274     @@@@@enDesc:
7275     The URI reference of the resource that defines the overloading.
7276     @@@@XParam:
7277     @@@@@QName:
7278     PerlCode:operator
7279     @@@@@enDesc:
7280     The operator.
7281     @@@XSubTypeDef:
7282     @@@@QName: PERL_UNUSED_SUBROUTINE_ERR
7283     @@@@enDesc:
7284     A resource defines a Perl subroutine but it is not used.
7285     @@@@XSourceNodeParam:
7286     @@@@XParam:
7287     @@@@@QName:uri
7288     @@@@@enDesc:
7289     The URI reference of the resource.
7290 wakaba 1.22 @@@XSubTypeDef:
7291     @@@@QName: NO_LICENSE_ATTR_ERR
7292     @@@@enDesc:
7293     The <Q::dis:Module> element does not have the
7294     <Q::dis:License> attribute.
7295     @@@@XSourceNodeParam:
7296     @@@@XParam:
7297     @@@@@QName:uri
7298     @@@@@enDesc:
7299     The URI reference of the module.
7300 wakaba 1.25 @@@XSubTypeDef:
7301     @@@@QName: UNSUPPORTED_ROLE_ERR
7302     @@@@enDesc:
7303     A <Q::dis:Role> is not supported.
7304     @@@@XSourceNodeParam:
7305     @@@@XParam:
7306     @@@@@QName:uri
7307     @@@@@enDesc:
7308     The URI reference of the unsupported role.
7309     @@@@enMufDef:
7310     Role <%p (name => {<Q::DIS:uri>});> is not supported
7311 wakaba 1.37 @@@XSubTypeDef:
7312     @@@@QName: NO_REFLECT_GET_DEFINED_ERR
7313     @@@@enDesc:
7314     An attribute is defined to reflect an element attribute
7315     but no reflecting attribute getter template is defined.
7316     @@@@XSourceNodeParam:
7317     @@@@XParam:
7318     @@@@@QName:uri
7319     @@@@@enDesc:
7320     The URI reference of the datatype resource for which
7321     a getter template should have been defined.
7322     @@@XSubTypeDef:
7323     @@@@QName: NO_REFLECT_SET_DEFINED_ERR
7324     @@@@enDesc:
7325     An attribute is defined to reflect an element attribute
7326     but no reflecting attribute setter template is defined.
7327     @@@@XSourceNodeParam:
7328     @@@@XParam:
7329     @@@@@QName:uri
7330     @@@@@enDesc:
7331     The URI reference of the datatype resource for which
7332     a setter template should have been defined.
7333 wakaba 1.40 @@@XSubTypeDef:
7334 wakaba 1.43 @@@@QName: NO_END_TAG_ERR
7335     @@@@enDesc:
7336 wakaba 1.40 Close tag not found.
7337 wakaba 1.43 @@@@XSourceNodeParam:
7338     @@@@XParam:
7339 wakaba 1.49 @@@@@@: elementType
7340     @@@@@enDesc:
7341 wakaba 1.40 The type URI reference of the element that is not closed.
7342 wakaba 1.43 @@@@XParam:
7343 wakaba 1.49 @@@@@@: sourceCode
7344     @@@@@enDesc:
7345 wakaba 1.40 The source code fragment near the position where
7346     an end tag is required.
7347 wakaba 1.43 @@@@enMufDef:
7348 wakaba 1.40 End tag for element "%p (name => {<Q::DIS:elementType>});"
7349 wakaba 1.43 is required%p (name => {<Q::DIS:sourceCode>},
7350     prefix => { (}, suffix => {)});
7351 wakaba 1.49 @@@XSubTypeDef:
7352     @@@@QName: NO_RDF_TYPE_ERR
7353     @@@@enDesc:
7354     There is a resource definition element that does
7355     not have any <Q::rdf:type> attribute.
7356     @@@@XSourceNodeParam:
7357     @@@@XParam:
7358     @@@@@@: uri
7359     @@@@@enDesc:
7360     The URI of the resource which does not have <Q::rdf:type>.
7361     @@@@enMufDef:
7362     Resource%p (name => {<Q::DIS:uri>}, prefix => { "},
7363     suffix => {"}); does not have "rdf:type" attribute
7364 wakaba 1.53 @@@XSubTypeDef:
7365     @@@@QName: PERL_HASH_KEY_ALREADY_DEFINED_ERR
7366     @@@@enDesc:
7367     A hash key is already defined.
7368     @@@@XSourceNodeParam:
7369     @@@@XParam:
7370     @@@@@@:uri
7371     @@@@@enDesc:
7372     The URI of the resource tried to register.
7373     @@@@XParam:
7374     @@@@@@:anotherURI
7375     @@@@@enDesc:
7376     The URI of the already registered resource.
7377     @@@@XParam:
7378     @@@@@@:hashKeyName
7379     @@@@@enDesc:
7380     Hash key.
7381     @@@@XParam:
7382     @@@@@@:hashKeyScope
7383     @@@@@enDesc:
7384     Hash key scope.
7385     @@@@enMufDef:
7386     <%p (name => {<Q::DIS:uri>});>:
7387 wakaba 1.56 Hash key "%p (name => {<Q::DIS:hashKeyName>});" in
7388 wakaba 1.53 <%p (mame => {<Q::DIS:hashKeyScope>});> is already
7389 wakaba 1.54 defined for <%p (name => {<Q::DIS:anotherURI>});>
7390 wakaba 1.37 @ImplNote:
7391     @@lang:en
7392     @@@:
7393     ISSUE: Too many subtypes for a type! New type should be added?
7394 wakaba 1.4 ##DISException
7395 wakaba 1.53
7396     XParamDef:
7397     @QName: hashKeyName
7398     @Type: DISLang|String
7399     @enDesc:
7400     See <M::dp|DISDatabasePerl.plAddHashKey>.
7401    
7402     XParamDef:
7403     @QName: hashKeyScope
7404     @Type: AnyURI
7405     @enDesc:
7406     See <M::dp|DISDatabasePerl.plAddHashKey>.
7407    
7408     XParamDef:
7409     @QName: anotherURI
7410     @Type: ResourceURI
7411     @enDesc:
7412     A URI of another related resource.
7413 wakaba 1.13
7414     XParamDef:
7415     @QName:expectedType
7416     @Type: ResourceURI
7417     @enDesc:
7418     Expected resource type URI reference.
7419    
7420     XParamDef:
7421     @QName: sourceCode
7422     @Type:
7423     DISLang:String::ManakaiDOM:all
7424     @enDesc:
7425     The source code fragment in which an error occurred.
7426 wakaba 1.5
7427     XParamDef:
7428     @QName: elementType
7429     @Type: ResourceURI
7430     @enDesc:
7431     The name of the element type.
7432    
7433     XParamDef:
7434     @QName: uri
7435     @Type: ResourceURI
7436     @enDesc:
7437     The name of the resource, composed from <Q::namespaceURI>,
7438     <Q::localName> and <Q::for>.
7439    
7440     XParamDef:
7441     @QName: localName
7442     @Type:
7443 wakaba 1.18 DISCore:LocalName::ManakaiDOM:all
7444 wakaba 1.5 @enDesc:
7445     The local name of the resource, unique in <Q::namespaceURI> namespace.
7446    
7447     XParamDef:
7448     @QName: namespaceURI
7449     @Type: AnyURI
7450     @enDesc:
7451     The namespace URI reference of the resource name.
7452    
7453     XParamDef:
7454     @QName: for
7455     @Type: ForURI
7456     @enDesc:
7457     The <QUOTE::for> URI reference of the resource.
7458    
7459     ElementTypeBinding:
7460     @Name: XSourceNodeParam
7461     @ElementType:
7462     ManakaiDOM:exceptionOrWarningParameter
7463     @ShadowContent:
7464     @@QName: sourceNode
7465     @@Description:
7466     @@@lang:en
7467     @@@@:
7468     The node in which an error has occurred.
7469 wakaba 1.15
7470     ElementTypeBinding:
7471     @Name: XSourceCodeParam
7472     @ElementType:
7473     ManakaiDOM:exceptionOrWarningParameter
7474     @ShadowContent:
7475     @@QName: sourceCode
7476     @@Description:
7477     @@@lang:en
7478     @@@@:
7479     The source code in which an error has occurred.
7480 wakaba 1.4
7481 wakaba 1.52 ResourceDef:
7482     @QName: ManakaiDISExceptionTarget
7483     @AliasFor: dx|ManakaiDefaultExceptionHandler||ManakaiDOM|Perl
7484     @For: DIS|ForEmpty
7485 wakaba 1.4
7486 wakaba 1.52 ElementTypeBinding:
7487     @Name: plMName
7488     @ElementType:
7489     DISPerl:methodName
7490     @ShadowContent:
7491     @@ContentType: lang|Perl
7492     @@For: ManakaiDOM|Perl
7493 wakaba 1.4
7494     ElementTypeBinding:
7495 wakaba 1.52 @Name: plCName
7496 wakaba 1.4 @ElementType:
7497 wakaba 1.52 DISPerl:exportTagName
7498 wakaba 1.4 @ShadowContent:
7499 wakaba 1.47 @@ContentType: lang|Perl
7500     @@For: ManakaiDOM|Perl
7501 wakaba 1.3
7502     ElementTypeBinding:
7503     @Name: Method
7504     @ElementType:
7505     dis:ResourceDef
7506     @ShadowContent:
7507     @@rdf:type:
7508     DISLang:Method
7509 wakaba 1.52 @@For: !=ForEmpty
7510 wakaba 1.3
7511     ElementTypeBinding:
7512     @Name: IntMethod
7513     @ElementType:
7514     dis:ResourceDef
7515     @ShadowContent:
7516     @@rdf:type:
7517     DISLang:Method
7518     @@ManakaiDOM:isForInternal:1
7519 wakaba 1.52 @@ForCheck: ManakaiDOM|ForClass
7520 wakaba 1.3
7521     ElementTypeBinding:
7522     @Name: Attr
7523     @ElementType:
7524     dis:ResourceDef
7525     @ShadowContent:
7526     @@rdf:type:
7527     DISLang:Attribute
7528 wakaba 1.52 @@For: !=ForEmpty
7529 wakaba 1.3
7530     ElementTypeBinding:
7531     @Name: Return
7532     @ElementType:
7533     dis:ResourceDef
7534     @ShadowContent:
7535     @@rdf:type:
7536     DISLang:MethodReturn
7537    
7538     ElementTypeBinding:
7539     @Name: Get
7540     @ElementType:
7541     dis:ResourceDef
7542     @ShadowContent:
7543     @@rdf:type:
7544     DISLang:AttributeGet
7545    
7546     ElementTypeBinding:
7547     @Name: Set
7548     @ElementType:
7549     dis:ResourceDef
7550     @ShadowContent:
7551     @@rdf:type:
7552     DISLang:AttributeSet
7553    
7554     ElementTypeBinding:
7555     @Name: Param
7556     @ElementType:
7557     dis:ResourceDef
7558     @ShadowContent:
7559     @@rdf:type:
7560     DISLang:MethodParameter
7561    
7562     ElementTypeBinding:
7563     @Name: PerlDef
7564     @ElementType:
7565     dis:Def
7566     @ShadowContent:
7567     @@ContentType:
7568     lang:Perl
7569    
7570     ElementTypeBinding:
7571     @Name: InCase
7572     @ElementType:
7573     dis:ResourceDef
7574     @ShadowContent:
7575     @@rdf:type:
7576     ManakaiDOM:InCase
7577    
7578     ElementTypeBinding:
7579     @Name: nullCase
7580     @ElementType:
7581     dis:ResourceDef
7582     @ShadowContent:
7583     @@rdf:type:
7584     ManakaiDOM:InCase
7585     @@Value:
7586     @@@is-null:1
7587 wakaba 1.49 @@@ContentType: DISCore|String
7588 wakaba 1.3
7589     ElementTypeBinding:
7590     @Name: TrueCase
7591     @ElementType:
7592     dis:ResourceDef
7593     @ShadowContent:
7594     @@rdf:type:
7595     ManakaiDOM:InCase
7596 wakaba 1.49 @@Value:
7597     @@@@: 1
7598     @@@ContentType: DISCore|Boolean
7599 wakaba 1.3 @@Type:
7600 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
7601 wakaba 1.3
7602     ElementTypeBinding:
7603     @Name: FalseCase
7604     @ElementType:
7605     dis:ResourceDef
7606     @ShadowContent:
7607     @@rdf:type:
7608     ManakaiDOM:InCase
7609 wakaba 1.49 @@Value:
7610     @@@@: 0
7611     @@@ContentType: DISCore|Boolean
7612 wakaba 1.3 @@Type:
7613 wakaba 1.18 DOMMain:boolean::ManakaiDOM:all
7614 wakaba 1.3
7615     ElementTypeBinding:
7616     @Name: enDesc
7617     @ElementType:
7618     dis:Description
7619     @ShadowContent:
7620     @@lang:en
7621    
7622     ElementTypeBinding:
7623     @Name: PropDef
7624     @ElementType:
7625     dis:ResourceDef
7626     @ShadowContent:
7627     @@rdf:type:
7628     rdf:Property
7629 wakaba 1.49 @@For:
7630 wakaba 1.54 =ManakaiDOM|all
7631 wakaba 1.3
7632     ElementTypeBinding:
7633     @Name: MethodRedef
7634     @ElementType:
7635     dis:ResourceDef
7636     @ShadowContent:
7637     @@rdf:type:
7638     DISLang:Method
7639    
7640     ElementTypeBinding:
7641     @Name: NamedParam
7642     @ElementType:
7643     dis:ResourceDef
7644     @ShadowContent:
7645     @@rdf:type:
7646     DISLang:MethodParameter
7647     @@DISPerl:isNamedParameter:1
7648    
7649     ElementTypeBinding:
7650     @Name: NodeParam
7651     @ElementType:
7652     dis:ResourceDef
7653     @ShadowContent:
7654     @@rdf:type:
7655     DISLang:MethodParameter
7656     @@DISPerl:isNamedParameter:1
7657     @@Name: node
7658 wakaba 1.47 @@Type: DISNode
7659     @@actualType:
7660     @@@@: ManakaiDISNode
7661     @@@ForCheck: ManakaiDOM|ForClass
7662 wakaba 1.3 @@Description:
7663     @@@lang:en
7664     @@@@:
7665     The node in which the name has occurred. It is intended
7666     to be reported when an exception had been raised.
7667     @@ResourceDef:
7668     @@@rdf:type:
7669     ManakaiDOM:InCase
7670     @@@Value:
7671     @@@@is-null:1
7672 wakaba 1.49 @@@@ContentType: DISCore|String
7673 wakaba 1.3 @@@Description:
7674     @@@@lang:en
7675     @@@@@:
7676     The source of the name is not a node.
7677    
7678     ElementTypeBinding:
7679     @Name: ForParam
7680     @ElementType:
7681     dis:ResourceDef
7682     @ShadowContent:
7683     @@rdf:type:
7684     DISLang:MethodParameter
7685     @@DISPerl:isNamedParameter:1
7686     @@Name: forArg
7687     @@Type: ForURI
7688     @@Description:
7689     @@@lang:en
7690     @@@@:
7691     The <QUOTE::for> URI reference.
7692     @@ResourceDef:
7693     @@@rdf:type:
7694     ManakaiDOM:InCase
7695     @@@Value:
7696     @@@@is-null:1
7697 wakaba 1.49 @@@@ContentType: DISCore|String
7698 wakaba 1.3 @@@Description:
7699     @@@@lang:en
7700     @@@@@:
7701     Equivalent to <Q::ManakaiDOM:all>, i.e. <QUOTE::for all>.
7702    
7703     ElementTypeBinding:
7704     @Name: ForpParam
7705     @ElementType:
7706     dis:ResourceDef
7707     @ShadowContent:
7708     @@rdf:type:
7709     DISLang:MethodParameter
7710     @@DISPerl:isNamedParameter:1
7711     @@Name: forpArg
7712     @@Type: ForURIList
7713     @@Description:
7714     @@@lang:en
7715     @@@@:
7716     An array reference containing additional <QUOTE::for>
7717     constraints (<QUOTE::For+> list).
7718     @@ResourceDef:
7719     @@@rdf:type:
7720     ManakaiDOM:InCase
7721     @@@Value:
7722     @@@@is-null:1
7723 wakaba 1.49 @@@@ContentType: DISCore|String
7724 wakaba 1.3 @@@Description:
7725     @@@@lang:en
7726     @@@@@:
7727     Equivalent to the empty array reference.
7728    
7729     ElementTypeBinding:
7730     @Name: MediaTypeParam
7731     @ElementType:
7732     dis:ResourceDef
7733     @ShadowContent:
7734     @@rdf:type:
7735     DISLang:MethodParameter
7736     @@DISPerl:isNamedParameter:1
7737     @@Name: mediaType
7738     @@Type: MediaTypeURI
7739     @@Description:
7740     @@@lang:en
7741     @@@@:
7742     The URI reference identifying a media type.
7743     @@ResourceDef:
7744     @@@rdf:type:
7745     ManakaiDOM:InCase
7746     @@@Value:
7747     @@@@is-null:1
7748 wakaba 1.49 @@@@ContentType: DISCore|String
7749 wakaba 1.3 @@@Description:
7750     @@@@lang:en
7751     @@@@@:
7752     No media type specified.
7753    
7754     ElementTypeBinding:
7755     @Name: MediaTypeDefaultParam
7756     @ElementType:
7757     dis:ResourceDef
7758     @ShadowContent:
7759     @@rdf:type:
7760     DISLang:MethodParameter
7761     @@DISPerl:isNamedParameter:1
7762     @@Name: defaultMediaType
7763     @@Type: MediaTypeURI
7764     @@Description:
7765     @@@lang:en
7766     @@@@:
7767     The default media type, i.e. the type used when no explicit
7768     specification is not found in the source tree.
7769     @@ResourceDef:
7770     @@@rdf:type:
7771     ManakaiDOM:InCase
7772     @@@Value:
7773     @@@@is-null:1
7774 wakaba 1.49 @@@@ContentType: DISCore|String
7775 wakaba 1.3 @@@Description:
7776     @@@@lang:en
7777     @@@@@:
7778     Defaulted to <Q::DOMMain:any>.
7779    
7780     ElementTypeBinding:
7781     @Name: RaiseException
7782     @ElementType:
7783     ManakaiDOM:raises
7784    
7785     ElementTypeBinding:
7786     @Name: UndeclaredPrefixException
7787     @ElementType:
7788     ManakaiDOM:raises
7789     @ShadowContent:
7790     @@@: UNDECLARED_NS_PREFIX_ERR
7791     @@Description:
7792     @@@lang:en
7793     @@@@:
7794     The implementation has encounted an undeclared namespace prefix.
7795    
7796     ElementTypeBinding:
7797     @Name: NoDBException
7798     @ElementType:
7799     ManakaiDOM:raises
7800     @ShadowContent:
7801 wakaba 1.47 @@@: NO_ASSOCIATED_DB_ERR
7802 wakaba 1.3 @@Description:
7803     @@@lang:en
7804     @@@@:
7805     No <QUOTE::dis> database is associated to this document.
7806    
7807     ElementTypeBinding:
7808     @Name: XConstDef
7809     @ElementType:
7810     dis:ResourceDef
7811     @ShadowContent:
7812     @@rdf:type:
7813     ManakaiDOM:Const
7814    
7815     ElementTypeBinding:
7816     @Name: XSubTypeDef
7817     @ElementType:
7818     dis:ResourceDef
7819     @ShadowContent:
7820     @@rdf:type:
7821     ManakaiDOM:ExceptionOrWarningSubType
7822 wakaba 1.47 @@ForCheck: ManakaiDOM|ForClass
7823 wakaba 1.3
7824     ElementTypeBinding:
7825     @Name: XParam
7826     @ElementType:
7827     ManakaiDOM:exceptionOrWarningParameter
7828    
7829     ElementTypeBinding:
7830     @Name: XParamDef
7831     @ElementType:
7832     dis:ResourceDef
7833     @ShadowContent:
7834     @@rdf:type:
7835     DOMMain:XWParameter
7836 wakaba 1.12 @@For:
7837     =ManakaiDOM:all
7838 wakaba 1.54
7839     XParamDef:
7840     @QName: DIS|moduleURI
7841     @enDesc:
7842     A URI of the module in which the resource is defined.
7843 wakaba 1.3
7844     ElementTypeBinding:
7845     @Name: enMufDef
7846     @ElementType:
7847     dis:Def
7848     @ShadowContent:
7849     @@ContentType:
7850     lang:muf
7851     @@lang:en
7852 wakaba 1.21
7853 wakaba 1.3

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24