/[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.52 - (hide annotations) (download)
Fri Sep 23 18:24:59 2005 UTC (19 years, 10 months ago) by wakaba
Branch: MAIN
Changes since 1.51: +160 -132 lines
++ manakai/doc/ChangeLog	23 Sep 2005 17:22:30 -0000
2005-09-23  Wakaba  <wakaba@suika.fam.cx>

	* Makefile: Command-line arguments for new modules added.
	(DAC_PREFIX): Changed to ".dad".

++ manakai/bin/ChangeLog	23 Sep 2005 17:21:35 -0000
2005-09-24  Wakaba  <wakaba@suika.fam.cx>

	* dac.pl, dac2pm.pl, mkdisdump.pl: "--debug" option added.

2005-09-23  Wakaba  <wakaba@suika.fam.cx>

	* mkdisdump.pl: Fixed to support new dad database implementation.

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

	* DIS.dis (DISParser.new): New method.
	(hasFeature): Removed.  ManakaiDISAnyResource now
	extends DOMFeature:ManakaiHasFeatureByGetFeature.
	(readProperties): Support for property value data
	types DISLang:MemberRef and dx:XCRef added.
	(ManakaiDISExceptionTarget): It is now an alias
	for dx:ManakaiDefaultExceptionHandler.

++ manakai/lib/Message/Util/Error/ChangeLog	23 Sep 2005 17:41:25 -0000
2005-09-23  Wakaba  <wakaba@suika.fam.cx>

	* DOMException.dis (dx:raises): Properties dis:dataType
	and dis:multipleProperties added.

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

	* DISDoc.dis: Modified to support new "dad" implementation.
	(DISElementDISDoc): Removed.
	(DVValueDISDoc): New.
	(documentionGroupId): This attribute values now
	do not include element type names.

	* DNLite.dis (convertDISDocumentToDNLDocument): Fixed
	not to "tie" happens to cause strange segmentation fault.

	* Perl.dis (plCodeFragment): Support for the
	role "dv:ValurRole" added.  Property name "dis:AppName"
	is changed to more specific property names.  Throws
	an exception if an input processor has no Perl code
	definition.  A parameter value to "getPropertyValue"
	was missing.

	* Value.dis (dv:ValueRole): New role.
	(DVValue.getFeature): New method.
	(DVValue): Now extends DOMFeature:ManakaiHasFeatureByGetFeature
	so that it implements DOMFeature:GetFeature.

++ manakai/lib/Message/DOM/ChangeLog	23 Sep 2005 17:24:34 -0000
2005-09-23  Wakaba  <wakaba@suika.fam.cx>

	* GenericLS.dis, SimpleLS.dis: New modules separated
	from DOMLS.dis.

	* DOMFeature.dis, DOMMain.dis: "MDOM:" and "for" definitions
	moved from DOMMain to DOMFeature.  Now DOMFeature
	has no dependency on DOMMain.

	* DOMFeature.dis (DEBUG): New variable.

++ manakai/lib/manakai/ChangeLog	23 Sep 2005 17:44:24 -0000
2005-09-23  Wakaba  <wakaba@suika.fam.cx>

	* DISCore.dis (dis:Label, dis:FullName): Their "dis:multipleProperties"
	property is fixed to "DISCore:UnorderedList" to allow
	language variants.
	(dis:Author): Marked as obsolete.
	(DISCore:author): New property.
	(DISCore:Wakaba): New resource.

	* DISPerl.dis (DISPerl:name, DISPerl:constName,
	DISPerl:exportTagName, DISPerl:variableName, DISPerl:paramName):
	New properties.

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24