/[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.9 - (hide annotations) (download)
Fri Mar 4 12:18:52 2005 UTC (20 years, 4 months ago) by wakaba
Branch: MAIN
Changes since 1.8: +235 -117 lines
lib/Message/Markup/SuikaWikiConfig21.dis (nodePath): Use realQualifiedName instead of qualifiedName; lib/Message/Util/DIS.dis: plStore and plLoadDISDatabase added; lib/Message/Util/ManakaiNode.dis: Non-nodal value bug fixed for SuikaWikiConfig21 support

1 wakaba 1.1 Module:
2     @QName:
3     Util:DIS
4     @FullName:
5     @@lang: en
6     @@@:
7     <QUOTE::DIS> Object Model
8     @Namespace:
9     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
10    
11     @Description:
12     @@lang:en
13     @@@:
14     This module provides an object model for <QUITE::dis> document format.
15    
16     @Author:
17     @@FullName: Wakaba
18     @@Mail: w@suika.fam.cx
19     @License:
20     @@@:
21     license:Perl+MPL
22     @@Original:
23     @@@FullName:
24     manakai <CODE::lib/manakai/dis.pl>
25     @@@Year:2004
26     @@@Author:
27     @@@@FullName:Wakaba
28     @@@@Mail:w@suika.fam.cx
29     @Date:
30     @@@:
31 wakaba 1.9 $Date: 2005/03/03 11:19:07 $
32 wakaba 1.1 @@ContentType:
33     dis:Date.RCS
34    
35     @Require:
36     @@Module:
37     @@@Name: SuikaWikiConfig21
38 wakaba 1.5 @@@QName:
39     Markup:SuikaWikiConfig21
40 wakaba 1.1 @@@WithFor:
41 wakaba 1.3 swcfg21:ForLatest
42     @@Module:
43     @@@Name: DIS
44     @@@WithFor:
45     DIS:ForLatest
46    
47     @DefaultFor:
48     DIS:ForLatest
49 wakaba 1.1
50     Namespace:
51     @DIS:
52     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
53     @dis:
54     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
55     @dis2pm:
56     http://suika.fam.cx/~wakaba/archive/2004/11/8/dis2pm#
57 wakaba 1.5 @DISlib:
58     http://suika.fam.cx/~wakaba/archive/2004/dis/
59 wakaba 1.3 @DOMCore:
60     http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
61     @DOMLS:
62     http://suika.fam.cx/~wakaba/archive/2004/dom/ls#
63     @DOMMain:
64     http://suika.fam.cx/~wakaba/archive/2004/dom/main#
65     @infoset:
66     http://www.w3.org/2001/04/infoset#
67 wakaba 1.1 @lang:
68     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
69     @license:
70     http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
71     @ManakaiDOM:
72     http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
73 wakaba 1.5 @Markup:
74     http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup#
75 wakaba 1.3 @MDOMX:
76     http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
77 wakaba 1.1 @owl:
78     http://www.w3.org/2002/07/owl#
79     @Perl:
80     http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#Perl--
81     @rdf:
82     http://www.w3.org/1999/02/22-rdf-syntax-ns#
83     @rdfs:
84     http://www.w3.org/2000/01/rdf-schema#
85 wakaba 1.3 @swcfg21:
86     http://suika.fam.cx/~wakaba/archive/2005/swcfg21#
87 wakaba 1.1 @TreeCore:\
88     @Util:
89     http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/
90    
91     ## -- "For" definitions
92    
93     ForDef:
94     @QName:
95     DIS:ForLatest
96     @Description:
97     @@lang:en
98     @@@:
99     For latest version of the <Module::Util:DIS> module implementation
100     @ISA:
101     ManakaiDOM:Perl
102    
103     ## -- Features
104    
105     ElementTypeBinding:
106     @Name: FeatureDef
107     @ElementType:
108     dis:ResourceDef
109     @ShadowContent:
110     @@rdf:type:
111     DOMMain:DOMFeature
112     @@AliasFor:
113     @@@@:
114     ::ManakaiDOM:all
115     @@@For:
116     !=ManakaiDOM:all
117    
118     ElementTypeBinding:
119     @Name: FeatureVerDef
120     @ElementType:
121     dis:ResourceDef
122     @ShadowContent:
123     @@rdf:type:
124     DOMMain:DOMFeature
125    
126     ElementTypeBinding:
127     @Name: featureQName
128     @ElementType:
129     dis:AppName
130     @ShadowContent:
131     @@ContentType:
132     dis:TypeQName
133    
134     FeatureDef:
135     @QName: Core
136     @FeatureVerDef:
137     @@QName: CoreFeature10
138     @@Version: 1.0
139     @@ISA: Core
140     @@FullName:
141     @@@lang:en
142     @@@@:
143     The <QUOTE::dis> object model, version 1.0
144     @@Description:
145     @@@lang:en
146     @@@@:
147     The <QUOTE::dis> object model, version 1.0.
148     @@DOMMain:requireFeature:
149     swcfg21:CoreFeature21
150    
151     ## -- SuikaWikiConfig/2.1 extended classes
152    
153     ClsDef:
154     @ClsQName: ManakaiDISImplementation
155     @ClsISA:
156 wakaba 1.3 swcfg21:ManakaiSWCFGImplementation::swcfg21:ForLatest
157 wakaba 1.1 @Description:
158     @@lang:en
159     @@@:
160     A <QUOTE::dis> implementation object.
161    
162     @Method:
163     @@Name: createDISDocument
164     @@Description:
165     @@@lang:en
166     @@@@:
167     Creates an empty <Class::ManakaiDISDocument> object.
168     @@Return:
169     @@@Type:ManakaiDISDocument
170     @@@Description:
171     @@@@lang:en
172     @@@@@:
173     The newly created <QUOTE::dis> document object.
174     @@@PerlDef:
175 wakaba 1.3 $r = $self-><M::swcfg21:SWCFGImplementation::swcfg21:ForLatest
176     .createSWCFGDocument>;
177     $r-><AS::swcfg21:SWCFGDocument::swcfg21:ForLatest
178     .defaultElementTypeNamespaceURI>
179 wakaba 1.1 (<Q::dis:>);
180    
181     @Method:
182 wakaba 1.2 @@Name: createDISParser
183     @@Description:
184     @@@lang:en
185     @@@@:
186 wakaba 1.1 Creates a <Class::ManakaiDISParser> object.
187 wakaba 1.2 @@Return:
188     @@@Type: ManakaiDISParser
189     @@@Description:
190     @@@@lang:en
191     @@@@@:
192 wakaba 1.1 A newly created <QUOTE::dis> parser.
193 wakaba 1.2 @@@PerlDef:
194 wakaba 1.3 $r = bless $self-><M::swcfg21:SWCFGImplementation::swcfg21:ForLatest
195     .createSWCFGParser>,
196 wakaba 1.1 <ClassName::ManakaiDISParser>;
197    
198     @Method:
199 wakaba 1.2 @@Name: createDISDatabase
200 wakaba 1.1 @@Description:
201     @@@lang:en
202     @@@@:
203 wakaba 1.2 Creates a new <QUOTE::dis> database.
204 wakaba 1.1 @@Return:
205 wakaba 1.2 @@@Type:ManakaiDISDatabase
206 wakaba 1.4 @@@Description:
207     @@@@lang:en
208     @@@@@:
209 wakaba 1.2 A newly created <QUOTE::dis> parser.
210 wakaba 1.4 @@@PerlDef:
211 wakaba 1.2 $r = bless {
212     forDef => {
213 wakaba 1.5 <Q::ManakaiDOM:all> => bless ({
214 wakaba 1.2 uri => <Q::ManakaiDOM:all>,
215     isa => {<Q::ManakaiDOM:all> => 1},
216     revISA => {},
217 wakaba 1.5 }, <ClassName::ManakaiDISForDefinition>),
218 wakaba 1.2 },
219     resDef => {},
220 wakaba 1.9 modDef => {},
221     seq => 0,
222 wakaba 1.3 }, <ClassName::ManakaiDISDatabase>;
223    
224     @Method:
225     @@Name: tfurisToURI
226     @@Description:
227     @@@lang:en
228     @@@@:
229     Converts a pair of name URI reference and <QUOTE::for> URI reference
230     into a <TYPE::dis:TFQNames>-expanded URI reference.
231     @@Param:
232     @@@Name: typeURI
233     @@@Type: NameURI
234     @@@Description:
235     @@@@lang:en
236     @@@@@:
237     A URI reference to identify a resource.
238     @@@InCase:
239     @@@@Value:
240     @@@@@is-null:1
241     @@@@Description:
242     @@@@@lang:en
243     @@@@@@:
244     Equivalent to <Q::DOMMain:any> (for historical reason).
245     @@Param:
246     @@@Name: forURI
247     @@@Type: ForURI
248     @@@Description:
249     @@@@lang:en
250     @@@@@:
251     A <QUOTE::for> URI reference.
252     @@@InCase:
253     @@@@Value:
254     @@@@@is-null:1
255     @@@@Description:
256     @@@@@lang:en
257     @@@@@@:
258     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
259     @@Return:
260     @@@Type:
261     DISCore:TFURI::ManakaiDOM:all
262     @@@Description:
263     @@@@lang:en
264     @@@@@:
265     The <TYPE::dis:TFQNames>-expanded URI references.
266     @@@PerlDef:
267     $typeURI = <Q::DOMMain:any> unless defined $typeURI;
268     $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
269 wakaba 1.4 __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__;
270    
271     @ResourceDef:
272     @@QName: tfurisToURI
273     @@rdf:type:
274     dis2pm:BlockCode
275     @@enDesc:
276     Converts a pair of name URI reference and <QUOTE::for> URI reference
277     into a <TYPE::dis:TFQNames>-expanded URI reference.
278     @@PerlDef:
279     if ($furi eq <Q::ManakaiDOM:all>) {
280     $uri = $turi;
281 wakaba 1.3 } else {
282     ## NOTE: [RFC 3986]
283     ## fragment := *(pchar / "/" / "?")
284     ## pchar := unreserved / pct-encoded / sub-delims / [:@]
285     ## unreserved := ALPHA / DIGIT / [._~-]
286     ## sub-delims := [!$&'()*+,;=]
287     ## NOTE: [XPointer Framework]
288     ## SchemeData := *EscapedData
289     ## EscapedData := NormalChar / "^(" / "^)" / "^^"
290     ## / "(" SchemeData ")"
291     ## NormalChar := UnicodeChar - [()^]
292 wakaba 1.5 my $__turi = $turi;
293     my $__furi = $furi;
294     for my $__uri ($__turi, $__furi) {
295 wakaba 1.4 $__uri =~ s{([^0-9A-Za-z:;?=_./-])}{sprintf '%%%02X', ord $1}ge;
296 wakaba 1.3 }
297 wakaba 1.4 $uri = qq<data:,200411tf#xmlns(t=data:,200411tf%23)>.
298 wakaba 1.5 qq<t:tf($__turi,$__furi)>;
299 wakaba 1.3 }
300 wakaba 1.2
301 wakaba 1.5 @ResourceDef:
302 wakaba 1.6 @@QName: tfpurisToURI
303     @@rdf:type:
304     dis2pm:BlockCode
305     @@enDesc:
306     Converts a set of name URI reference and <QUOTE::for> URI reference
307     and <QUOTE::for+> URI references into a URi reference.
308     @@PerlDef:
309     if ($furi eq <Q::ManakaiDOM:all> and @{$forp} == 0) {
310     $uri = $turi;
311     } elsif (@{$forp}) {
312     my $__turi = $turi;
313     my $__furi = $furi;
314     for my $__uri ($__turi, $__furi) {
315     $__uri =~ s{([^0-9A-Za-z:;?=_./~!&+-])}{sprintf '%%%02X', ord $1}ge;
316     }
317     my @__fp;
318     for my $__uri (@{$forp}) {
319     my $__fpuri = $__uri;
320     $__fpuri =~ s{([^0-9A-Za-z:;?=_./~!&+-])}
321     {sprintf '%%%02X', ord $1}ge;
322     push @__fp, $__fpuri;
323     }
324     $uri = qq<data:,200411tf#xmlns(t=data:,200411tf%23)>.
325     qq<t:tfp($__turi,$__furi,>.join (',', @__fp).q<)>;
326     } else {
327     my $__turi = $turi;
328     my $__furi = $furi;
329     for my $__uri ($__turi, $__furi) {
330     $__uri =~ s{([^0-9A-Za-z:;?=_./-])}{sprintf '%%%02X', ord $1}ge;
331     }
332     $uri = qq<data:,200411tf#xmlns(t=data:,200411tf%23)>.
333     qq<t:tf($__turi,$__furi)>;
334     }
335    
336     @ResourceDef:
337 wakaba 1.5 @@QName: getChildResourceURI
338     @@rdf:type:
339     dis2pm:BlockCode
340     @@enDesc:
341     Gets an anonymous URI reference of a child resource of another
342     resource.
343     @@PerlDef:
344     my $__parent = $parentURI;
345     my $__ln = $localName;
346     for my $__uri ($__parent, $__ln) {
347 wakaba 1.6 $__uri =~ s{([^0-9A-Za-z:;?=_./~!&+-])}{sprintf '%%%02X', ord $1}ge;
348 wakaba 1.5 }
349     $result = q<data:,200411tf#xmlns(t=data:,200411tf%23)>.
350     qq<t:child($__parent,$__ln)>;
351    
352 wakaba 1.8 @IntMethod:
353     @@Name: camelCaseToUnderscoreName
354     @@enDesc:
355     Converts a camelCase name to a underscored_name.
356     @@ManakaiDOM:isStatic:1
357     @@Param:
358     @@@Name: camelName
359     @@@Type:
360     DISLang:String
361     @@@enDesc:
362     The source name.
363     @@Return:
364     @@@Type:
365     DISLang:String
366     @@@enDesc:
367     The result name.
368     @@@PerlDef:
369     $r = $camelName;
370     $r =~ s/^([A-Z0-9]+)$/lc $1/ge;
371     $r =~ s/([A-Z][A-Z0-9]*)$/"_".lc $1/ge;
372     $r =~ s/([A-Z0-9])([A-Z0-9]*)([A-Z0-9])/$1.lc ($2)."_".lc $3/ge;
373     $r =~ s/([A-Z])/"_".lc $1/ge;
374     $r =~ s/(?=[0-9](?!$))/_/g;
375 wakaba 1.9
376     @Method:
377     @@Name: plLoadDISDatabase
378     @@enDesc:
379     Loads a database from a file that was saved by
380     <M::ManakaiDISDatabase.plStore>.
381     \
382     {NOTE:: <QUOTE::dis> documents restored from external file
383     would have different <A::ManakaiDISDocument.implementation>
384     than this <Class::ManakaiDISImplementation>, even if
385     it has been created by this implementation
386     and stored in the same session.
387     \
388     }
389     @@Param:
390     @@@Name:fileName
391     @@@Type:
392     DISLang:String
393     @@@enDesc:
394     An environment-dependent file name.
395     @@Return:
396     @@@Type: ManakaiDISDatabase
397     @@@SimpleException:
398     @@@PerlDef:
399     use Storable qw/retrieve/;
400     local $Carp::CarpLevel = $Carp::CarpLevel + 1;
401     $r = retrieve $fileName;
402    
403     ## Restores weak references
404     require Scalar::Util;
405     for my $doc (values %{$r->{<Q::DIS:sourceFile>}}) {
406     Scalar::Util::weaken ($doc->{<Q::TreeCore:node>}->{<Q::DIS:db>});
407     }
408     for my $def (values %{$r->{modDef}},
409     values %{$r->{forDef}},
410     values %{$r->{resDef}}) {
411     Scalar::Util::weaken ($def->{db});
412     }
413 wakaba 1.1 ##DISImplementation
414    
415 wakaba 1.9 ElementTypeBinding:
416     @Name: SimpleException
417     @ElementType:
418     dis:Description
419     @ShadowContent:
420     @@lang:en
421     @@@:
422     - Exception of type <PerlModule::Error::Simple>:::
423     I/O error or other error reported by <PerlModule::Storable>.
424    
425     ## TODO: Formal description required for simple exception
426    
427 wakaba 1.1 ClsDef:
428     @ClsQName: ManakaiDISParser
429     @ClsISA:
430 wakaba 1.3 swcfg21:ManakaiSWCFGParser::swcfg21:ForLatest
431 wakaba 1.1 @Description:
432     @@lang:en
433     @@@:
434     A SuikaWikiConfig/2.1 parser that returns <QUOTE::dis> object.
435     @Method:
436 wakaba 1.3 @@Name: parse
437     @@Description:
438     @@@lang:en
439     @@@@:
440 wakaba 1.1 Parses a <QUOTE::dis> document and returns it as an object tree.
441 wakaba 1.3 @@Param:
442     @@@Name: input
443     @@@Type:
444     DOMLS:LSInput::ManakaiDOM:ManakaiDOM3
445     @@@Description:
446     @@@@lang:en
447     @@@@@:
448 wakaba 1.1 The input source.
449 wakaba 1.3 @@Return:
450     @@@Type: ManakaiDISDocument
451     @@@Description:
452     @@@@lang:en
453     @@@@@:
454 wakaba 1.1 The <QUOTE::dis> document object created from the <P::input>.
455     @@@RaiseException:
456     @@@@@:
457     swcfg21:SWCFG_PARSE_ERR
458     @@@@Description:
459     @@@@@lang:en
460     @@@@@@:
461     The <IF::swcfg21:SWCFGParser> was unable to load the SuikaWikiConfig
462     document.
463     @@@PerlDef:
464     __DEEP{
465 wakaba 1.3 $r = $self-><M::swcfg21:ManakaiSWCFGParser
466     ::swcfg21:ForLatest.parse> ($input);
467 wakaba 1.1 }__;
468     if (defined $r) {
469     $r = bless $r, <ClassName::ManakaiDISDocument>;
470 wakaba 1.4 $r-><AS::swcfg21:SWCFGDocument::swcfg21:ForLatest
471     .defaultElementTypeNamespaceURI>
472     (<Q::dis:>);
473 wakaba 1.1 }
474     ##DISParser
475    
476     ClsDef:
477     @ClsQName: ManakaiDISNode
478     @Description:
479     @@lang:en
480     @@@:
481     <QUOTE::dis> node objects.
482 wakaba 1.7 @ImplNote:
483     @@lang:en
484     @@@:
485     This class does not inherit
486     <Class::swcfg21:ManakaiSWCFGNode::swcfg21:ForLatest>, since
487     inheriting classes such as <Class::ManakaiDISElement> indirectly
488     inherit it.
489 wakaba 1.1
490     @MethodRedef:
491     @@Name:lookupNamespacePrefix
492     @@Description:
493     @@@lang:en
494     @@@@:
495     Looks up the namespace prefix associated to the given
496     namespace URI. The default namespaces are ignored.
497     @@Param:
498     @@@Name:namespaceURI
499 wakaba 1.3 @@@Type: AnyURI
500 wakaba 1.1 @@@Description:
501     @@@@lang:en
502     @@@@@:
503     The namespace URI to look for.
504     @@@InCase:
505     @@@@Value:
506     @@@@@is-null:1
507     @@@@Description:
508     @@@@@lang:en
509     @@@@@@:
510     The <DOM::null> namespace.
511     @@NamedParam:
512     @@@Name: makeNewBinding
513     @@@Type:
514     DOMMain:boolean
515     @@@Description:
516     @@@@lang:en
517     @@@@@:
518     Whether a new namespace prefix should be bound when
519     no namespace URI has been associated yet.
520     @@@InCase:
521     @@@@Value:true
522     @@@@Description:
523     @@@@@lang:en
524     @@@@@@:
525     New binding is made if no prefix associated.
526     @@@InCase:
527     @@@@Value:false
528     @@@@Description:
529     @@@@@lang:en
530     @@@@@@:
531     Simply returns the <DOM::null> if no prefix associated.
532     @@Return:
533     @@@Type:
534 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
535 wakaba 1.1 @@@Description:
536     @@@@lang:en
537     @@@@@:
538     An associated namespace prefix. If more than one prefix
539     are associated to the namespace URI, the returned prefix
540     is implementation dependent.
541     @@@InCase:
542     @@@@Value:
543     @@@@@is-null:1
544     @@@@Description:
545     @@@@@lang:en
546     @@@@@@:
547     No associated namespace prefix found.
548     @@@PerlDef:
549     $r = null;
550 wakaba 1.3 my $od = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
551     .ownerDocument> || $self;
552 wakaba 1.7 my $binds = $od->{<Q::TreeCore:node>}->{<Q::swcfg21:nsBinding>};
553 wakaba 1.1 if (defined $namespaceURI) {
554     FIND: {
555     for my $prefix (keys %$binds) {
556     if (defined $binds->{$prefix} and
557     $binds->{$prefix} eq $namespaceURI) {
558     $r = $prefix;
559     last FIND;
560     }
561     }
562 wakaba 1.7
563     ## From module list
564     try {
565     my $db = $self-><AG::ManakaiDISNode.ownerDISDocument>
566     -><AG::ManakaiDISDocument.disDatabase>;
567     for my $mod_uri (keys %{$db->{modDef}}) {
568     my $mod = $db-><M::ManakaiDISDatabase.getModule> ($mod_uri);
569     my $mod_ln = $mod-><AG::ManakaiDISModuleDefinition.localName>;
570     next if exists $binds->{$mod_ln};
571     my $ns_uri = $mod-><M::ManakaiDISPropertyAccessor
572     .getPropertyText>
573     (<Q::dis:Namespace>, '');
574     if ($ns_uri eq $namespaceURI) {
575     $r = $mod_ln;
576     last FIND;
577     }
578     }
579     } catch <Class::ManakaiDISException> with {
580     my $err = shift;
581     $err->throw
582     unless $err->{<Q::MDOMX:subtype>} eq <Q::NO_DB_ASSOCIATED_ERR>;
583     };
584    
585 wakaba 1.1 last FIND unless $makeNewBinding;
586     ## Not found
587     if ($namespaceURI =~ /(\w+)$/) {
588     my $prefix = $1;
589     unless (exists $binds->{$prefix}) {
590     $binds->{$prefix} = $namespaceURI;
591     $r = $prefix;
592     last FIND;
593     }
594     }
595     my $i = 1;
596     {
597     unless (exists $binds->{'ns'.$i}) {
598     $binds->{$r = 'ns'.$i} = $namespaceURI;
599     last FIND;
600     }
601     $i++;
602     redo;
603     }
604     } # FIND
605     } else { ## Null namespace
606     FIND: {
607     if (exists $binds->{'nu'.'ll'} and not defined $binds->{'nu'.'ll'}) {
608     $r = 'nu'.'ll';
609     last FIND;
610     }
611     for my $prefix (keys %$binds) {
612     if (not defined $prefix) {
613     $r = $prefix;
614     last FIND;
615     }
616     }
617     last FIND unless $makeNewBinding;
618     ## Not found
619     my $i = '';
620     {
621     unless (exists $binds->{'nu'.'ll'.$i}) {
622     $binds->{$r = 'nu'.'ll'.$i} = null;
623     last FIND;
624     }
625     $i++;
626     redo;
627     }
628     }
629     }
630    
631     @MethodRedef:
632     @@Name:lookupNamespaceURI
633     @@Description:
634     @@@lang:en
635     @@@@:
636     Looks up the namespace URI associated to the given prefix.
637     @@Param:
638     @@@Name:prefix
639     @@@Type:
640 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
641 wakaba 1.1 @@@Description:
642     @@@@lang:en
643     @@@@@:
644     The namespace URI to look for.
645     @@NamedParam:
646     @@@Name: makeNewBinding
647     @@@Type:
648     DOMMain:boolean
649     @@@Description:
650     @@@@lang:en
651     @@@@@:
652     Whether a new binding should be created if no namespace URI
653     is associated with the <P::prefix> or not.
654     @@@InCase:
655     @@@@Value:true
656     @@@@Description:
657     @@@@@lang:en
658     @@@@@@:
659     A new binding to the temporary namespace URI
660     exactly same as <P::prefix> is created
661     if no binding found.
662     @@@InCase:
663     @@@@Value:false
664     @@@@Description:
665     @@@@@lang:en
666     @@@@@@:
667     No new binding is created if no binding found. Note that
668     even if no association newly created, this method
669     returns the <DOM::null> value.
670     @@Return:
671 wakaba 1.3 @@@Type: AnyURI
672 wakaba 1.1 @@@Description:
673     @@@@lang:en
674     @@@@@:The associated namespace URI.
675     @@@InCase:
676     @@@@Value:
677     @@@@@is-null:1
678     @@@@Description:
679     @@@@@lang:en
680     @@@@@@:
681 wakaba 1.3 No namespace URI is associated to the prefix or
682 wakaba 1.1 the <DOM::null> namespace is associated.
683     @@@PerlDef:
684 wakaba 1.3 my $od = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
685     .ownerDocument> || $self;
686 wakaba 1.7 my $binds = $od->{<Q::TreeCore:node>}->{<Q::swcfg21:nsBinding>};
687 wakaba 1.1 if (exists $binds->{$prefix}) {
688     $r = $binds->{$prefix};
689     } else {
690 wakaba 1.7 ## From module list
691     FIND: {
692     try {
693     my $db = $self-><AG::ManakaiDISNode.ownerDISDocument>
694     -><AG::ManakaiDISDocument.disDatabase>;
695     for my $mod_uri (keys %{$db->{modDef}}) {
696     my $mod = $db-><M::ManakaiDISDatabase.getModule> ($mod_uri);
697     if ($mod-><AG::ManakaiDISModuleDefinition.localName>
698     eq $prefix) {
699     $r = $mod-><M::ManakaiDISPropertyAccessor
700     .getPropertyText>
701     (<Q::dis:Namespace>, null);
702     last FIND;
703     }
704     }
705     } catch <Class::ManakaiDISException> with {
706     my $err = shift;
707     $err->throw
708     unless $err->{<Q::MDOMX:subtype>} eq <Q::NO_DB_ASSOCIATED_ERR>;
709     };
710     if ($makeNewBinding) {
711     $r = $binds->{$prefix} = $prefix;
712     } else {
713     $r = null;
714     }
715     } # FIND
716 wakaba 1.1 }
717    
718     @IntMethod:
719     @@Name:getNodeReference
720     @@Description:
721     @@@lang:en
722     @@@@:
723     Returns a new reference to the node object.
724     @@ManakaiDOM:isStatic:1
725     @@Param:
726     @@@Name:object
727     @@@Type:
728     ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
729     @@@Description:
730     @@@@lang:en
731     @@@@@:
732     The node object to be referred.
733     @@Return:
734     @@@Type: ManakaiDISNode
735     @@@Description:
736     @@@@lang:en
737     @@@@@:
738     A newly created reference.
739     @@@PerlDef:
740     my $class;
741 wakaba 1.5 if ($object->{<Q::swcfg21:nodeType>} eq '#element') {
742 wakaba 1.1 $class = <ClassName::ManakaiDISElement>;
743 wakaba 1.5 } elsif ($object->{<Q::swcfg21:nodeType>} eq '#comment') {
744 wakaba 1.1 $class = <ClassName::ManakaiDISComment>;
745 wakaba 1.5 } elsif ($object->{<Q::swcfg21:nodeType>} eq '#document') {
746 wakaba 1.1 $class = <ClassName::ManakaiDISDocument>;
747 wakaba 1.5 } elsif ($object->{<Q::swcfg21:nodeType>} eq '#fragment') {
748 wakaba 1.1 $class = <ClassName::ManakaiDISDocumentFragment>;
749     } else {
750     __ASSERT{DISPerl:invariant::
751 wakaba 1.5 msg => {qq[Node type: "$object->{<Q::swcfg21:nodeType>}" ].
752 wakaba 1.1 qq[(ref: "@{[ref $object]}")]},
753     }__;
754     }
755     $r = $object-><M::ManakaiDOM:ManakaiDOMNodeObject::ManakaiDOM:Perl
756     .newReference> ($class);
757    
758 wakaba 1.2 @Attr:
759     @@Name:ownerDISDocument
760     @@Description:
761     @@@lang:en
762     @@@@:
763     The <QUOTE::dis> document object associated with this node.
764     @@Get:
765 wakaba 1.3 @@@Type:ManakaiDISDocument
766 wakaba 1.2 @@@Description:
767     @@@@lang:en
768     @@@@@:
769     The document object associated with this node.
770     @@@InCase:
771     @@@@Value:
772     @@@@@is-null:1
773     @@@@Description:
774     @@@@@lang:en
775     @@@@@@:
776     This node is a document node.
777     @@@PerlDef:
778     $r = <ClassM::ManakaiDISNode.getNodeReference>
779     ($self->{<Q::TreeCore:node>}->{<Q::DOMCore:ownerDocument>})
780     if $self->{<Q::TreeCore:node>}->{<Q::DOMCore:ownerDocument>};
781 wakaba 1.1 ##DISNode
782    
783     ClsDef:
784     @ClsQName: ManakaiDISElement
785 wakaba 1.7 @ClsISA: ManakaiDISNode
786 wakaba 1.1 @ClsISA:
787 wakaba 1.3 swcfg21:ManakaiSWCFGElement::swcfg21:ForLatest
788 wakaba 1.1 @Description:
789     @@lang:en
790     @@@:
791     <QUOTE::dis> element node objects.
792    
793     @Method:
794     @@Name: forMatch
795     @@Description:
796     @@@lang:en
797     @@@@:
798     Tests whether this element is for a <QUOTE::for> or not.
799     @@Param:
800     @@@Name: forArg
801     @@@Type: ForURI
802     @@@Description:
803     @@@@lang:en
804     @@@@@:
805     The <QUOTE::For> URI reference to test against.
806     @@Param:
807     @@@Name: forpArg
808     @@@Type: ForURIList
809     @@@Description:
810     @@@@lang:en
811     @@@@@:
812     The <QUOTE::For+> URI references to test against.
813     @@@InCase:
814     @@@@Value:
815     @@@@@is-null:1
816     @@@@Description:
817     @@@@@lang:en
818     @@@@@@:
819     No additional <QUOTE::For> URI reference.
820 wakaba 1.3 Equivalent to an empty array reference.
821 wakaba 1.1 @@Return:
822     @@@Type:
823     DOMMain:boolean
824     @@@Description:
825     @@@@lang:en
826     @@@@@:
827     Whether this element is for <P::forArg> and <P::forpArg> or not.
828 wakaba 1.2 @@@UndeclaredPrefixException:
829     @@@NoDBException:
830     @@@PerlDef:
831 wakaba 1.3 $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
832     $forpArg ||= [];
833 wakaba 1.2
834     FORMATCH: {
835     __DEEP{
836 wakaba 1.4 my @ce = @{$self-><M::ManakaiDISElement.disChildElements>};
837 wakaba 1.2 for my $ce (@ce) {
838 wakaba 1.3 my $et = $ce-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
839     .expandedURI>;
840 wakaba 1.2 if ($et eq <Q::dis:ForCheck>) {
841 wakaba 1.9 my $fors = [split /\s+/, $ce-><AG::swcfg21:SWCFGNode
842     ::swcfg21:ForLatest.value>];
843     FCs: for my $f (@$fors) {
844 wakaba 1.2 if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
845     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
846 wakaba 1.9 my $for = $self-><AG::ManakaiDISNode.ownerDISDocument>
847     -><AG::ManakaiDISDocument.disDatabase>
848     -><M::ManakaiDISDatabase.getFor> ($uri);
849     $for-><AG::ManakaiDISForDefinition.isReferred> ($ce);
850 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
851 wakaba 1.2 if ($uri eq $arg_uri) {
852     $r = false;
853     last FORMATCH;
854     }
855     }
856     } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
857     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
858 wakaba 1.9 my $for = $self-><AG::ManakaiDISNode.ownerDISDocument>
859     -><AG::ManakaiDISDocument.disDatabase>
860     -><M::ManakaiDISDatabase.getFor> ($uri);
861     $for-><AG::ManakaiDISForDefinition.isReferred> ($ce);
862 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
863 wakaba 1.9 if ($for-><M::ManakaiDISForDefinition.isaURI> ($arg_uri)) {
864 wakaba 1.2 $r = false;
865     last FORMATCH;
866     }
867     }
868     } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
869     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
870 wakaba 1.9 my $for = $self-><AG::ManakaiDISNode.ownerDISDocument>
871     -><AG::ManakaiDISDocument.disDatabase>
872     -><M::ManakaiDISDatabase.getFor> ($uri);
873     $for-><AG::ManakaiDISForDefinition.isReferred> ($ce);
874 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
875 wakaba 1.2 if ($arg_uri eq $uri) {
876     next FCs;
877     }
878     }
879     $r = false;
880     last FORMATCH;
881     } else { ## -- ISA
882 wakaba 1.9 my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($f);
883     my $for = $self-><AG::ManakaiDISNode.ownerDISDocument>
884     -><AG::ManakaiDISDocument.disDatabase>
885     -><M::ManakaiDISDatabase.getFor> ($uri);
886     $for-><AG::ManakaiDISForDefinition.isReferred> ($ce);
887 wakaba 1.3 for my $arg_uri ($forArg, @{$forpArg}) {
888 wakaba 1.9 if ($for-><M::ManakaiDISForDefinition.isaURI> ($arg_uri)) {
889 wakaba 1.2 next FCs;
890     }
891     }
892     $r = false;
893     last FORMATCH;
894     }
895     } # FCs
896     } # dis:ForCheck
897     } # children
898    
899     my $has_for = false;
900     for my $ce (@ce) {
901 wakaba 1.3 if ($self-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
902     .expandedURI> eq
903 wakaba 1.2 <Q::dis:For>) {
904 wakaba 1.9 my $fors = [split /\s+/, $ce-><AG::swcfg21:SWCFGNode
905     ::swcfg21:ForLatest.value>];
906 wakaba 1.2 my $ok = true;
907     $has_for = true;
908 wakaba 1.9 AFOR: for my $f (@$fors) {
909 wakaba 1.2 if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
910     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
911 wakaba 1.9 my $for = $self-><AG::ManakaiDISNode.ownerDISDocument>
912     -><AG::ManakaiDISDocument.disDatabase>
913     -><M::ManakaiDISDatabase.getFor> ($uri);
914     $for-><AG::ManakaiDISForDefinition.isReferred> ($ce);
915 wakaba 1.3 if ($uri eq $forArg) {
916 wakaba 1.2 $ok = false;
917     last AFOR;
918     }
919     } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
920     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
921 wakaba 1.9 my $for = $self-><AG::ManakaiDISNode.ownerDISDocument>
922     -><AG::ManakaiDISDocument.disDatabase>
923     -><M::ManakaiDISDatabase.getFor> ($uri);
924     $for-><AG::ManakaiDISForDefinition.isReferred> ($ce);
925     if ($for-><M::ManakaiDISForDefinition.isaURI> ($forArg)) {
926 wakaba 1.2 $ok = false;
927     last AFOR;
928     }
929     } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
930     my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($1);
931 wakaba 1.9 my $for = $self-><AG::ManakaiDISNode.ownerDISDocument>
932     -><AG::ManakaiDISDocument.disDatabase>
933     -><M::ManakaiDISDatabase.getFor> ($uri);
934     $for-><AG::ManakaiDISForDefinition.isReferred> ($ce);
935 wakaba 1.3 unless ($uri eq $forArg) {
936 wakaba 1.2 $ok = false;
937     last AFOR;
938     }
939     } else { ## -- ISA
940 wakaba 1.9 my $uri = $self-><AG::ManakaiDISElement.qnameToURI> ($f);
941     my $for = $self-><AG::ManakaiDISNode.ownerDISDocument>
942     -><AG::ManakaiDISDocument.disDatabase>
943     -><M::ManakaiDISDatabase.getFor> ($uri);
944     $for-><AG::ManakaiDISForDefinition.isReferred> ($ce);
945     unless ($for-><M::ManakaiDISForDefinition.isaURI>($forArg)) {
946 wakaba 1.2 $ok = false;
947     last AFOR;
948     }
949     }
950     } # AFOR
951 wakaba 1.3 if ($ok) {
952     $r = true;
953     last FORMATCH;
954     }
955 wakaba 1.2 } # dis:For
956     } # $ce
957     $r = $has_for ? false : true;
958     }__;
959     } # FORMATCH
960 wakaba 1.1
961     @Method:
962     @@Name: mediaTypeMatch
963     @@Description:
964     @@@lang:en
965     @@@@:
966     Tests whether the content media type of this element matches to
967     a type or not.
968     @@Param:
969     @@@Name: mediaType
970     @@@Type: MediaTypeURI
971     @@@Description:
972     @@@@lang:en
973     @@@@@:
974     A media type URI reference to test against.
975     @@Param:
976 wakaba 1.3 @@@Name: defaultMediaType
977 wakaba 1.1 @@@Type: MediaTypeURI
978     @@@Description:
979     @@@@lang:en
980     @@@@@:
981     The default media type for this element.
982     @@@InCase:
983     @@@@Value:
984     @@@@@is-null:1
985     @@@@Description:
986     @@@@@lang:en
987     @@@@@@:
988     No default type provided. All <P::mediaType> will match.
989     @@Return:
990     @@@Type:
991     DOMMain:boolean
992     @@@Description:
993     @@@@lang:en
994     @@@@@:
995     Whether this element is of <P::mediaType> or not.
996 wakaba 1.2 @@@PerlDef:
997     if (defined $mediaType) {
998     __DEEP{
999     my $ctn = $self-><M::ManakaiDISElement.disGetAttribute>
1000     (<Q::dis:ContentType>);
1001     my $ct;
1002     $ct = $ctn-><AG::ManakaiDISElement.qnameValueURI> if $ctn;
1003     $ct = $defaultMediaType unless defined $ct;
1004     my $res = $self-><AG::ManakaiDISNode.ownerDISDocument>
1005     -><AG::ManakaiDISDocument.disDatabase>
1006     -><M::ManakaiDISDatabase.getResource> ($ct);
1007     $res-><AS::ManakaiDISResourceDefinition.isReferred> ($ctn or $self);
1008 wakaba 1.7 unless ($res-><M::ManakaiDISResourceDefinition
1009     .isSubsetOfURI> ($ct)) {
1010 wakaba 1.2 $r = false;
1011     } else {
1012     $r = true;
1013     }
1014     }__;
1015     } else {
1016     $r = true;
1017     }
1018 wakaba 1.1
1019     @Method:
1020     @@Name: prefixToURI
1021     @@Description:
1022     @@@lang:en
1023     @@@@:
1024     Converts a namespace prefix into associated URI reference.
1025     @@Param:
1026     @@@Name: prefix
1027     @@@Type:
1028 wakaba 1.3 DISCore:NamespacePrefix::ManakaiDOM:all
1029 wakaba 1.1 @@@Description:
1030     @@@@lang:en
1031     @@@@@:
1032     A namespace prefix to look for.
1033     @@@InCase:
1034     @@@@Value:
1035     @@@@@is-null:1
1036     @@@@Description:
1037     @@@@@lang:en
1038     @@@@@@:
1039     Returns the default namespace URI.
1040     @@NodeParam:
1041     @@Return:
1042 wakaba 1.3 @@@Type: AnyURI
1043 wakaba 1.1 @@@Description:
1044     @@@@lang:en
1045     @@@@@: The URI references associated.
1046     @@@UndeclaredPrefixException:
1047     @@@PerlDef:
1048 wakaba 1.3 if (defined $prefix) {
1049 wakaba 1.1 __DEEP{
1050 wakaba 1.3 $r = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
1051     .lookupNamespaceURI> ($prefix);
1052 wakaba 1.1 }__;
1053     unless (defined $r) {
1054     __EXCEPTION{UNDECLARED_NS_PREFIX_ERR::
1055     infoset:prefix => {$prefix},
1056     MDOMX:param-name => 'prefix',
1057     DIS:sourceNode => {$node},
1058     }__;
1059     }
1060 wakaba 1.7 } else { ## Default namespace
1061     __DEEP{
1062     $r = ($self-><AG::ManakaiDISNode.ownerDISDocument> || $self)
1063     -><AG::ManakaiDISDocument.moduleElement>
1064     -><AG::ManakaiDISModuleElement.definingNamespaceURI>;
1065     }__;
1066 wakaba 1.1 }
1067    
1068     @Method:
1069     @@QName: qnameToURI
1070     @@Description:
1071     @@@lang:en
1072     @@@@:
1073     Converts a qualified name (<TYPE::dis:TypeQName>) to
1074     an expanded URI reference.
1075     @@Param:
1076     @@@Name: qname
1077     @@@Type:
1078     dis:TypeQName
1079     @@@Description:
1080     @@@@lang:en
1081     @@@@@:
1082     A qualified name.
1083     @@NodeParam:
1084     @@Return:
1085     @@@Type: AnyURI
1086     @@@Description:
1087     @@@@lang:en
1088     @@@@@:
1089     The expanded URI reference.
1090     @@@UndeclaredPrefixException:
1091     @@@PerlDef:
1092     $qname =~ s/^\s+//; $qname =~ s/\s+$//;
1093 wakaba 1.9 my ($prefix, $lname) = split /:/, $qname, 2;
1094 wakaba 1.1 __DEEP{
1095     if (defined $lname) {
1096     $r = $self-><M::ManakaiDISElement.prefixToURI> ($prefix) . $lname;
1097     } else { ## In default namespace
1098     $r = $self-><M::ManakaiDISElement.prefixToURI> (null) . $prefix;
1099     }
1100 wakaba 1.4 }__;
1101 wakaba 1.1
1102     @Method:
1103     @@QName: qnameToPair
1104     @@Description:
1105     @@@lang:en
1106     @@@@:
1107     Converts a qualified name (<TYPE::dis:TypeQName>) to
1108     a pair of namespace URI and local name.
1109     @@Param:
1110     @@@Name: qname
1111     @@@Type:
1112     dis:TypeQName
1113     @@@Description:
1114     @@@@lang:en
1115     @@@@@:
1116     A qualified name.
1117     @@NodeParam:
1118     @@Return:
1119     @@@Type:
1120     Perl:ARRAY
1121     @@@Description:
1122     @@@@lang:en
1123     @@@@@:
1124     A list of namespace URI and local name.
1125     @@@UndeclaredPrefixException:
1126     @@@PerlDef:
1127     $qname =~ s/^\s+//; $qname =~ s/\s+$//;
1128 wakaba 1.9 my ($prefix, $lname) = split /:/, $qname, 2;
1129 wakaba 1.1 __DEEP{
1130     if (defined $lname) {
1131     $r = [$self-><M::ManakaiDISElement.prefixToURI> ($prefix), $lname];
1132     } else { ## In default namespace
1133     $r = [$self-><M::ManakaiDISElement.prefixToURI> (null), $prefix];
1134     }
1135 wakaba 1.4 }__;
1136 wakaba 1.1
1137     @Method:
1138 wakaba 1.3 @@Name: tfqnamesToURI
1139 wakaba 1.1 @@Description:
1140     @@@lang:en
1141     @@@@:
1142 wakaba 1.3 Converts a <TYPE::dis:TFQNames>
1143 wakaba 1.1 into an expanded URI reference.
1144     @@Param:
1145     @@@Name: tfqnames
1146     @@@Type:
1147 wakaba 1.3 dis:TFQNames
1148 wakaba 1.1 @@@Description:
1149     @@@@lang:en
1150     @@@@@:
1151 wakaba 1.3 A <TYPE::dis:TFQNames> to identify a resource.
1152 wakaba 1.1 @@Param:
1153     @@@Name: defaultTypeURI
1154     @@@Type: NameURI
1155     @@@Description:
1156     @@@@lang:en
1157     @@@@@:
1158     A name URI reference used if it is missing from
1159     <P::tfqnames>.
1160     @@@InCase:
1161     @@@@Value:
1162     @@@@@is-null:1
1163     @@@@Description:
1164     @@@@@lang:en
1165     @@@@@@:
1166     Equivalent to <Q::DOMMain:any>.
1167     @@Param:
1168     @@@Name: defaultForURI
1169     @@@Type: ForURI
1170     @@@Description:
1171     @@@@lang:en
1172     @@@@@:
1173     A <QUOTE::for> URI reference used if it is missing from
1174     <P::tfqnames>.
1175     @@@InCase:
1176     @@@@Value:
1177     @@@@@is-null:1
1178     @@@@Description:
1179     @@@@@lang:en
1180     @@@@@@:
1181     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
1182     @@NodeParam:
1183     @@Return:
1184     @@@Type:
1185 wakaba 1.3 DISCore:TFURI::ManakaiDOM:all
1186 wakaba 1.1 @@@Description:
1187     @@@@lang:en
1188     @@@@@:
1189 wakaba 1.3 The <TYPE::dis:TFQNames>-expanded URI references.
1190 wakaba 1.1 @@@UndeclaredPrefixException:
1191     @@@PerlDef:
1192     my ($typeq, $forq) = split /\s*::\s*/, $tfqnames, 2;
1193     my ($typeURI, $forURI);
1194     if (defined $forq) {
1195     __DEEP{
1196     $typeURI = $typeq eq ''
1197     ? defined $defaultTypeURI ? $defaultTypeURI
1198     : <Q::DOMMain:any>
1199     : $self-><M::ManakaiDISElement.qnameToURI> ($typeq, %opt);
1200     }__;
1201     if (length $forq) {
1202     $forURI = $self-><M::ManakaiDISElement.qnameToURI> ($forq, %opt);
1203     } else {
1204     $forURI = <Q::ManakaiDOM:all>;
1205     }
1206     } else { ## "For" omitted
1207     __DEEP{
1208     $typeURI = $typeq eq ''
1209     ? defined $defaultTypeURI ? $defaultTypeURI
1210     : <Q::DOMMain:any>
1211     : $self-><M::ManakaiDISElement.qnameToURI> ($typeq, %opt);
1212     }__;
1213 wakaba 1.3 $forURI = defined $defaultForURI ? $defaultForURI
1214     : <Q::ManakaiDOM:all>;
1215 wakaba 1.1 }
1216 wakaba 1.4 __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__;
1217 wakaba 1.2
1218     @Method:
1219     @@Name: disGetAttribute
1220     @@enDesc:
1221     Gets an attribute node.
1222     @@Param:
1223     @@@Name: attrName
1224     @@@Type: AnyURI
1225     @@@enDesc:
1226     The name expanded URI of the node to retrieve.
1227     @@ForParam:
1228     @@ForpParam:
1229     @@MediaTypeParam:
1230     @@MediaTypeDefaultParam:
1231     @@Return:
1232     @@@Type: ManakaiDISElement
1233     @@@enDesc:
1234     The attribute (property) element node.
1235     @@@nullCase:
1236     @@@@enDesc:
1237     No attribute node found.
1238     @@@PerlDef:
1239 wakaba 1.5 for my $c (@{$self-><M::ManakaiDISElement.disChildElements>}) {
1240 wakaba 1.3 if ($c-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1241     .expandedURI> eq $attrName and
1242 wakaba 1.2 $c-><AG::ManakaiDISElement.forMatch> ($forArg, $forpArg) and
1243     $c-><AG::ManakaiDISElement.mediaTypeMatch>
1244 wakaba 1.3 ($mediaType, $defaultMediaType)) {
1245 wakaba 1.2 $r = $c;
1246     last;
1247     }
1248     }
1249    
1250     @Method:
1251     @@Name: disGetAttributeList
1252     @@enDesc:
1253     Gets attribute nodes.
1254 wakaba 1.3 @@Param:
1255     @@@Name: attrName
1256     @@@Type: AnyURI
1257     @@@enDesc:
1258     The name expanded URI of the node to retrieve.
1259 wakaba 1.2 @@ForParam:
1260     @@ForpParam:
1261     @@MediaTypeParam:
1262     @@MediaTypeDefaultParam:
1263     @@Return:
1264     @@@Type: ManakaiDISElementList
1265     @@@enDesc:
1266     The attribute (property) element nodes.
1267     @@@PerlDef:
1268     $r = bless [], <ClassName::ManakaiDISElementList>;
1269 wakaba 1.5 for my $c (@{$self-><M::ManakaiDISElement.disChildElements>}) {
1270 wakaba 1.3 if ($c-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1271     .expandedURI> eq $attrName and
1272 wakaba 1.2 $c-><AG::ManakaiDISElement.forMatch> ($forArg, $forpArg) and
1273     $c-><AG::ManakaiDISElement.mediaTypeMatch>
1274 wakaba 1.3 ($mediaType, $defaultMediaType)) {
1275 wakaba 1.2 push @$r, $c;
1276     }
1277     }
1278    
1279 wakaba 1.4 @Method:
1280 wakaba 1.2 @@Name: disChildElements
1281     @@enDesc:
1282     A list of child elements.
1283 wakaba 1.4 @@ForParam:
1284     @@ForpParam:
1285     @@Return:
1286     @@@Type: ManakaiDISElementList
1287 wakaba 1.2 @@@enDesc:
1288     The current snapshot of child nodes.
1289     @@@PerlDef:
1290 wakaba 1.4 $r = bless [], <ClassName::ManakaiDISElementList>;
1291     __DEEP{
1292     for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1293     .childNodes>}) {
1294     ## $cn is an #element.
1295     my $dn = $cn->{<Q::TreeCore:node>}
1296     -><M::ManakaiDOM:ManakaiDOMNodeObject
1297     ::ManakaiDOM:Perl.newReference>
1298     (<ClassName::ManakaiDISElement>);
1299     next unless $dn-><M::ManakaiDISElement.forMatch> ($forArg, $forpArg);
1300     push @$r, $dn;
1301     }
1302     }__;
1303 wakaba 1.5
1304 wakaba 1.2 @Attr:
1305     @@Name: qnameValueURI
1306     @@enDesc:
1307     The element value (written as <TYPE::dis:TypeQName>), as URI reference.
1308     \
1309     {NOTE:: What should be if list value?
1310     \
1311     }
1312     @@Get:
1313     @@@Type:AnyURI
1314     @@@nullCase:
1315     @@@@enDesc:
1316     No value.
1317     @@@UndeclaredPrefixException:
1318 wakaba 1.3 @@@PerlDef:
1319 wakaba 1.4 __DEEP{
1320     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1321     if (defined $v and not ref $v eq 'ARRAY') {
1322     $r = $self-><AG::ManakaiDISElement.qnameToURI> ($v, node => $self);
1323     } else {
1324     $r = null;
1325     }
1326     }__;
1327    
1328     @Attr:
1329     @@Name: qnameValueLocalName
1330     @@enDesc:
1331     The local name part of the element value (assumed as
1332     written as <TYPE::dis:TypeQName>).
1333     \
1334     {NOTE:: What should be if list value?
1335     \
1336     }
1337     @@Get:
1338     @@@Type:
1339     DISCore:LocalName
1340     @@@nullCase:
1341     @@@@enDesc:
1342     No value.
1343     @@@PerlDef:
1344     __DEEP{
1345     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1346     if (defined $v and not ref $v eq 'ARRAY') {
1347     my ($n, $v) = split /:/, $v, 2;
1348     $r = defined $v ? $v : $n;
1349     } else {
1350     $r = null;
1351     }
1352     }__;
1353    
1354     @Attr:
1355     @@Name: qnameValueNamespaceURI
1356     @@enDesc:
1357     The namespace URI of the element value (assumed as written
1358     in <TYPE::dis:TypeQName>).
1359     \
1360     {NOTE:: What should be if list value?
1361     \
1362     }
1363     @@Get:
1364     @@@Type:AnyURI
1365     @@@nullCase:
1366     @@@@enDesc:
1367     No value.
1368     @@@UndeclaredPrefixException:
1369     @@@PerlDef:
1370     __DEEP{
1371     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1372     if (defined $v and not ref $v eq 'ARRAY') {
1373     my ($p, $v) = split /:/, $v, 2;
1374     $r = $self-><AG::ManakaiDISElement.prefixToURI>
1375     (defined $v ? $p : null);
1376     } else {
1377     $r = null;
1378     }
1379     }__;
1380 wakaba 1.2
1381 wakaba 1.6 @Method:
1382 wakaba 1.3 @@Name: tfqnamesValueURI
1383 wakaba 1.2 @@enDesc:
1384 wakaba 1.3 The element value (written as <TYPE::dis:TFQNames>),
1385 wakaba 1.2 as URI reference.
1386     \
1387     {NOTE:: What should be if list value?
1388     \
1389     }
1390 wakaba 1.6 @@Param:
1391     @@@Name: defaultTypeURI
1392     @@@Type: NameURI
1393     @@@Description:
1394     @@@@lang:en
1395     @@@@@:
1396     A name URI reference used if it is missing from
1397     <P::tfqnames>.
1398     @@@InCase:
1399     @@@@Value:
1400     @@@@@is-null:1
1401     @@@@Description:
1402     @@@@@lang:en
1403     @@@@@@:
1404     Equivalent to <Q::DOMMain:any>.
1405     @@Param:
1406     @@@Name: defaultForURI
1407     @@@Type: ForURI
1408     @@@Description:
1409     @@@@lang:en
1410     @@@@@:
1411     A <QUOTE::for> URI reference used if it is missing from
1412     <P::tfqnames>.
1413     @@@InCase:
1414     @@@@Value:
1415     @@@@@is-null:1
1416     @@@@Description:
1417     @@@@@lang:en
1418     @@@@@@:
1419     Equivalent to <QUOTE::for all>, i.e. <Q::ManakaiDOM:all>.
1420     @@Return:
1421 wakaba 1.2 @@@Type:ResourceURI
1422     @@@nullCase:
1423     @@@@enDesc:
1424     No value.
1425     @@@UndeclaredPrefixException:
1426 wakaba 1.3 @@@PerlDef:
1427     my $v = $self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1428 wakaba 1.2 if (defined $v and not ref $v eq 'ARRAY') {
1429     __DEEP{
1430 wakaba 1.6 $r = $self-><AG::ManakaiDISElement.tfqnamesToURI>
1431     ($v, $defaultTypeURI, $defaultForURI);
1432 wakaba 1.2 }__;
1433     } else {
1434     $r = null;
1435     }
1436 wakaba 1.7
1437     @Method:
1438     @@Name: elementTypeMatch
1439     @@enDesc:
1440     Returns whether the element type of this element matches
1441     with another element type (either the same element type or
1442     this type is a subtype of another type).
1443     @@Param:
1444     @@@Name: etype
1445     @@@Type: ResourceURI
1446     @@@enDesc:
1447     An element type name URI reference to test.
1448     @@Return:
1449     @@@Type:
1450     DOMMain:boolean
1451     @@@TrueCase:
1452     @@@@enDesc:
1453     Either the element type expanded URI reference of this element is
1454     same as <P::etype> or it is a sub-element type of <P::etype>.
1455     @@@FalseCase:
1456     @@@@enDesc:
1457     This element is not of <P::etype>.
1458     @@@NoDBException:
1459     @@@PerlDef:
1460     __DEEP{
1461     my $et = $self-><M::swcfg21:SWCFGElement::swcfg21:ForLatest
1462     .expandedURI>;
1463     my $rdef = $self-><AG::ManakaiDISNode.ownerDISDocument>
1464     -><AG::ManakaiDISDocument.disDatabase>
1465     -><M::ManakaiDISDatabase.getResource> ($et);
1466     $r = $rdef-><M::ManakaiDISResourceDefinition.isSubsetOfURI> ($etype);
1467     }__;
1468    
1469     @Attr:
1470     @@Name: isResourceElement
1471     @@enDesc:
1472     Whether this element defines a resource or not.
1473     \
1474     {NOTE:: An element defines a resource if its element type is
1475     <Q::dis:ResourceDef> or its subtype.
1476     \
1477     }
1478     @@Get:
1479     @@@Type:
1480     DOMMain:boolean
1481     @@@TrueCase:
1482     @@@@enDesc:
1483     This element defines a resource.
1484     @@@FalseCase:
1485     @@@@enDesc:
1486     This element does not define any resource.
1487     @@@NoDBException:
1488     @@@PerlDef:
1489     __DEEP{
1490     $r = $self-><M::ManakaiDISElement.elementTypeMatch>
1491     (<Q::dis:ResourceDef>);
1492     }__;
1493    
1494     @Attr:
1495     @@Name: isPropertyElement
1496     @@enDesc:
1497     Whether this element is a property or not.
1498     \
1499     {NOTE:: An element is a property if its element type is
1500     <Q::rdf:type> or if its element type's <Q::rdf:type>
1501     property is <Q::rdf:Property> or is <Q::dis:subsetOf>
1502     <Q::rdf:Property>.
1503     \
1504     }
1505     @@Get:
1506     @@@Type:
1507     DOMMain:boolean
1508     @@@TrueCase:
1509     @@@@enDesc:
1510     This element is a property.
1511     @@@FalseCase:
1512     @@@@enDesc:
1513     This element is not a property.
1514     @@@NoDBException:
1515     @@@PerlDef:
1516     __DEEP{
1517     my $xn = $self-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
1518     .expandedURI>;
1519     if ($xn eq <Q::rdf:type>) {
1520     $r = true;
1521     } else {
1522     my $rdef = $self-><AG::ManakaiDISNode.ownerDISDocument>
1523     -><AG::ManakaiDISDocument.disDatabase>
1524     -><M::ManakaiDISDatabase.getResource> ($xn);
1525     $r = $rdef-><M::ManakaiDISResourceDefinition.isTypeURI>
1526     (<Q::rdf:Resource>);
1527     }
1528     }__;
1529 wakaba 1.1 ##DISElement
1530    
1531     ClsDef:
1532 wakaba 1.4 @ClsQName: ManakaiDISModuleElement
1533     @ClsISA: ManakaiDISElement
1534     @enDesc:
1535     The <Q::dis:Module> elements.
1536    
1537     @Attr:
1538     @@Name: requireElement
1539     @@enDesc:
1540     The <Q::dis:Require> child element. The element is
1541     newly created if not exist.
1542     @@Type: ManakaiDISElement
1543     @@Get:
1544     @@@PerlDef:
1545     __DEEP{
1546     $r = $self-><M::swcfg21:SWCFGNode
1547     ::swcfg21:ForLatest.getAttributeNS>
1548     (<Q::dis:>, 'Require', make_new_node => true);
1549     }__;
1550    
1551     @Attr:
1552     @@Name: defaultForURI
1553     @@enDesc:
1554     The value of <Q::dis:DefaultFor> attribute.
1555     @@Type: ForURI
1556     @@Get:
1557     @@@enDesc:
1558     The value of <Q::dis:DefaultFor> child element. If missing,
1559     <Q::ManakaiDOM:all> is returned.
1560     @@@PerlDef:
1561     __DEEP{
1562     my $df = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
1563     .getAttributeNS>
1564     (<Q::dis:>, 'DefaultFor');
1565     if ($df) {
1566     $r = $df-><AG::ManakaiDISElement.qnameValueURI>
1567     || <Q::ManakaiDOM:all>;
1568     } else {
1569     $r = <Q::ManakaiDOM:all>;
1570     }
1571     }__;
1572     @@Set:
1573     @@@PerlDef:
1574     __DEEP{
1575     $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.setAttributeNS>
1576     (<Q::dis:>, 'DefaultFor' => $given);
1577     }__;
1578 wakaba 1.7
1579     @Attr:
1580     @@Name: definingNamespaceURI
1581     @@enDesc:
1582     The value of <Q::dis:NamespaceURI> attribute, i.e.
1583     the URI reference of the namespace that this module primary
1584     defines.
1585     \
1586     {NOTE:: Defining namespace URI is <QUOTE::for> independent.
1587     \
1588     }
1589     @@Type: AnyURI
1590     @@Get:
1591     @@@PerlDef:
1592     __DEEP{
1593     my $df = $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
1594     .getAttributeNS>
1595     (<Q::dis:>, 'Namespace');
1596     if ($df) {
1597     $r = $df-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
1598     } else {
1599     __ASSERT{DISPerl:invariant::
1600     msg => {qq["dis:Namespace" attribute not found]},
1601     }__;
1602     }
1603     }__;
1604     @@Set:
1605     @@@PerlDef:
1606     __DEEP{
1607     $self-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.setAttributeNS>
1608     (<Q::dis:>, 'Namespace' => $given);
1609     }__;
1610 wakaba 1.4 ##DISModuleElement
1611    
1612     ClsDef:
1613 wakaba 1.2 @ClsQName: ManakaiDISElementList
1614     @enDesc:
1615     @@lang:en
1616     @@@:
1617     Lists of elements.
1618     \
1619     {NOTE:: <Class::ManakaiDISElementList> is <QUOTE::dead>;
1620     later changes to the tree does not affect this type of objects.
1621     \
1622     }
1623     ##DISElementList
1624    
1625     ClsDef:
1626 wakaba 1.1 @ClsQName: ManakaiDISComment
1627 wakaba 1.7 @ClsISA: ManakaiDISNode
1628 wakaba 1.1 @ClsISA:
1629 wakaba 1.3 swcfg21:ManakaiSWCFGComment::swcfg21:ForLatest
1630 wakaba 1.1 @Description:
1631     @@lang:en
1632     @@@:
1633     <QUOTE::dis> comment node objects.
1634     ##DISComment
1635    
1636     ClsDef:
1637     @ClsQName: ManakaiDISDocumentFragment
1638 wakaba 1.7 @ClsISA: ManakaiDISNode
1639 wakaba 1.1 @ClsISA:
1640 wakaba 1.3 swcfg21:ManakaiSWCFGDocumentFragment::swcfg21:ForLatest
1641 wakaba 1.1 @Description:
1642     @@lang:en
1643     @@@:
1644     <QUOTE::dis> document fragment node objects.
1645     ##DISDocumentFragment
1646    
1647     ClsDef:
1648     @ClsQName: ManakaiDISDocument
1649 wakaba 1.7 @ClsISA: ManakaiDISNode
1650 wakaba 1.1 @ClsISA:
1651 wakaba 1.3 swcfg21:ManakaiSWCFGDocument::swcfg21:ForLatest
1652 wakaba 1.1 @Description:
1653     @@lang:en
1654     @@@:
1655     <QUOTE::dis> document node objects.
1656 wakaba 1.2
1657     @Attr:
1658 wakaba 1.4 @@Name: moduleElement
1659     @@enDesc:
1660     The <Q::dis:Module> element in this document. The element is
1661     newly created if not exist.
1662     @@Type: ManakaiDISModuleElement
1663     @@Get:
1664     @@@PerlDef:
1665     __DEEP{
1666     $r = $self-><M::swcfg21:SWCFGNode
1667     ::swcfg21:ForLatest.getAttributeNS>
1668     (<Q::dis:>, 'Module', make_new_node => true);
1669     }__;
1670     $r = bless $r, <ClassName::ManakaiDISModuleElement>;
1671    
1672     @Attr:
1673 wakaba 1.2 @@Name: disDatabase
1674     @@enDesc:
1675     Associated <QUOTE::dis> database.
1676    
1677     @@Type: ManakaiDISDatabase
1678     @@Get:
1679     @@@NoDBException:
1680     @@@PerlDef:
1681     if ($self->{<Q::TreeCore:node>}->{<Q::db>}) {
1682 wakaba 1.5 $r = $self->{<Q::TreeCore:node>}->{<Q::db>};
1683 wakaba 1.2 } else {
1684     __EXCEPTION{NO_ASSOCIATED_DB_ERR}__;
1685     }
1686     @@Set:
1687     @@@PerlDef:
1688     $self->{<Q::TreeCore:node>}->{<Q::db>} = $given;
1689     require Scalar::Util;
1690     Scalar::Util::weaken ($self->{<Q::TreeCore:node>}->{<Q::db>});
1691 wakaba 1.5
1692     @Method:
1693     @@Name: disChildElements
1694     @@enDesc:
1695     A list of child elements.
1696     @@ForParam:
1697     @@ForpParam:
1698     @@Return:
1699     @@@Type: ManakaiDISElementList
1700     @@@enDesc:
1701     The current snapshot of child nodes.
1702     @@@PerlDef:
1703     $r = bless [], <ClassName::ManakaiDISElementList>;
1704     __DEEP{
1705     for my $cn (@{$self-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1706     .childNodes>}) {
1707     next unless $cn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
1708     .nodeType> eq '#element';
1709     my $dn = $cn->{<Q::TreeCore:node>}
1710     -><M::ManakaiDOM:ManakaiDOMNodeObject
1711     ::ManakaiDOM:Perl.newReference>
1712     (<ClassName::ManakaiDISElement>);
1713     next unless $dn-><M::ManakaiDISElement.forMatch> ($forArg, $forpArg);
1714     push @$r, $dn;
1715     }
1716     }__;
1717 wakaba 1.1 ##DISDocument
1718 wakaba 1.2
1719     PropDef:
1720     @QName: db
1721     @enDesc:
1722     Associated <QUOTE::dis> database.
1723     @rdfs:domain: ManakaiDISDocument
1724     @rdfs:range: ManakaiDISDatabase
1725    
1726     ## -- Definition object database
1727    
1728     ClsDef:
1729     @ClsQName: ManakaiDISDatabase
1730     @enDesc:
1731     Resource database created from <QUOTE::dis> source data.
1732 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
1733 wakaba 1.2
1734     @Method:
1735     @@Name: getModule
1736     @@Description:
1737     @@@lang:en
1738     @@@@:
1739     Returns a <QUOTE::dis> module definition.
1740     @@Param:
1741 wakaba 1.9 @@@Name: moduleURI
1742 wakaba 1.2 @@@Type: ModuleURI
1743     @@@Description:
1744     @@@@lang:en
1745     @@@@@:
1746     A <QUOTE::dis> module URI reference.
1747 wakaba 1.9 @@ForParam:
1748 wakaba 1.2 @@Return:
1749     @@@Type: ManakaiDISModuleDefinition
1750     @@@Description:
1751     @@@@lang:en
1752     @@@@@:
1753     The module definition.
1754     @@@PerlDef:
1755 wakaba 1.9 my $modURI;
1756     if (defined $forArg) {
1757     __CODE{tfurisToURI:: $turi => $moduleURI, $furi => $forArg,
1758     $uri => $modURI}__;
1759     } else {
1760     $modURI = $moduleURI;
1761     }
1762 wakaba 1.2 if (defined $self->{modDef}->{$modURI}) {
1763     $r = $self->{modDef}->{$modURI};
1764     } else {
1765     $r = $self->{modDef}->{$modURI}
1766     = bless {
1767     uri => $modURI,
1768     db => $self,
1769     for => <Q::ManakaiDOM:all>,
1770     forp => [],
1771     }, <ClassName::ManakaiDISModuleDefinition>;
1772     require Scalar::Util;
1773     Scalar::Util::weaken ($r->{db});
1774     }
1775    
1776     @Method:
1777     @@Name: getFor
1778     @@Description:
1779     @@@lang:en
1780     @@@@:
1781     Returns a <QUOTE::for> definition object.
1782     @@Param:
1783     @@@Name: forURI
1784     @@@Type: ForURI
1785     @@@Description:
1786     @@@@lang:en
1787     @@@@@:
1788     A <QUOTE::for> URI reference.
1789     @@@InCase:
1790     @@@@Value:
1791     @@@@@is-null:1
1792     @@@@Description:
1793     @@@@@lang:en
1794     @@@@@@:
1795     Defaulted to <Q::ManakaiDOM:all>.
1796     @@Return:
1797     @@@Type: ManakaiDISForDefinition
1798     @@@PerlDef:
1799     $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
1800     if (defined $self->{forDef}->{$forURI}) {
1801     $r = $self->{forDef}->{$forURI};
1802     } else {
1803     $r = $self->{forDef}->{$forURI}
1804     = bless {
1805     uri => $forURI,
1806     isa => {<Q::ManakaiDOM:all> => true},
1807     revISA => {},
1808     db => $self,
1809     }, <ClassName::ManakaiDISForDefinition>;
1810     $self->{forDef}->{<Q::ManakaiDOM:all>}->{revISA}->{$forURI} = true;
1811     require Scalar::Util;
1812     Scalar::Util::weaken ($r->{db});
1813     }
1814    
1815     @Method:
1816     @@Name: getResource
1817     @@Description:
1818     @@@lang:en
1819     @@@@:
1820     Returns a <QUOTE::dis> resource definition.
1821     @@Param:
1822 wakaba 1.9 @@@Name: resourceURI
1823 wakaba 1.2 @@@Type: ResourceURI
1824     @@@Description:
1825     @@@@lang:en
1826     @@@@@:
1827     A <QUOTE::dis> resource URI reference.
1828 wakaba 1.3 @@@nullCase:
1829 wakaba 1.2 @@@@Description:
1830     @@@@@lang:en
1831     @@@@@@:
1832     Defaulted to <Q::DOMMain:any>.
1833 wakaba 1.9 @@ForParam:
1834 wakaba 1.2 @@Return:
1835     @@@Type: ManakaiDISResourceDefinition
1836     @@@Description:
1837     @@@@lang:en
1838     @@@@@:
1839     The resource definition.
1840     @@@PerlDef:
1841 wakaba 1.9 $resourceURI = <Q::DOMMain:any> unless defined $resourceURI;
1842     my $resURI;
1843     if (defined $forArg) {
1844     __CODE{tfurisToURI:: $turi => $resourceURI, $furi => $forArg,
1845     $uri => $resURI}__;
1846     } else {
1847     $resURI = $resourceURI;
1848     }
1849 wakaba 1.2 if (defined $self->{resDef}->{$resURI}) {
1850     $r = $self->{resDef}->{$resURI};
1851     } else {
1852     $r = $self->{resDef}->{$resURI}
1853     = bless {
1854     uri => $resURI,
1855 wakaba 1.6 aliasURI => {$resURI => true},
1856 wakaba 1.2 subOf => {},
1857     supOf => {},
1858     db => $self,
1859     for => <Q::ManakaiDOM:all>,
1860     forp => [],
1861 wakaba 1.9 seq => -1,
1862 wakaba 1.2 }, <ClassName::ManakaiDISResourceDefinition>;
1863     require Scalar::Util;
1864     Scalar::Util::weaken ($r->{db});
1865     }
1866 wakaba 1.3
1867     @Method:
1868     @@Name: getSourceFile
1869     @@enDesc:
1870     Gets <QUOTE::dis> source document.
1871     @@Param:
1872     @@@Name: fileName
1873     @@@Type: FileURI
1874     @@@enDesc:
1875     A URI reference identifying a file.
1876     @@Return:
1877     @@@Type: ManakaiDISDocument
1878     @@@enDesc:
1879     The <QUOTE::dis> source document.
1880     @@@nullCase:
1881     @@@@enDesc:
1882     No document associated with that <P::fileName>.
1883     @@@PerlDef:
1884     $r = $self->{<Q::sourceFile>}->{$fileName};
1885     @Method:
1886     @@Name: setSourceFile
1887     @@enDesc:
1888     Puts <QUOTE::dis> source document object.
1889     @@Param:
1890     @@@Name: fileName
1891     @@@Type: FileURI
1892     @@@enDesc:
1893 wakaba 1.4 A URI reference identifying a file. If there is already a
1894 wakaba 1.3 source document, then the association has been updated.
1895     @@Param:
1896     @@@Name: doc
1897     @@@Type: ManakaiDISDocument
1898     @@@enDesc:
1899     The document object to set.
1900     @@Return:
1901     @@@PerlDef:
1902     $self->{<Q::sourceFile>}->{$fileName} = $doc;
1903 wakaba 1.4
1904     @Method:
1905     @@Name: loadModule
1906     @@enDesc:
1907     Loads definitions from a <QUOTE::dis> document.
1908     @@Param:
1909     @@@Name: doc
1910     @@@Type:ManakaiDISDocument
1911     @@@enDesc:
1912     The source <QUOTE::dis> document object. Its
1913     <A::ManakaiDISDocument.disDatabase> must be this database.
1914     @@Param:
1915     @@@Name: resolver
1916     @@@Type: DISModuleResolver
1917     @@@enDesc:
1918     The resolver to convert module name into <QUOTE::dis> document object.
1919     @@ForParam:
1920     @@Return:
1921     @@@RaiseException:
1922     @@@@@: NO_MODULE_QNAME_ERR
1923     @@@@enDesc:
1924     The <Q::dis:Module> element must have a <Q::dis:QName> attribute.
1925     @@@RaiseException:
1926     @@@@@: UNABLE_TO_GET_MODULE_ERR
1927     @@@@enDesc:
1928     The implementation is unable to get a module source.
1929 wakaba 1.5 @@@ForDefDupException:
1930     @@@ForDefNoQNameException:
1931     @@@ResDefDupException:
1932     @@@ElementNotAllowedException:
1933 wakaba 1.7 @@@RaiseException:
1934     @@@@@:NO_REQUIRED_ATTR_ERR
1935     @@@@enDesc:
1936     The <Q::dis:Module> element does not have
1937     <Q::dis:Namespace> attribute.
1938 wakaba 1.4 @@@PerlDef:
1939     $resolver = bless $resolver, <ClassName::ManakaiDISModuleResolver>
1940     if ref $resolver eq 'CODE';
1941     ## -- Module Name, URI
1942     $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
1943     my $mod_node;
1944     my $mod_name_node;
1945     __DEEP{
1946     $mod_node = $doc-><AG::ManakaiDISDocument.moduleElement>;
1947     $mod_name_node = $mod_node-><M::swcfg21:SWCFGNode
1948     ::swcfg21:ForLatest.getAttributeNS>
1949     (<Q::dis:>, 'QName');
1950     unless ($mod_name_node) {
1951     __UNDEEP{
1952     __EXCEPTION{NO_MODULE_QNAME_ERR::
1953     DIS:sourceNode => {$mod_node},
1954     }__;
1955     }__;
1956     }
1957 wakaba 1.5 my $mod_name_uri = $mod_name_node
1958     -><AG::ManakaiDISElement.qnameValueURI>;
1959 wakaba 1.9 my $mod = $self-><M::ManakaiDISDatabase.getModule>
1960     ($mod_name_uri, for_arg => $forArg);
1961 wakaba 1.4
1962     unless ($mod-><M::ManakaiDISModuleDefinition.isDefined>) {
1963     ## -- Initializes Module Definition Object
1964     $mod->{nameURI} = $mod_name_uri;
1965     $mod->{localName} = $mod_name_node-><AG::ManakaiDISElement
1966     .qnameValueLocalName>;
1967     $mod->{namespaceURI} = $mod_name_node-><AG::ManakaiDISElement
1968     .qnameValueNamespaceURI>;
1969     $mod->{for} = $forArg;
1970     $mod->{src} = $mod_node;
1971 wakaba 1.5 $mod->{<Q::isDefined>} = true;
1972 wakaba 1.4 $self-><M::ManakaiDISDatabase.setSourceFile>
1973 wakaba 1.5 ($mod->{nameURI} => $doc);
1974    
1975 wakaba 1.9 $mod->{<Q::DIS:sourceFile>}
1976     = $mod->{src}
1977     -><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.ownerDocument>
1978     -><M::swcfg21:SWCFGNode::swcfg21:ForLatest.flag>
1979     (<Q::swcfg21:fileName>);
1980 wakaba 1.5
1981     ## -- Loads "for all"
1982 wakaba 1.9 my $rmod = $self-><M::ManakaiDISDatabase.getModule>
1983     ($mod->{nameURI}, for_arg => <Q::ManakaiDOM:all>);
1984 wakaba 1.5 unless ($rmod-><AG::ManakaiDISModuleDefinition.isDefined>) {
1985     my $rdoc = $resolver-><M::ManakaiDISModuleResolver.uriToDocument>
1986 wakaba 1.9 ($self, $rmod->{uri}, $mod->{namespaceURI},
1987     $mod->{localName}, <Q::ManakaiDOM:all>);
1988 wakaba 1.5 unless ($rdoc) {
1989     __UNDEEP{
1990     __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
1991 wakaba 1.9 DIS:uri => {$rmod->{uri}},
1992 wakaba 1.5 DIS:namespaceURI => {$mod->{namespaceURI}},
1993     DIS:localName => {$mod->{localName}},
1994 wakaba 1.9 DIS:for => {<Q::ManakaiDOM:all>},
1995 wakaba 1.5 DIS:sourceNode => {$mod->{src}},
1996     }__;
1997     }__;
1998     }
1999     $self-><M::ManakaiDISDatabase.loadModule>
2000 wakaba 1.9 ($rdoc, $resolver, for_arg => <Q::ManakaiDOM:all>);
2001 wakaba 1.5 } # Unless "for all" loaded
2002 wakaba 1.4
2003     ## -- Loads Required Modules
2004     my $req_node = $mod_node-><AG::ManakaiDISModuleElement
2005     .requireElement>;
2006     for my $rm (@{$req_node-><M::ManakaiDISElement.disChildElements>}) {
2007     next unless $rm-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
2008     .expandedURI> eq <Q::dis:Module>;
2009     my ($uri, $nuri, $ln, $for);
2010     my $mqn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
2011     .getAttributeNS> (<Q::dis:>, 'QName');
2012     if ($mqn) {
2013     my $mqv = $mqn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
2014     .value>;
2015     my $mqp = $mqn-><AG::ManakaiDISElement.qnameToPair>
2016     ($mqv, node => $mqn);
2017     ($nuri, $ln) = @$mqp;
2018     } else {
2019     my $mn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
2020     .getAttributeNS> (<Q::dis:>, 'Name');
2021     if ($mn) {
2022     $nuri = $mod->{namespaceURI};
2023     $ln = $mn-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2024     } else {
2025     $nuri = $mod->{namespaceURI};
2026     $ln = $mod->{localName};
2027     }
2028     }
2029     my $wfn = $rm-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest
2030     .getAttributeNS> (<Q::dis:>, 'WithFor');
2031     if ($wfn) {
2032     $for = $wfn-><AG::ManakaiDISElement.qnameValueURI>;
2033     } else {
2034     $for = $mod->{for};
2035     }
2036 wakaba 1.9 my $rmod = $self-><M::ManakaiDISDatabase.getModule>
2037     ($nuri . $ln, for_arg => $for);
2038 wakaba 1.4 unless ($rmod-><AG::ManakaiDISModuleDefinition.isDefined>) {
2039     my $rdoc = $resolver-><M::ManakaiDISModuleResolver.uriToDocument>
2040 wakaba 1.9 ($self, $rmod->{uri}, $nuri, $ln, $for);
2041 wakaba 1.4 unless ($rdoc) {
2042     __UNDEEP{
2043     __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
2044 wakaba 1.9 DIS:uri => {$rmod->{uri}},
2045 wakaba 1.4 DIS:namespaceURI => {$nuri},
2046     DIS:localName => {$ln},
2047     DIS:for => {$for},
2048     DIS:sourceNode => {$rm},
2049     }__;
2050     }__;
2051     }
2052     $self-><M::ManakaiDISDatabase.loadModule>
2053     ($rdoc, $resolver, for_arg => $for);
2054     }
2055     } # Child Module elements
2056    
2057 wakaba 1.5 my $root_elements = $doc-><M::ManakaiDISDocument.disChildElements>;
2058     if ($mod->{for} eq <Q::ManakaiDOM:all>) {
2059     ## -- Loads "for" definitions
2060     for my $el (@$root_elements) {
2061     next unless $el-><M::swcfg21:SWCFGElement::swcfg21:ForLatest
2062     .expandedURI> eq <Q::dis:ForDef>;
2063     $self-><M::ManakaiDISDatabase.loadFor> ($mod, $el);
2064     }
2065     }
2066    
2067     for my $el (@$root_elements) {
2068 wakaba 1.7 if ($el-><M::ManakaiDISElement.isResourceElement>) {
2069     $self-><M::ManakaiDISDatabase.loadResource>
2070 wakaba 1.9 ($mod, null, null, $el,
2071 wakaba 1.7 for_arg => $forArg);
2072     } else {
2073     my $et = $el-><M::swcfg21:SWCFGElement::swcfg21:ForLatest
2074     .expandedURI>;
2075     if ({
2076 wakaba 1.5 <Q::dis:ForDef> => 1,
2077     <Q::dis:Module> => 1,
2078     <Q::dis:ImplNote> => 1,
2079 wakaba 1.7 }->{$et}) {
2080     #
2081     } else {
2082     __UNDEEP{
2083     __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR::
2084     DIS:elementType => {$et},
2085     DIS:sourceNode => {$el},
2086     DIS:uri => {$mod->{uri}},
2087     }__;
2088 wakaba 1.5 }__;
2089 wakaba 1.7 }
2090     } # element types
2091     }
2092    
2093     my $dn = $mod_node-><M::swcfg21:SWCFGNode::swcfg21:ForLatest
2094     .getAttributeNS>
2095     (<Q::dis:>, 'Namespace');
2096     unless ($dn and defined $dn-><AG::swcfg21:SWCFGNode
2097     ::swcfg21:ForLatest.value>) {
2098     __UNDEEP{
2099     __EXCEPTION{NO_REQUIRED_ATTR_ERR::
2100     DIS:elementType => {<Q::dis:Namespace>},
2101     DIS:sourceNode => {$mod_node},
2102 wakaba 1.5 }__;
2103 wakaba 1.7 }__;
2104 wakaba 1.5 }
2105     } # Unless this module loaded
2106     }__; # Deep
2107    
2108     @Method:
2109     @@Name: loadFor
2110     @@enDesc:
2111     Loads definition of a <QUOTE::for> from a <Q::dis:ForDef> element.
2112     @@Param:
2113     @@@Name: mod
2114     @@@Type: ManakaiDISModuleDefinition
2115     @@@enDesc:
2116     The module in which the <QUOTE::for> to load is defined.
2117     @@Param:
2118     @@@Name: el
2119     @@@Type:ManakaiDISElement
2120     @@@enDesc:
2121     The source <QUOTE::dis> <Q::dis:ForDef> element object.
2122     @@Return:
2123     @@@ForDefDupException:
2124     @@@ForDefNoQNameException:
2125     @@@ElementNotAllowedException:
2126     @@@PerlDef:
2127     __DEEP{
2128     my $qn_node = $el-><M::swcfg21:SWCFGNode
2129     ::swcfg21:ForLatest.getAttributeNS>
2130     (<Q::dis:>, 'QName');
2131     unless ($qn_node) {
2132     __UNDEEP{
2133     __EXCEPTION{NO_FOR_QNAME_ERR::
2134     DIS:sourceNode => {$qn_node},
2135     }__;
2136     }__;
2137     }
2138     my $qn_uri = $qn_node-><AG::ManakaiDISElement.qnameValueURI>;
2139     my $for = $self-><M::ManakaiDISDatabase.getFor> ($qn_uri);
2140    
2141     unless ($for-><M::ManakaiDISForDefinition.isDefined>) {
2142     ## -- Initializes For Definition Object
2143     $for->{src} = $el;
2144     $for->{<Q::isDefined>} = true;
2145     $for->{<Q::definingModule>} = $mod->{uri};
2146    
2147     for my $ce (@{$el-><M::ManakaiDISElement.disChildElements>}) {
2148     my $xn = $ce-><AG::swcfg21:SWCFGElement::swcfg21:ForLatest
2149     .expandedURI>;
2150     if ($xn eq <Q::dis:ISA> or $xn eq <Q::dis:Implement>) {
2151     my $sfor = $self-><M::ManakaiDISDatabase.getFor>
2152 wakaba 1.7 ($ce-><AG::ManakaiDISElement.qnameValueURI>);
2153 wakaba 1.5 $for-><M::ManakaiDISForDefinition.addISA> ($sfor);
2154 wakaba 1.7 $sfor-><M::ManakaiDISForDefinition.isReferred> ($ce);
2155 wakaba 1.5 ## TODO: warn if dis:Implement
2156     } elsif ({
2157     <Q::dis:Description> => 1,
2158     <Q::dis:ImplNote> => 1,
2159     <Q::dis:FullName> => 1,
2160     <Q::dis:QName> => 1,
2161     }->{$xn}) {
2162     #
2163     } else {
2164     __UNDEEP{
2165     __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR::
2166     DIS:elementType => {$xn},
2167     DIS:sourceNode => {$ce},
2168     DIS:uri => {$mod->{uri}},
2169     }__;
2170     }__;
2171     }
2172     }
2173     } else {
2174     __UNDEEP{
2175     __EXCEPTION{FOR_ALREADY_DEFINED_ERR::
2176     DIS:sourceNode => {$el},
2177     DIS:anotherSourceNode => {$for->{src}},
2178     }__;
2179     }__;
2180     } # isDefine?
2181     }__; # DEEP
2182    
2183     @Method:
2184     @@Name: loadResource
2185     @@enDesc:
2186     Loads definition of a <QUOTE::dis> resource from a
2187     <Q::dis:ResourceDef> element.
2188     @@Param:
2189     @@@Name: mod
2190     @@@Type: ManakaiDISModuleDefinition
2191     @@@enDesc:
2192     The module in which the resource to load is defined.
2193     @@Param:
2194     @@@Name: parentResource
2195     @@@Type: ManakaiDISResourceDefinition
2196     @@@enDesc:
2197 wakaba 1.7 The (static) parent resource in which the resource to load is defined.
2198 wakaba 1.5 @@@nullCase:
2199     @@@@enDesc:
2200     The resource to load is a root resource, i.e. <P::el> is
2201     a direct child of the document node.
2202     @@Param:
2203 wakaba 1.7 @@@Name: dynParent
2204 wakaba 1.9 @@@Type: ManakaiDISResourceDefinition
2205 wakaba 1.7 @@@enDesc:
2206     The dynamic parent resource of the resource to load.
2207 wakaba 1.9 @@@nullCase:
2208 wakaba 1.7 @@@@enDesc:
2209 wakaba 1.9 If this resource is a root resource, i.e. <P::el> is
2210     a direct child of the document node.
2211 wakaba 1.7 @@Param:
2212 wakaba 1.5 @@@Name: el
2213     @@@Type:ManakaiDISElement
2214     @@@enDesc:
2215     The source <QUOTE::dis> <Q::dis:ResourceDef> element object.
2216     @@ForParam:
2217     @@ForpParam:
2218     @@Return:
2219     @@@ResDefDupException:
2220     @@@ElementNotAllowedException:
2221     @@@PerlDef:
2222     $forArg = <Q::ManakaiDOM:all> unless defined $forArg;
2223     $forpArg ||= [];
2224     __DEEP{
2225 wakaba 1.6 ## -- Node names
2226    
2227     ## Unique resource identifier generated from node id
2228     my $node_id = $el-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.nodeID>;
2229     my $node_uri;
2230     __CODE{tfpurisToURI:: $turi => $node_id, $furi => $forArg,
2231     $forp => $forpArg, $uri => $node_uri}__;
2232    
2233     ## User defined resource identifiers
2234 wakaba 1.5 my $qn_node = $el-><M::ManakaiDISElement.disGetAttribute>
2235     (<Q::dis:QName>, for_arg => $forArg,
2236     forp_arg => $forpArg);
2237     my $res;
2238     if ($qn_node) {
2239     my $qn_uri = $qn_node-><AG::ManakaiDISElement.qnameValueURI>;
2240 wakaba 1.9 $res = $self-><M::ManakaiDISDatabase.getResource>
2241     ($qn_uri, for_arg => $forArg);
2242 wakaba 1.5 if ($res-><M::ManakaiDISForDefinition.isDefined>) {
2243     __UNDEEP{
2244     __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR::
2245 wakaba 1.9 DIS:uri => {$res->{uri}},
2246 wakaba 1.5 DIS:sourceNode => {$qn_node},
2247     DIS:anotherSourceNode => {$res->{src}},
2248     }__;
2249 wakaba 1.6 }__;
2250 wakaba 1.5 }
2251     $res->{nameURI} = $qn_uri;
2252     $res->{localName} = $qn_node-><AG::ManakaiDISElement
2253     .qnameValueLocalName>;
2254     $res->{namespaceURI} = $qn_node-><AG::ManakaiDISElement
2255     .qnameValueNamespaceURI>;
2256     } else { ## Anonymous or local
2257     my $n_node = $el-><M::ManakaiDISElement.disGetAttribute>
2258     (<Q::dis:Name>, for_arg => $forArg,
2259     forp_arg => $forpArg);
2260     if ($n_node) {
2261     if ($parentResource) {
2262     my $puri = $parentResource->{uri};
2263     my $ru;
2264     my $ln = $res->{localName};
2265     __CODE{getChildResourceURI:: $parentURI => $puri,
2266     $localName => $ln,
2267     $result => $ru}__;
2268 wakaba 1.9 $res = $self-><M::ManakaiDISDatabase.getResource>
2269     ($ru, for_arg => $forArg);
2270 wakaba 1.5 $res->{nameURI} = $ru;
2271 wakaba 1.6 $res->{localName} = $n_node-><AG::swcfg21:SWCFGNode
2272     ::swcfg21:ForLatest.value>;
2273 wakaba 1.5 $res->{<Q::isAnon>} = true;
2274 wakaba 1.6 $res->{aliasURI}->{$node_uri} = true;
2275     $self->{resDef}->{$node_uri} = $res;
2276 wakaba 1.5 } else { ## Root local name resource
2277 wakaba 1.7 my $ln = $n_node-><AG::swcfg21:SWCFGNode
2278     ::swcfg21:ForLatest.value>;
2279     my $ns_uri = $mod-><M::ManakaiDISPropertyAccessor
2280     .getPropertyText>
2281     (<Q::dis:Namespace>, null);
2282     my $qn_uri = $ns_uri . $ln;
2283 wakaba 1.9 $res = $self-><M::ManakaiDISDatabase.getResource>
2284     ($qn_uri, for_arg => $forArg);
2285 wakaba 1.6 if ($res-><M::ManakaiDISForDefinition.isDefined>) {
2286     __UNDEEP{
2287     __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR::
2288 wakaba 1.9 DIS:uri => {$res->{uri}},
2289 wakaba 1.6 DIS:sourceNode => {$n_node},
2290     DIS:anotherSourceNode => {$res->{src}},
2291     }__;
2292     }__;
2293     }
2294     $res->{nameURI} = $qn_uri;
2295 wakaba 1.7 $res->{namespaceURI} = $ns_uri;
2296     $res->{localName} = $ln;
2297 wakaba 1.5 }
2298     } else {
2299 wakaba 1.6 $res = $self-><M::ManakaiDISDatabase.getResource> ($node_uri);
2300 wakaba 1.5 $res->{<Q::isAnon>} = true;
2301     }
2302 wakaba 1.6 } # anon
2303 wakaba 1.5 $res->{for} = $forArg;
2304     $res->{forp} = $forpArg;
2305     $res->{src} = $el;
2306     $res->{<Q::definingModule>} = $mod->{uri};
2307 wakaba 1.9 $mod-><M::ManakaiDISPropertyAccessor.addPropertyResourceList>
2308     (<Q::DIS:resource>, $res);
2309 wakaba 1.8 $res->{<Q::dis2pm:parentResource>}
2310     = $parentResource ? $parentResource->{uri} : null;
2311     $res->{<Q::dynamicParentResource>}
2312 wakaba 1.9 = $dynParent ? $dynParent->{uri} : null;
2313     unless ($res->{uri} eq $node_uri) {
2314     my $nu_res = $self-><M::ManakaiDISDatabase.getResource> ($node_uri);
2315     $res-><M::ManakaiDISResourceDefinition.mergeAsAlias> ($nu_res);
2316     }
2317 wakaba 1.7 $res->{<Q::isDefined>} = true;
2318 wakaba 1.9 $res->{seq} = $self->{seq}++;
2319    
2320 wakaba 1.6 ## -- Alias
2321     my $al_node = $el-><M::ManakaiDISElement.disGetAttribute>
2322     (<Q::dis:AliasFor>, for_arg => $forArg,
2323     forp_arg => $forpArg);
2324     if ($al_node) {
2325     my $canon_uri = $al_node-><M::ManakaiDISElement.tfqnamesValueURI>
2326     ($node_id, $forArg);
2327     my $canon_res = $self-><M::ManakaiDISDatabase.getResource>
2328     ($canon_uri);
2329     $canon_res-><M::ManakaiDISResourceDefinition.isReferred> ($al_node);
2330     $canon_res-><M::ManakaiDISResourceDefinition.mergeAsAlias> ($res);
2331     $res = $canon_res;
2332     }
2333 wakaba 1.5
2334 wakaba 1.7 my $is_multires = false;
2335     my @props;
2336     my @cres;
2337     my @ce0 = @{$el-><M::ManakaiDISElement.disChildElements>};
2338     while (@ce0) {
2339     my $ce = shift @ce0;
2340     if ($ce-><M::ManakaiDISElement.elementTypeMatch> (<Q::rdf:type>)) {
2341     my $type_uri = $ce-><AG::ManakaiDISElement.qnameValueURI>;
2342     $res->{<Q::rdf:type>}->{$type_uri} = true;
2343     my $type = $self-><M::ManakaiDISDatabase.getResource> ($type_uri);
2344     $type-><M::ManakaiDISResourceDefinition.isReferred> ($ce);
2345     if ($type-><M::ManakaiDISResourceDefinition.isSubsetOfURI>
2346     (<Q::dis:MultipleResource>)) {
2347     $is_multires = true;
2348     }
2349     } elsif ($ce-><M::ManakaiDISElement.elementTypeMatch>
2350     (<Q::dis:subsetOf>)) {
2351     my $sres = $self-><M::ManakaiDISDatabase.getResource>
2352     ($ce-><M::ManakaiDISElement.tfqnamesValueURI>
2353     ($node_id, $forArg));
2354     $res-><M::ManakaiDISResourceDefinition.addSuperResource> ($sres);
2355     } elsif ($ce-><M::ManakaiDISElement.isResourceElement>) {
2356     push @cres, $ce;
2357     } else {
2358     ## Property and invalid element is not checked, since not
2359     ## all property definitions has loaded at this stage.
2360     push @props, $ce;
2361     }
2362     } # @ce0
2363    
2364     ## -- Child resources
2365     unless ($is_multires) {
2366     for my $re (@cres) {
2367     unless ($al_node) {
2368     $self-><M::ManakaiDISDatabase.loadResource>
2369     ($mod, $res, $res, $re,
2370     for_arg => $forArg, forp_arg => $forpArg);
2371 wakaba 1.5 } else {
2372 wakaba 1.7 my $ac = $re-><M::ManakaiDISElement.disGetAttribute>
2373     (<Q::dis:aliasChild>, for_arg => $forArg,
2374     forp_arg => $forpArg);
2375     if ($ac and $ac-><M::swcfg21:SWCFGNode
2376     ::swcfg21:ForLatest.value>) {
2377     $self-><M::ManakaiDISDatabase.loadResource>
2378     ($mod, $res, $res, $re,
2379     for_arg => $forArg, forp_arg => $forpArg);
2380     }
2381 wakaba 1.4 }
2382     }
2383 wakaba 1.7 }
2384 wakaba 1.5
2385 wakaba 1.7 ## -- Multiple representations
2386     if ($is_multires) {
2387     for my $pe (@props) {
2388     if ($pe-><M::ManakaiDISElement.elementTypeMatch>
2389     (<Q::dis:ResourceFor>)) {
2390     my $for_uri = $pe-><M::ManakaiDISElement.qnameValueURI>;
2391     my $for = $self-><M::ManakaiDISDatabase.getFor> ($for_uri);
2392     $for-><M::ManakaiDISForDefinition.isReferred> ($pe);
2393     $self-><M::ManakaiDISDatabase.loadResource>
2394     ($mod, $parentResource, $res, $el,
2395     for_arg => $forArg,
2396     forp_arg => [@{$forpArg}, $for_uri]);
2397     }
2398     }
2399     }
2400 wakaba 1.5 }__; # DEEP
2401 wakaba 1.8
2402     @Method:
2403     @@Name: checkUndefinedResource
2404     @@enDesc:
2405     Checks whether there is referred but undefined resource or not.
2406     @@Return:
2407     @@@RaiseException:
2408     @@@@@: FOR_NOT_DEFINED_ERR
2409     @@@@enDesc:
2410     There is a <QUOTE::for> that is referred but not defined.
2411     @@@RaiseException:
2412     @@@@@: RESOURCE_NOT_DEFINED_ERR
2413     @@@@enDesc:
2414     There is a resource that is referred but not defined.
2415     @@@PerlDef:
2416     for my $fd (values %{$self->{forDef}}) {
2417     if (my $ref = $fd-><AG::ManakaiDISForDefinition.isReferred> and
2418     not $fd-><AG::ManakaiDISForDefinition.isDefined>) {
2419     __EXCEPTION{FOR_NOT_DEFINED_ERR::
2420     DIS:uri => {$fd->{uri}},
2421     DIS:sourceNode => {$ref},
2422     }__;
2423     }
2424     }
2425     for my $fd (values %{$self->{resDef}}) {
2426     if (my $ref = $fd-><AG::ManakaiDISResourceDefinition.isReferred> and
2427     not $fd-><AG::ManakaiDISResourceDefinition.isDefined>) {
2428     __EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
2429     DIS:uri => {$fd->{uri}},
2430     DIS:sourceNode => {$ref},
2431     }__;
2432     }
2433     }
2434 wakaba 1.5
2435 wakaba 1.9
2436     @Method:
2437     @@Name: plStore
2438     @@enDesc:
2439     Saves this database to an external file.
2440     \
2441     {NOTE:: Saved files can be loaded by
2442     <M::ManakaiDISImplementation.plLoadDISDatabase>.
2443     \
2444     }
2445     @@Param:
2446     @@@Name: fileName
2447     @@@Type:
2448     DISLang:String
2449     @@@enDesc:
2450     An environment-dependent file name of external database to save.
2451     \
2452     {NOTE:: If there is already a file named as <P::fileName>, then
2453     it is overwritten.
2454     \
2455     }
2456     @@Return:
2457     @@@SimpleException:
2458     @@@PerlDef:
2459     use Storable qw/nstore/;
2460     local $Carp::CarpLevel = $Carp::CarpLevel + 1;
2461     nstore $self, $fileName;
2462 wakaba 1.2 ##DISDatabase
2463    
2464 wakaba 1.8 PropDef:
2465 wakaba 1.9 @QName: resource
2466     @enDesc:
2467     Resources defined in a module.
2468     @rdfs:range: ManakaiDISResourceDefinition
2469     @rdfs:domain: ManakaiDISModuleDefinition
2470    
2471     PropDef:
2472 wakaba 1.8 @QName:
2473     dis2pm:parentResource
2474     @enDesc:
2475     Static parent resource. No parent for root resources.
2476    
2477     PropDef:
2478     @QName: dynamicParentResource
2479     @enDesc:
2480     Dynamic parent resource. No parent for root resources.
2481    
2482 wakaba 1.5 ElementTypeBinding:
2483     @Name: ForDefDupException
2484     @ElementType:
2485     ManakaiDOM:raises
2486     @ShadowContent:
2487     @@@: FOR_ALREADY_DEFINED_ERR
2488     @@Description:
2489     @@@lang:en
2490     @@@@:
2491     The <QUOTE::for> is already defined elsewhere.
2492    
2493     ElementTypeBinding:
2494     @Name: ForDefNoQNameException
2495     @ElementType:
2496     ManakaiDOM:raises
2497     @ShadowContent:
2498     @@@: NO_FOR_QNAME_ERR
2499     @@Description:
2500     @@@lang:en
2501     @@@@:
2502     A <Q::dis:ForDef> element must have a <Q::dis:QName> attribute.
2503    
2504     ElementTypeBinding:
2505     @Name: ResDefDupException
2506     @ElementType:
2507     ManakaiDOM:raises
2508     @ShadowContent:
2509     @@@: RESOURCE_ALREADY_DEFINED_ERR
2510     @@Description:
2511     @@@lang:en
2512     @@@@:
2513     The <QUOTE::dis> resource is already defined elsewhere.
2514    
2515     ElementTypeBinding:
2516     @Name: ElementNotAllowedException
2517     @ElementType:
2518     ManakaiDOM:raises
2519     @ShadowContent:
2520     @@@: ELEMENT_NOT_ALLOWED_ERR
2521     @@Description:
2522     @@@lang:en
2523     @@@@:
2524     An element has found where it is not allowed.
2525    
2526 wakaba 1.4 IFClsDef:
2527     @QName:
2528     @@@: DISModuleResolver
2529     @@ForCheck: ForIF
2530     @QName:
2531     @@@: ManakaiDISModuleResolver
2532     @@ForCheck: ForClass
2533     @enDesc:
2534     Objects implementing <IF::DISModuleResolver> interface
2535     are used to convert module name into <QUOTE::dis> document object.
2536     \
2537     {NOTE:: It is also acceptable to pass a <Perl::CODE> reference
2538     as a method parameter where <IF::DISModuleResolver> is
2539     expected.
2540     \
2541     }
2542     @Method:
2543     @@Name: uriToDocument
2544     @@enDesc:
2545     Returns a <QUOTE::dis> document from module name information.
2546     @@Param:
2547     @@@Name: disDB
2548     @@@Type: ManakaiDISDatabase
2549     @@@enDesc:
2550     The <QUOTE::dis> database.
2551     @@Param:
2552     @@@Name: moduleURI
2553     @@@Type: ModuleURI
2554     @@@enDesc:
2555     The URI reference of the module.
2556     \
2557     {NOTE:: This parameter is redundant, since it can be
2558     composed from other three parameters.
2559     \
2560     }
2561     @@Param:
2562     @@@Name: moduleNamespaceURI
2563     @@@Type: AnyURI
2564     @@@enDesc:
2565     The namespace URI of the module name.
2566     @@Param:
2567     @@@Name: moduleLocalName
2568     @@@Type:
2569     DISCore:LocalName
2570     @@@enDesc:
2571     The local name of the module name.
2572     @@Param:
2573     @@@Name: moduleFor
2574     @@@Type: ForURI
2575     @@@enDesc:
2576     The <QUOTE::for> URI reference for which the module is defined.
2577     @@Return:
2578     @@@Type: ManakaiDISDocument
2579     @@@enDesc:
2580     The <QUOTE::dis> document. It don't have to be a newly created
2581     object.
2582     @@@nullCase:
2583     @@@@enDesc:
2584     The method is unable to resolve the reference.
2585     @@@PerlDef:
2586     $r = $self->(@_);
2587     @ManakaiDOM:inputNormalizer:
2588     @@ContentType:
2589     lang:Perl
2590     @@@:
2591     $INPUT = bless $INPUT, <ClassName::ManakaiDISModuleResolver>
2592     if ref $INPUT eq 'CODE';
2593     @@ImplNote:
2594     @@@lang:en
2595     @@@@:
2596     <FILE::cdis2pm.pl> does not support non-datatype input normalizers yet.
2597     ##DISModuleResolver
2598    
2599 wakaba 1.3 PropDef:
2600     @QName: sourceFile
2601     @enDesc:
2602     Source <QUOTE::dis> documents.
2603     @rdfs:domain: ManakaiDISDatabase
2604     @rdfs:range: ManakaiDISDocument
2605    
2606 wakaba 1.2 ClsDef:
2607     @ClsQName: ManakaiDISModuleDefinition
2608     @enDesc:
2609     <QUOTE::dis> module definitions.
2610     @ClsISA: ManakaiDISPropertyAccessor
2611 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
2612 wakaba 1.2
2613     @Attr:
2614     @@Name: uri
2615     @@Type: ModuleURI
2616     @@Description:
2617     @@@lang:en
2618     @@@@:
2619     The URI reference of this <QUOTE::dis> module.
2620     @@Get:
2621     @@@PerlDef:
2622     $r = $self->{uri};
2623    
2624     @Attr:
2625     @@Name: nameURI
2626     @@Type: NameURI
2627     @@enDesc:
2628     The URI reference of this module, without
2629     <QUOTE::for> identifier.
2630     @@Get:
2631 wakaba 1.3 @@@PerlDef:
2632 wakaba 1.4 $r = $self->{nameURI};
2633 wakaba 1.2
2634     @Attr:
2635     @@Name: localName
2636     @@enDesc:
2637     The local name of this module.
2638     @@Type:
2639 wakaba 1.3 DISCore:LocalName::ManakaiDOM:all
2640 wakaba 1.2 @@Get:
2641     @@@PerlDef:
2642     $r = $self->{localName};
2643    
2644     @Attr:
2645     @@Name: namespaceURI
2646     @@Type: AnyURI
2647     @@enDesc:
2648     The namespace URI of the name of this resource.
2649     @@Get:
2650     @@@PerlDef:
2651     $r = $self->{namespaceURI};
2652    
2653     @Attr:
2654     @@Name: forURI
2655     @@Type: ForURI
2656     @@enDesc:
2657     The <QUOTE::for> URI reference for which this module is defined.
2658     @@Get:
2659     @@@PerlDef:
2660     $r = $self->{for};
2661    
2662     @Attr:
2663     @@Name: isDefined
2664     @@Description:
2665     @@@lang:en
2666     @@@@:
2667     Whether this module is defined or not.
2668     @@Type:
2669     DOMMain:boolean
2670     @@Get:
2671     @@@PerlDef:
2672     $r = $self->{<Q::isDefined>};
2673 wakaba 1.8
2674     @Attr:
2675     @@Name: plFullyQualifiedName
2676     @@enDesc:
2677     The fully-qualified Perl class package name.
2678     @@Type:
2679     Perl:package-name::ManakaiDOM:all
2680     @@Get:
2681     @@@NoPerlModuleNameException:
2682     @@@PerlDef:
2683     __DEEP{
2684     my $mg = $self->{db}-><M::ManakaiDISDatabase.getResource>
2685     ($self->{namespaceURI});
2686     unless ($self-><AG::ManakaiDISResourceDefinition.isDefined>) {
2687     __UNDEEP{
2688     __EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
2689     DIS:uri => {$self->{namespaceURI}},
2690     DIS:sourceNode => {$self->{src}},
2691     }__;
2692     }__;
2693     }
2694     my $an = $mg->{src}-><M::ManakaiDISElement.disGetAttribute>
2695     (<Q::dis:AppName>, for_arg => $self->{for},
2696     media_type => <Q::lang:Perl>);
2697     if ($an) {
2698     $r = $an-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2699     $r =~ s/::$//g;
2700     $r .= '::' . $self->{localName};
2701     my $sf = $an-><M::ManakaiDISElement.disGetAttribute>
2702     (<Q::ManakaiDOM:moduleSuffix>,
2703     for_arg => $self->{for},
2704     media_type => <Q::lang:Perl>,
2705     default_media_type => <Q::lang:Perl>);
2706     if ($sf) {
2707     $r .= $sf-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2708     }
2709     } else {
2710     $r = $mg->{localName} . '::' . $self->{localName};
2711     }
2712     }__;
2713    
2714     @Attr:
2715     @@Name: plInterfaceName
2716     @@enDesc:
2717     The fully-qualified Perl interface package name.
2718     @@Type:
2719     Perl:package-name::ManakaiDOM:all
2720     @@Get:
2721     @@@NoPerlModuleNameException:
2722     @@@PerlDef:
2723     __DEEP{
2724     my $mg = $self->{db}-><M::ManakaiDISDatabase.getResource>
2725     ($self->{namespaceURI});
2726     unless ($self-><AG::ManakaiDISResourceDefinition.isDefined>) {
2727     __UNDEEP{
2728     __EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
2729     DIS:uri => {$self->{namespaceURI}},
2730     DIS:sourceNode => {$self->{src}},
2731     }__;
2732     }__;
2733     }
2734     my $an = $mg->{src}-><M::ManakaiDISElement.disGetAttribute>
2735     (<Q::dis:AppName>, for_arg => $self->{for},
2736     forp_arg => [<Q::ManakaiDOM:ForIF>],
2737     media_type => <Q::lang:Perl>);
2738     if ($an) {
2739     $r = $an-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2740     $r =~ s/::$//g;
2741     $r .= '::' . $self->{localName};
2742     my $sf = $an-><M::ManakaiDISElement.disGetAttribute>
2743     (<Q::ManakaiDOM:moduleSuffix>,
2744     for_arg => $self->{for},
2745     forp_arg => [<Q::ManakaiDOM:ForIF>],
2746     media_type => <Q::lang:Perl>,
2747     default_media_type => <Q::lang:Perl>);
2748     if ($sf) {
2749     $r .= $sf-><M::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
2750     }
2751     } else {
2752     $r = $self-><M::ManakaiDISModuleDefinition.plFullyQualifiedName>;
2753     }
2754     }__;
2755 wakaba 1.2 ##DISModuleDefinition
2756    
2757 wakaba 1.8 ElementTypeBinding:
2758     @Name: NoPerlModuleNameException
2759     @ElementType:
2760     ManakaiDOM:raises
2761     @ShadowContent:
2762     @@@: RESOURCE_NOT_DEFINED_ERR
2763     @@Description:
2764     @@@lang:en
2765     @@@@:
2766     The module group corresponding to the namespace URI
2767     of this module is not defined.
2768    
2769 wakaba 1.2 ClsDef:
2770     @ClsQName: ManakaiDISForDefinition
2771     @Description:
2772     @@lang:en
2773     @@@:
2774     <QUOTE::dis> <QUOTE::for> definitions.
2775 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
2776 wakaba 1.2
2777     @Attr:
2778     @@Name: uri
2779     @@Type: ForURI
2780     @@Description:
2781     @@@lang:en
2782     @@@@:
2783     The URI reference of this <QUOTE::for>.
2784     @@Get:
2785     @@@PerlDef:
2786     $r = $self->{uri};
2787    
2788     @Method:
2789     @@Name: isaURI
2790     @@Description:
2791     @@@lang:en
2792     @@@@:
2793     Whether this <QUOTE::for> is-a another <QUOTE::for> or not.
2794     @@Param:
2795     @@@Name: superURI
2796     @@@Type: ForURI
2797     @@@Description:
2798     @@@@lang:en
2799     @@@@@:
2800     Another <QUOTE::for> URI reference to test.
2801     @@Return:
2802     @@@Type:
2803     DOMMain:boolean
2804     @@@TrueCase:
2805     @@@@enDesc:
2806     <P::superURI> is a super-<QUOTE::for> of this <QUOTE::for>.
2807     @@@FalseCase:
2808     @@@@enDesc:
2809     <P::superURI> is not a super-<QUOTE::for> of this <QUOTE::for>.
2810     @@@PerlDef:
2811     $r = $self->{uri} eq $superURI ? true : $self->{isa}->{$superURI};
2812    
2813     @Attr:
2814     @@Name: isDefined
2815     @@Description:
2816     @@@lang:en
2817     @@@@:
2818     Whether this <QUOTE::for> is already defined or not.
2819     @@Type:
2820     DOMMain:boolean
2821     @@Get:
2822     @@@TrueCase:
2823     This <QUOTE::for> is already defined.
2824     @@@FalseCase:
2825     This <QUOTE::for> is not defined.
2826     @@@PerlDef:
2827     $r = $self->{<Q::isDefined>};
2828    
2829     @Attr:
2830     @@Name: isReferred
2831     @@Description:
2832     @@@lang:en
2833     @@@@:
2834     Whether this <QUOTE::for> is referred somewhere or not.
2835 wakaba 1.9 @@Type: ManakaiDISElement
2836 wakaba 1.2 @@Get:
2837     @@@InCase:
2838     @@@@Type:ManakaiDISElement
2839     @@@@enDesc:
2840     This <QUOTE::for> is referred by the element.
2841     @@@nullCase:
2842     This <QUOTE::for> is not referred.
2843     @@@PerlDef:
2844     $r = $self->{<Q::isReferred>};
2845     @@Set:
2846     @@@InCase:
2847     @@@@Type:ManakaiDISElement
2848     @@@@enDesc:
2849     This <QUOTE::for> is referred by the element.
2850     @@@PerlDef:
2851 wakaba 1.9 $self->{<Q::isReferred>} = $given if $given;
2852 wakaba 1.2
2853     @Attr:
2854     @@Name: definingModule
2855     @@Description:
2856     @@@lang:en
2857     @@@@:
2858     The <QUOTE::dis> module in which this <QUOTE::for> is defined.
2859     @@Type: ManakaiDISModuleDefinition
2860     @@Get:
2861     @@@Description:
2862     @@@@lang:en
2863     @@@@@:
2864     The module object.
2865 wakaba 1.3 @@@nullCase:
2866 wakaba 1.2 @@@@Description:
2867     @@@@@lang:en
2868     @@@@@@:
2869     This <QUOTE::for> is not associated to any module.
2870     @@@PerlDef:
2871     $r = $self->{db}
2872     -><M::ManakaiDISDatabase.getResource>
2873     ($self->{<Q::definingModule>})
2874     if defined $self->{<Q::definingModule>};
2875 wakaba 1.5
2876 wakaba 1.2 @Method:
2877 wakaba 1.5 @@Name: addISA
2878 wakaba 1.2 @@enDesc:
2879 wakaba 1.5 Adds a <QUOTE::for> to the list of super-<QUOTE::for> of this
2880     <QUOTE::for>.
2881 wakaba 1.2 @@Param:
2882 wakaba 1.5 @@@Name: superFor
2883     @@@Type: ManakaiDISForDefinition
2884     @@@enDesc:
2885     A <QUOTE::for> definition object.
2886 wakaba 1.2 @@Return:
2887     @@@PerlDef:
2888 wakaba 1.5 my @from = ($self->{uri},
2889     grep {$self->{revISA}->{$_}} keys %{$self->{revISA}});
2890     my @to = ($superFor->{uri},
2891     grep {$superFor->{isa}->{$_}} keys %{$superFor->{isa}});
2892 wakaba 1.7 __DEEP{
2893     for my $from (@from) {
2894     for my $to (@to) {
2895     $self->{db}-><M::ManakaiDISDatabase.getFor>
2896     ($from)->{isa}->{$to} = true;
2897     $self->{db}-><M::ManakaiDISDatabase.getFor>
2898     ($to)->{revISA}->{$from} = true;
2899     }
2900 wakaba 1.5 }
2901 wakaba 1.7 }__;
2902 wakaba 1.5
2903 wakaba 1.2 ##DISForDefinition
2904    
2905     ClsDef:
2906     @ClsQName: ManakaiDISResourceDefinition
2907     @enDesc:
2908     <QUOTE::dis> resource definitions.
2909     @ClsISA: ManakaiDISPropertyAccessor
2910 wakaba 1.4 @ClsISA: ManakaiDISExceptionTarget
2911 wakaba 1.2
2912     @Attr:
2913     @@Name: uri
2914     @@Type: ResourceURI
2915     @@Description:
2916     @@@lang:en
2917     @@@@:
2918     The URI reference of this <QUOTE::dis> resource.
2919     @@Get:
2920     @@@PerlDef:
2921     $r = $self->{uri};
2922    
2923     @Attr:
2924     @@Name: nameURI
2925     @@Type: NameURI
2926     @@enDesc:
2927     The URI reference of this <QUOTE::dis> resource, without
2928     <QUOTE::for> identifier.
2929     @@Get:
2930     @@@nullCase:
2931     @@@@enDesc:
2932     This resource does not have its name URI reference.
2933 wakaba 1.3 @@@PerlDef:
2934 wakaba 1.4 $r = $self->{nameURI};
2935 wakaba 1.2
2936     @Attr:
2937     @@Name: localName
2938     @@enDesc:
2939     The local name of this resource.
2940     @@Type:
2941 wakaba 1.3 DISCore:LocalName::ManakaiDOM:all
2942 wakaba 1.2 @@Get:
2943     @@@nullCase:
2944     @@@@enDesc:
2945     This resource does not have its local name.
2946     @@@PerlDef:
2947     $r = $self->{localName};
2948    
2949     @Attr:
2950     @@Name: namespaceURI
2951     @@Type: AnyURI
2952     @@enDesc:
2953     The namespace URI of the name of this resource.
2954     @@Get:
2955     @@@nullCase:
2956     The name of this resource does not have its namespace
2957     or this resource does not have its name.
2958     @@@PerlDef:
2959     $r = $self->{namespaceURI};
2960    
2961     @Attr:
2962     @@Name: isAnonymous
2963     @@enDesc:
2964     Whether this <QUOTE::dis> resource has name or not.
2965     @@Type:
2966     DOMMain:boolean
2967     @@Get:
2968     @@@TrueCase:
2969     This resource does not have any global unique name.
2970     <A::ManakaiDISResourceDefinition.uri> is a temporary URI reference.
2971     @@@FalseCase:
2972     This resource does have its formal name.
2973     <A::ManakaiDISResourceDefinition.uri> is a URI reference
2974     generated from the name and the <QUOTE::for> URI reference
2975     of this resource.
2976     @@@PerlDef:
2977     $r = $self->{<Q::isAnon>};
2978    
2979     @Attr:
2980     @@Name: forURI
2981     @@enDesc:
2982     The <QUOTE::for> URI reference for which this resource is defined.
2983     @@Type:ForURI
2984     @@Get:
2985     @@@PerlDef:
2986     $r = $self->{for};
2987    
2988     @Attr:
2989     @@Name: forpURI
2990     @@enDesc:
2991     The <QUOTE::for+> URI references for which this resource is defined.
2992     @@Type: ForURIList
2993     @@Get:
2994 wakaba 1.3 @@@PerlDef:
2995 wakaba 1.2 $r = $self->{forp};
2996    
2997     @Method:
2998 wakaba 1.7 @@Name: isSubsetOfURI
2999 wakaba 1.2 @@Description:
3000     @@@lang:en
3001     @@@@:
3002     Whether this resource is a subset of another resource or not.
3003     @@Param:
3004     @@@Name: superURI
3005     @@@Type: ResourceURI
3006     @@@Description:
3007     @@@@lang:en
3008     @@@@@:
3009     Another resource URI reference to test.
3010     @@Return:
3011     @@@Type:
3012     DOMMain:boolean
3013     @@@TrueCase:
3014     @@@@enDesc:
3015     <P::superURI> is a super-resource of this resource.
3016     @@@FalseCase:
3017     @@@@enDesc:
3018     <P::superURI> is not a super-resource of this resource.
3019     @@@PerlDef:
3020 wakaba 1.6 $r = $self->{aliasURI}->{$superURI} || $self->{subOf}->{$superURI};
3021 wakaba 1.2
3022 wakaba 1.7 @Method:
3023     @@Name: addSuperResource
3024     @@enDesc:
3025     Adds a <QUOTE::dis> resource to the list of super-resource
3026     of this <QUOTE::dis> resource.
3027     @@Param:
3028     @@@Name: superRes
3029     @@@Type: ManakaiDISResourceDefinition
3030     @@@enDesc:
3031     A <QUOTE::dis> resource definition object.
3032     @@Return:
3033     @@@PerlDef:
3034     my @from = ($self->{uri},
3035     grep {$self->{supOf}->{$_}} keys %{$self->{supOf}});
3036     my @to = ($superRes->{uri},
3037     grep {$superRes->{subOf}->{$_}} keys %{$superRes->{subOf}});
3038     __DEEP{
3039     for my $from (@from) {
3040     for my $to (@to) {
3041     $self->{db}-><M::ManakaiDISDatabase.getResource>
3042     ($from)->{subOf}->{$to} = true;
3043     $self->{db}-><M::ManakaiDISDatabase.getResource>
3044     ($to)->{supOf}->{$from} = true;
3045     }
3046     }
3047     }__;
3048    
3049 wakaba 1.2 @Attr:
3050     @@Name: isDefined
3051     @@Description:
3052     @@@lang:en
3053     @@@@:
3054     Whether this resource is already defined or not.
3055     @@Type:
3056     DOMMain:boolean
3057     @@Get:
3058     @@@TrueCase:
3059     This resource is already defined.
3060     @@@FalseCase:
3061     This resource is not defined.
3062     @@@PerlDef:
3063     $r = $self->{<Q::isDefined>};
3064    
3065     @Attr:
3066     @@Name: isReferred
3067     @@Description:
3068     @@@lang:en
3069     @@@@:
3070     Whether this resource is referred or not.
3071 wakaba 1.7 @@Type: ManakaiDISElement
3072 wakaba 1.2 @@Get:
3073 wakaba 1.7 @@@enDesc:
3074 wakaba 1.9 An element that referres this resource.
3075 wakaba 1.2 @@@nullCase:
3076     This resource is not referred.
3077     @@@PerlDef:
3078     $r = $self->{<Q::isReferred>};
3079     @@Set:
3080 wakaba 1.7 @@@enDesc:
3081 wakaba 1.9 An element that referres this resource.
3082 wakaba 1.2 @@@PerlDef:
3083 wakaba 1.9 $self->{<Q::isReferred>} = $given if $given;
3084 wakaba 1.2
3085     @Attr:
3086     @@Name: definingModule
3087     @@Description:
3088     @@@lang:en
3089     @@@@:
3090     The <QUOTE::dis> module in which this resource is defined.
3091 wakaba 1.8 \
3092     {NOTE:: Method name should have been <CODE::ownerModule> or some.
3093     \
3094     }
3095 wakaba 1.2 @@Type: ManakaiDISModuleDefinition
3096     @@Get:
3097     @@@Description:
3098     @@@@lang:en
3099     @@@@@:
3100     The module object.
3101 wakaba 1.3 @@@nullCase:
3102 wakaba 1.2 @@@@Description:
3103     @@@@@lang:en
3104     @@@@@@:
3105     This resource is not associated to any module.
3106     @@@PerlDef:
3107     $r = $self->{db}
3108     -><M::ManakaiDISDatabase.getModule>
3109     ($self->{<Q::definingModule>})
3110     if defined $self->{<Q::definingModule>};
3111     @@Set:
3112     @@@Description:
3113     @@@@lang:en
3114     @@@@@:
3115     The module object to which the <QUOTE::defining module> is set.
3116     @@@PerlDef:
3117     $self->{<Q::defininingModule>}
3118     = $given-><AG::ManakaiDISModuleDefinition.uri>;
3119    
3120 wakaba 1.6 @Method:
3121     @@Name: mergeAsAlias
3122     @@enDesc:
3123     Merges another resource definition as an alias of this resource.
3124     @@Param:
3125     @@@Name: aliasResource
3126     @@@Type: ManakaiDISResourceDefinition
3127     @@@enDesc:
3128     A resource to merge.
3129     \
3130     {NOTE:: After merging all references to <P::aliasResource>
3131     should be discarded.
3132     \
3133     }
3134     @@Return:
3135     @@@PerlDef:
3136     for my $uri ($aliasResource->{uri},
3137     grep {$aliasResource->{aliasURI}->{$_}}
3138     keys %{$aliasResource->{aliasURI}}) {
3139     $self->{aliasURI}->{$uri} = true;
3140     $self->{db}->{resDef}->{$uri} = $self;
3141     $self->{subOf}->{$uri} = true;
3142     $self->{supOf}->{$uri} = true;
3143     }
3144     for my $uri (grep {$aliasResource->{subOf}->{$_}}
3145     keys %{$aliasResource->{subOf}}) {
3146     $self->{subOf}->{$uri} = true;
3147     }
3148     for my $uri (grep {$aliasResource->{supOf}->{$_}}
3149     keys %{$aliasResource->{supOf}}) {
3150     $self->{supOf}->{$uri} = true;
3151     }
3152     my @from = grep {$self->{supOf}->{$_}} keys %{$self->{supOf}};
3153     my @to = grep {$self->{subOf}->{$_}} keys %{$self->{subOf}};
3154     __DEEP{
3155     for my $from (@from) {
3156     for my $to (@to) {
3157     $self->{db}-><M::ManakaiDISDatabase.getResource>
3158     ($from)->{subOf}->{$to} = true;
3159     $self->{db}-><M::ManakaiDISDatabase.getResource>
3160     ($to)->{supOf}->{$from} = true;
3161     }
3162     }
3163     }__;
3164 wakaba 1.7
3165     @Method:
3166     @@Name: isTypeURI
3167     @@enDesc:
3168     Tests whether this resource is of a type or not.
3169     @@Param:
3170     @@@Name: typeURI
3171     @@@Type: ResourceURI
3172     @@@enDesc:
3173     A type URI reference to test.
3174     @@Return:
3175     @@@Type:
3176     DOMMain:boolean
3177     @@@TrueCase:
3178     @@@@enDesc:
3179     This is a <P::typeURI> resource.
3180     @@@FalseCase:
3181     @@@@enDesc:
3182     This is not a <P::typeURI> resource.
3183     @@@PerlDef:
3184 wakaba 1.8 if ($self->{<Q::rdf:type>}->{$typeURI}) {
3185     $r = $self->{<Q::rdf:type>}->{$typeURI};
3186     } else {
3187     for my $t_type_uri (grep {$self->{<Q::rdf:type>}->{$_}}
3188     keys %{$self->{<Q::rdf:type>}}) {
3189     my $t_type = $self->{db}-><M::ManakaiDISDatabase.getResource>
3190     ($t_type_uri);
3191     if ($t_type-><M::ManakaiDISResourceDefinition.isSubsetOfURI>
3192     ($typeURI)) {
3193     $self->{<Q::rdf:type>}->{$typeURI} = $r = true;
3194     last;
3195     }
3196 wakaba 1.7 }
3197     }
3198 wakaba 1.8
3199     @Attr:
3200     @@Name: plName
3201     @@enDesc:
3202     The Perl name of this resource.
3203     @@Get:
3204     @@@Type:
3205     DISLang:String
3206     @@@enDesc:
3207     - <Q::ManakaiDOM:Const>::: Constant function (local) name.
3208     \
3209     - <Q::ManakaiDOM:ConstGroup>::: Export group name (without
3210     <CHAR::COLON> prefix).
3211     \
3212     - <Q::DISLang:Attribute>::: Method name.
3213     \
3214     - <Q::DISLang:Method>::: Method name.
3215     @@@nullCase:
3216     @@@@enDesc:
3217     Either the type of this resource is not listed above
3218     or this Perl constructure is anonymous.
3219     @@@RaiseException:
3220     @@@@@: NO_LOCAL_NAME_ERR
3221     @@@@enDesc:
3222     The type of this resource is either
3223     <Q::ManakaiDOM:Const> or <Q::ManakaiDOM:ConstGroup> and
3224     the local name of this resource is not defined.
3225     @@@RaiseException:
3226     @@@@@: RESERVED_PERL_METHOD_NAME_ERR
3227     @@@@enDesc:
3228     The Perl method name constructed from the source
3229     result in a reserved name.
3230     @@@PerlDef:
3231     __DEEP{
3232     if (exists $self->{<Q::dis2pm:name>}) {
3233     $r = $self->{<Q::dis2pm:name>};
3234     } elsif ($self-><M::ManakaiDISResourceDefinition.isTypeURI>
3235     (<Q::ManakaiDOM:Const>) or
3236     $self-><M::ManakaiDISResourceDefinition.isTypeURI>
3237     (<Q::ManakaiDOM:ConstGroup>)) {
3238     $r = $self->{localName};
3239     unless (defined $r) {
3240     __UNDEEP{
3241     __EXCEPTION{NO_LOCAL_NAME_ERR::
3242     DIS:sourceNode => {$self->{src}},
3243     }__;
3244     }__;
3245     }
3246     } elsif ($self-><M::ManakaiDISResourceDefinition.isTypeURI>
3247     (<Q::DISLang:Method>) or
3248     $self-><M::ManakaiDISResourceDefinition.isTypeURI>
3249     (<Q::DISLang:Attribute>)) {
3250     if (defined $self->{localName}) {
3251     $r = <ClassM::ManakaiDISImplementation.camelCaseToUnderscoreName>
3252     ($self->{localName});
3253     if ($self-><M::ManakaiDISPropertyAccessor.getPropertyBoolean>
3254     (<Q::ManakaiDOM:isForInternal>, false)) {
3255     $r = '_' . $r;
3256     }
3257     if ({
3258     import => 1,
3259     unimport => 1,
3260     isa => 1,
3261     can => 1,
3262     new => 1,
3263     as_string => 1,
3264     stringify => 1,
3265     clone => 1,
3266     }->{$r} or $r =~ /^___/) {
3267     __UNDEEP{
3268     __EXCEPTION{RESERVED_PERL_METHOD_NAME_ERR::
3269     DIS:uri => {$self->{uri}},
3270     DIS:soruceNode => {$self->{src}},
3271     DIS:generatedName => {$r},
3272     }__;
3273     }__;
3274     } elsif (my $op_uri = $self-><AG::ManakaiDISResourceDefinition
3275     .plMethodOperator>) {
3276     $r = {
3277     <Q::ManakaiDOM:MUErrorHandler> => '___report_error',
3278     <Q::DISPerl:AsStringMethod> => 'as_string',
3279     <Q::DISPerl:AsNewMethod> => 'new',
3280     <Q::DISPerl:AsCloneMethod> => 'clone',
3281     }->{$op_uri};
3282     $r = $op_uri if $op_uri =~ /^[A-Z]+$/;
3283     }
3284     } else {
3285     $r = null;
3286     }
3287     } else {
3288     $r = null;
3289     }
3290     $self->{<Q::dis2pm:name>} = $r;
3291     }__;
3292    
3293     @Attr:
3294     @@Name: plFullyQualifiedName
3295     @@enDesc:
3296     The fully-qualified Perl name of this resource.
3297     @@Type:
3298     DISLang:String::ManakaiDOM:all
3299     @@Get:
3300     @@@enDesc:
3301     Fully-qualified name.
3302     \
3303     - <Q::ManakaiDOM:Class>::: Class package name.
3304     \
3305     - <Q::ManakaiDOM:IF>::: Interface package name.
3306     \
3307     - <Q::DISPerl:ScalarVariable>::: Variable name (without variable
3308     type symbol such as <CODE::$>).
3309     @@@nullCase:
3310     @@@@enDesc:
3311     Otherwise.
3312     @@@NoPerlModuleNameException:
3313     @@@RaiseException:
3314     @@@@@: NO_LOCAL_NAME_ERR
3315     @@@@enDesc:
3316     The local name of this resource is not defined.
3317     @@@PerlDef:
3318     __DEEP{
3319     if (exists $self->{<Q::dis2pm:name>}) {
3320     $r = $self->{<Q::dis2pm:name>};
3321     } elsif ($self-><M::ManakaiDISResourceDefinition.isTypeURI>
3322     (<Q::ManakaiDOM:Class>) or
3323     $self-><M::ManakaiDISResourceDefinition.isTypeURI>
3324     (<Q::ManakaiDOM:IF>) or
3325     $self-><M::ManakaiDISResourceDefinition.isTypeURI>
3326     (<Q::DISPerl:ScalarVariable>)) {
3327     my $an_node = $self->{src}-><AG::ManakaiDISElement.disGetAttribute>
3328     (<Q::dis:AppName>, for_arg => $self->{for},
3329     forp_arg => $self->{forp},
3330     media_type => <Q::lang:Perl>);
3331     if ($an_node) {
3332     ## NOTE: "lang:Perl" is fully-qualified name by definition
3333     $r = $an_node-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
3334     } else {
3335     if ($self-><M::ManakaiDISResourceDefinition.isTypeURI>
3336     (<Q::ManakaiDOM:IF>)) {
3337     $r = $self-><AG::ManakaiDISResourceDefinition.definingModule>
3338     -><M::ManakaiDISModuleDefinition.plInterfaceName>
3339     . '::' . $self->{localName};
3340     } else {
3341     $r = $self-><AG::ManakaiDISResourceDefinition.definingModule>
3342     -><M::ManakaiDISModuleDefinition.plFullyQualifiedName>
3343     . '::' . $self->{localName};
3344     }
3345     unless (defined $r) {
3346     __UNDEEP{
3347     __EXCEPTION{NO_LOCAL_NAME_ERR::
3348     DIS:sourceNode => {$self->{src}},
3349     }__;
3350     }__;
3351     }
3352     }
3353     } else {
3354     $r = null;
3355     }
3356     $self->{<Q::dis2pm:name>} = $r;
3357     }__;
3358    
3359     @Attr:
3360     @@Name: plMethodOperator
3361     @@enDesc:
3362     The operator to overload by this method.
3363     @@Type:
3364     DISLang:String::ManakaiDOM:all
3365     @@Get:
3366     @@@enDesc:
3367     The operator, either Perl <CODE::use operator> operator name
3368     of manakai operator URI reference.
3369     @@@nullCase:
3370     @@@@enDesc:
3371     Either this resource does not define a Perl method or
3372     this method does not overload any operator.
3373     @@@UndeclaredPrefixException:
3374     @@@RaiseException:
3375     @@@@@: UNSUPPORTED_MEDIA_TYPE_ERR
3376     @@@@enDesc:
3377     Media type of the <Q::dis:Operator> node is not supported.
3378     @@@PerlDef:
3379     __DEEP{
3380     if (exists $self->{<Q::dis:Operator>}) {
3381     $r = $self->{<Q::dis:Operator>};
3382     } else {
3383     my $op_node = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3384     (<Q::dis:Operator>, for_arg => $self->{for},
3385     forp_arg => $self->{forp});
3386     if ($op_node) {
3387     if ($op_node-><M::ManakaiDISElement.mediaTypeMatch>
3388     (<Q::lang:Perl>)) {
3389     $r = $op_node-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
3390     } elsif ($op_node-><M::ManakaiDISElement.mediaTypeMatch>
3391     (<Q::dis:TypeQName>)) {
3392     $r = $op_node-><AG::ManakaiDISElement.qnameValueURI>;
3393     } else {
3394     my $ct = $op_node-><M::ManakaiDISElement.disGetAttribute>
3395     (<Q::dis:ContentType>, for_arg => $self->{for},
3396     forp_arg => $self->{forp});
3397     my $ct_uri = $ct-><AG::ManakaiDISElement.qnameValueURI> if $ct;
3398     __UNDEEP{
3399     __EXCEPTION{UNSUPPORTED_MEDIA_TYPE_ERR::
3400     DIS:uri => {$ct_uri},
3401     DIS:sourceNode => {$ct || $self->{src}},
3402     }__;
3403     }__;
3404     }
3405     } else {
3406     $r = null;
3407     }
3408     $self->{<Q::dis:Operator>} = $r;
3409     }
3410     }__;
3411    
3412     @Attr:
3413     @@Name: disDataTypeResource
3414     @@enDesc:
3415     <Q::dis:Type> attribute value of this resource.
3416     @@Type: ManakaiDISResourceDefinition
3417     @@Get:
3418     @@@RaiseException:
3419     @@@@@:NO_DIS_TYPE_ERR
3420     @@@@enDesc:
3421     <Q::dis:Type> attribute is not specified.
3422     @@@PerlDef:
3423     __DEEP{
3424     if (defined $self->{<Q::dis:Type>}) {
3425     $r = $self->{<Q::dis:Type>};
3426     } else {
3427     $self->{<Q::dis2pm:TypeNode>}
3428     = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3429     (<Q::dis:Type>, for_arg => $self->{for},
3430     forp_arg => $self->{forp});
3431     if ($self->{<Q::dis2pm:TypeNode>}) {
3432     $r = $self->{<Q::dis:Type>}
3433     = $self->{<Q::dis2pm:TypeNode>}
3434     -><AG::ManakaiDISElement.qnameValueURI>;
3435     } else {
3436     my $pr = $self-><M::ManakaiDISPropertyAccessor
3437     .getPropertyResource>
3438     (<Q::DIS:dynamicParentResource>);
3439     if ($pr) {
3440     $r = $pr-><AG::ManakaiDISResourceDefinition
3441     .disDataTypeResource>;
3442     $self->{<Q::dis2pm:TypeNode>}
3443     = $pr->{<Q::dis2pm:TypeNode>};
3444     } else { ## No parent
3445     __UNDEEP{
3446     __EXCEPTION{NO_DIS_TYPE_ERR::
3447     DIS:sourceNode => {$self->{src}},
3448     }__;
3449     }__;
3450     }
3451     }
3452     }
3453     }__;
3454    
3455     @Attr:
3456     @@Name: disDataTypeNode
3457     @@enDesc:
3458     <Q::dis:Type> node for this resource.
3459     @@Get:
3460     @@@Type: ManakaiDISElement
3461     @@@RaiseException:
3462     @@@@@:NO_DIS_TYPE_ERR
3463     @@@@enDesc:
3464     <Q::dis:Type> attribute is not specified.
3465     @@@PerlDef:
3466     __DEEP{
3467     $self-><AG::ManakaiDISResourceDefinition.disDataTypeNode>;
3468     }__;
3469     $r = $self->{<Q::dis2pm:TypeNode>};
3470    
3471     @Attr:
3472     @@Name: disActualDataTypeResource
3473     @@enDesc:
3474     <Q::dis:actualType> attribute value of this resource.
3475     @@Type: ManakaiDISResourceDefinition
3476     @@Get:
3477     @@@RaiseException:
3478     @@@@@:NO_DIS_TYPE_ERR
3479     @@@@enDesc:
3480     <Q::dis:actualType> attribute is not specified,
3481     and <Q::dis:Type> attribute, neigher.
3482     @@@PerlDef:
3483     __DEEP{
3484     if (defined $self->{<Q::dis:actualType>}) {
3485     $r = $self->{<Q::dis:actualType>};
3486     } else {
3487     $self->{<Q::dis2pm:actualTypeNode>}
3488     = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3489     (<Q::dis:actualType>, for_arg => $self->{for},
3490     forp_arg => $self->{forp});
3491     if ($self->{<Q::dis2pm:actualTypeNode>}) {
3492     $r = $self->{<Q::dis:actualType>}
3493     = $self->{<Q::dis2pm:actualTypeNode>}
3494     -><AG::ManakaiDISElement.qnameValueURI>;
3495     } elsif (defined $self->{<Q::dis:Type>}) {
3496     $r = $self->{<Q::dis:actualType>} = $self->{<Q::dis:Type>};
3497     $self->{<Q::dis2pm:actualTypeNode>}
3498     = $self->{<Q::dis2pm:TypeNode>};
3499     } else {
3500     $self->{<Q::dis2pm:actualTypeNode>}
3501     = $self->{<Q::dis2pm:TypeNode>}
3502     = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3503     (<Q::dis:Type>, for_arg => $self->{for},
3504     forp_arg => $self->{forp});
3505     if ($self->{<Q::dis2pm:TypeNode>}) {
3506     $r = $self->{<Q::dis:actualType>}
3507     = $self->{<Q::dis:Type>}
3508     = $self->{<Q::dis2pm:TypeNode>}
3509     -><AG::ManakaiDISElement.qnameValueURI>;
3510     } else {
3511     my $pr = $self-><M::ManakaiDISPropertyAccessor
3512     .getPropertyResource>
3513     (<Q::DIS:dynamicParentResource>);
3514     if ($pr) {
3515     $r = $self->{<Q::dis:actualType>}
3516     = $pr-><AG::ManakaiDISResourceDefinition
3517     .disActualDataTypeResource>;
3518     $self->{<Q::dis2pm:actualTypeNode>}
3519     = $pr->{<Q::dis2pm:actualTypeNode>};
3520     } else { ## No parent
3521     __UNDEEP{
3522     __EXCEPTION{NO_DIS_TYPE_ERR::
3523     DIS:sourceNode => {$self->{src}},
3524     }__;
3525     }__;
3526     }
3527     }
3528     }
3529     }
3530     }__;
3531    
3532     @Attr:
3533     @@Name: disActualDataTypeNode
3534     @@enDesc:
3535     <Q::dis:actualType> node for this resource.
3536     @@Get:
3537     @@@Type: ManakaiDISElement
3538     @@@RaiseException:
3539     @@@@@:NO_DIS_TYPE_ERR
3540     @@@@enDesc:
3541     <Q::dis:actualType> attribute is not specified,
3542     and <Q::dis:Type> attribute, neigher.
3543     @@@PerlDef:
3544     __DEEP{
3545     $self-><AG::ManakaiDISResourceDefinition.disActualDataTypeNode>;
3546     }__;
3547     $r = $self->{<Q::dis2pm:actualTypeNode>};
3548 wakaba 1.9
3549     @IntMethod:
3550     @@Operator:
3551     @@@@: <=>
3552     @@@ContentType:
3553     lang:Perl
3554     @@enDesc:
3555     Which is greater (i.e. the spaceship operator).
3556     A resource is less than another if it is loaded by
3557     <M::ManakaiDISDatabase.loadResource> before another is loaded.
3558     Order for non-loaded resource definitions are not defined.
3559     \
3560     {NOTE:: In the current implementation, non-loaded resources
3561     are less than any loaded resource and the order in
3562     non-loaded resources is unknown.
3563     \
3564     }
3565     @@Param:
3566     @@@Name: anotherResource
3567     @@@Type: ManakaiDISResourceDefinition
3568     @@@enDesc: Another resource to compare.
3569     @@Return:
3570     @@@Type:
3571     DOMMain:unsigned-long
3572     @@@PerlDef:
3573     if (UNIVERSAL::isa ($anotherResource,
3574     <ClassName::ManakaiDISResourceDefinition>)) {
3575     $r = $self->{seq} <=> $anotherResource->{seq};
3576     } else {
3577     $r = overload::Overloaded ($self) <=> $anotherResource;
3578     }
3579 wakaba 1.2 ##DISResourceDefinition
3580    
3581 wakaba 1.8 XParamDef:
3582     @QName: generatedName
3583     @enDesc:
3584     A generated name.
3585    
3586 wakaba 1.2 ClsDef:
3587     @ClsQName: ManakaiDISPropertyAccessor
3588 wakaba 1.3 @enDesc:
3589 wakaba 1.2 Accessor methods for resource or module properties.
3590    
3591     @Method:
3592 wakaba 1.8 @@Name: getPropertyBoolean
3593     @@enDesc:
3594     Gets boolean property value.
3595     @@PropNameParam:
3596     @@Param:
3597     @@@Name:default
3598     @@@Type:
3599     DOMMain:boolean::ManakaiDOM:all
3600     @@@enDesc:
3601     The default value that is returned if no explicit property
3602     value specification found for this resource.
3603     @@Return:
3604     @@@Type:
3605     DOMMain:boolean::ManakaiDOM:all
3606     @@@enDesc:
3607     The property value.
3608     @@@PerlDef:
3609     if (exists $self->{$propName}) {
3610     $r = defined $self->{$propName} ? $self->{$propName} : $default;
3611     } elsif ($self->{src}) {
3612     $r = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3613     ($propName, for_arg => $self->{for},
3614     forp_arg => $self->{forp});
3615     $self->{$propName} = $r;
3616     $r = $default unless defined $r;
3617     } else {
3618     $r = $default;
3619     }
3620    
3621     @Method:
3622 wakaba 1.2 @@Name: getPropertyText
3623     @@enDesc:
3624     Gets property value text.
3625     @@PropNameParam:
3626     @@Param:
3627     @@@Name:default
3628     @@@Type:
3629 wakaba 1.3 swcfg21:SWCFGString::swcfg21:ForLatest
3630 wakaba 1.2 @@@enDesc:
3631     The default value that is returned if no explicit property
3632     value specification found for this resource.
3633     @@@nullCase:
3634     @@@@enDesc:
3635     No default value supplied; <DOM::null> is returned if
3636     no value specified.
3637     @@Return:
3638     @@@Type:
3639 wakaba 1.3 swcfg21:SWCFGString::swcfg21:ForLatest
3640 wakaba 1.2 @@@enDesc:
3641     The property value string.
3642     @@@nullCase:
3643     @@@@enDesc:
3644     No value nor default value has specified.
3645     @@@PerlDef:
3646     if (exists $self->{$propName}) {
3647     $r = defined $self->{$propName} ? $self->{$propName} : $default;
3648     } elsif ($self->{src}) {
3649     $r = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3650     ($propName, for_arg => $self->{for},
3651     forp_arg => $self->{forp});
3652 wakaba 1.8 if ($r) {
3653     $r = $self->{$propName}
3654     = $r-><AG::swcfg21:SWCFGNode::swcfg21:ForLatest.value>;
3655     $r = $default unless defined $r;
3656     } else {
3657     $r = $default;
3658     $self->{$propName} = null;
3659     }
3660 wakaba 1.2 } else {
3661     $r = $default;
3662     }
3663    
3664     @Method:
3665     @@Name: getPropertyResource
3666     @@enDesc:
3667     Gets property value resource.
3668     @@PropNameParam:
3669     @@Return:
3670     @@@Type: ManakaiDISResourceDefinition
3671     @@@enDesc:
3672     The property value resource.
3673     @@@nullCase:
3674     @@@@enDesc:
3675     No value has specified.
3676 wakaba 1.8 @@@UndeclaredPrefixException:
3677 wakaba 1.2 @@@PerlDef:
3678     if (defined $self->{$propName}) {
3679 wakaba 1.9 $r = $self->{db}-><M::ManakaiDISDatabase.getResource>
3680     ($self->{$propName});
3681 wakaba 1.8 } elsif ($self->{src}) {
3682     __DEEP{
3683     $r = $self->{src}-><M::ManakaiDISElement.disGetAttribute>
3684     ($propName, for_arg => $self->{for},
3685     forp_arg => $self->{forp});
3686     if ($r) {
3687 wakaba 1.9 $self->{$propName}
3688 wakaba 1.8 = $r-><AG::ManakaiDISElement.qnameValueURI>;
3689 wakaba 1.9 $r = $self->{db}-><M::ManakaiDISDatabase.getResource>
3690     ($self->{$propName});
3691     $r-><M::ManakaiDISResourceDefinition.isReferred> ($self->{src});
3692 wakaba 1.8 }
3693     }__;
3694 wakaba 1.2 }
3695    
3696     @Method:
3697     @@Name: addPropertyResourceList
3698     @@enDesc:
3699     Adds a resource to a resource-list property value.
3700     \
3701     {ISSUE:: Should an exception be thrown if the property is
3702     not of list?
3703     \
3704     }
3705     @@PropNameParam:
3706     @@Param:
3707     @@@Name: res
3708     @@@Type: ManakaiDISResourceDefinition
3709     @@@enDesc:
3710     A resource to add.
3711     @@Return:
3712     @@@PerlDef:
3713     if (ref $self->{$propName} eq 'ARRAY') {
3714     push @{$self->{$propName}}, $res->{uri};
3715     } elsif (not defined $self->{$propName}) {
3716     $self->{$propName} = [$res->{uri}];
3717     }
3718    
3719 wakaba 1.3 ElementTypeBinding:
3720     @Name: PropNameParam
3721     @ElementType:
3722     dis:ResourceDef
3723     @ShadowContent:
3724     @@rdf:type:
3725     DISLang:MethodParameter
3726     @@Name: propName
3727     @@Type: ResourceURI
3728     @@Description:
3729     @@@lang:en
3730     @@@@:
3731     The name of the property.
3732    
3733 wakaba 1.2 ##DISPropertyAccessor
3734    
3735     PropDef:
3736     @QName:isAnon
3737     @Description:
3738     @@lang:en
3739     @@@:
3740     Whether the subject resource is anonymous or not.
3741     @Type:
3742     DOMMain:boolean
3743    
3744     PropDef:
3745     @QName:isDefined
3746     @Description:
3747     @@lang:en
3748     @@@:
3749     Whether the subject resource is defined or not.
3750    
3751     PropDef:
3752 wakaba 1.3 @QName:isReferred
3753 wakaba 1.2 @Description:
3754     @@lang:en
3755     @@@:
3756     Whether the subject resource is referred or not.
3757     @Type:
3758     DOMMain:any
3759    
3760     PropDef:
3761     @QName:definingModule
3762     @Description:
3763     @@lang:en
3764     @@@:
3765     The <QUOTE::dis> module in which the subject resource is defined.
3766     @rdfs:domain:
3767     DISCore:Module
3768 wakaba 1.1
3769     ## -- Datatypes
3770    
3771     URITypeDef:
3772 wakaba 1.3 @QName: AnyURI
3773     @Description:
3774     @@lang:en
3775     @@@:
3776     Any URI references.
3777    
3778     URITypeDef:
3779     @QName: FileURI
3780     @enDesc:
3781     URI references identifying file.
3782    
3783     URITypeDef:
3784 wakaba 1.1 @QName: ForURI
3785     @Description:
3786     @@lang:en
3787     @@@:
3788     <QUOTE::For> URI references.
3789    
3790     DataTypeDef:
3791     @QName: ForURIList
3792     @Description:
3793     @@lang:en
3794     @@@:
3795     References to the array containing <QUOTE::for> URI references.
3796    
3797     URITypeDef:
3798 wakaba 1.3 @QName: ResourceURI
3799     @Description:
3800     @@lang:en
3801     @@@:
3802     A URI reference for a <QUOTE::dis> resource.
3803    
3804     URITypeDef:
3805 wakaba 1.1 @QName: MediaTypeURI
3806     @Description:
3807     @@lang:en
3808     @@@:
3809     Media type URI references.
3810 wakaba 1.3 @rdfs:subClassOf: ResourceURI
3811    
3812     URITypeDef:
3813     @QName: ModuleURI
3814     @enDesc:
3815     URI references for <QUOET::dis> modules.
3816     @rdfs:subClassOf: ResourceURI
3817    
3818     URITypeDef:
3819     @QName: NameURI
3820     @enDesc:
3821     URI references identifying a resource.
3822     @rdfs:subClassOf: ResourceURI
3823    
3824     ElementTypeBinding:
3825     @Name: DataTypeDef
3826     @ElementType:
3827     dis:ResourceDef
3828     @ShadowContent:
3829     @@rdf:type:
3830     ManakaiDOM:DataType
3831    
3832     ElementTypeBinding:
3833     @Name: URITypeDef
3834     @ElementType:
3835     dis:ResourceDef
3836     @ShadowContent:
3837     @@rdf:type:
3838     ManakaiDOM:DataType
3839     @@rdfs:subClassOf: AnyURI
3840 wakaba 1.1
3841     ## -- Exceptions
3842    
3843     XParamDef:
3844     @QName: sourceNode
3845     @Description:
3846     @@lang:en
3847     @@@:
3848 wakaba 1.4 The node in which an error has occurred.
3849 wakaba 1.5 @Type: ManakaiDISNode
3850    
3851     XParamDef:
3852     @QName: anotherSourceNode
3853     @enDesc:
3854     Another source node in which an error has occurred. In cases
3855     of <QUOTE::already defined> errors, it is the node that
3856     defines the resource first.
3857     @Type: ManakaiDISNode
3858 wakaba 1.3
3859     ExceptionDef:
3860     @ClsQName: ManakaiDISException
3861     @enDesc:
3862     Exceptions for the <QUOTE::dis> operations.
3863 wakaba 1.4 @ClsISA:
3864     ManakaiDOM:ManakaiDOMException::ManakaiDOM:Perl
3865 wakaba 1.3 @XConstGroupDef:
3866     @@ClsQName: ManakaiDISExceptionCode
3867     @@enDesc:
3868     Exception codes for <Class::ManakaiDISException>.
3869     @@XConstDef:
3870 wakaba 1.8 @@@Name: NOT_SUPPORTED_ERR
3871     @@@Value:9
3872     @@@enDesc:
3873     An attempt is made to do something the implementation does not support.
3874     @@@XSubTypeDef:
3875     @@@@QName: UNSUPPORTED_MEDIA_TYPE_ERR
3876     @@@@enDesc:
3877     The implementation does not support the media type.
3878     @@@@XParam:
3879     @@@@@QName: uri
3880     @@@@@enDesc:
3881     The URI reference of the media type that is not supported.
3882     @@@@XSourceNodeParam:
3883     @@XConstDef:
3884 wakaba 1.3 @@@Name: NAMESPACE_ERR
3885     @@@Value:14
3886     @@@enDesc:
3887     An error related to namespaces has occurred.
3888     @@@XSubTypeDef:
3889     @@@@QName: UNDECLARED_NS_PREFIX_ERR
3890     @@@@enDesc:
3891     The implementation has encounted an undeclared namespace
3892     prefix.
3893 wakaba 1.7 @@@@XParam:
3894     @@@@@QName:
3895     infoset:prefix
3896     @@@@@enDesc:
3897     The namespace prefix.
3898     @@@@enMufDef:
3899     Namespace prefix "%p (name => {<Q::infoset:prefix>});" is
3900     not declared
3901 wakaba 1.3 @@XConstDef:
3902     @@@Name: INVALID_STATE_ERR
3903     @@@Value:11
3904     @@@enDesc:
3905     An attempt is made to use an object that is not (or no longer) usable.
3906     @@@XSubTypeDef:
3907     @@@@QName: NO_ASSOCIATED_DB_ERR
3908     @@@@enDesc:
3909     No <QUOTE::dis> database has been associated with this document.
3910 wakaba 1.4 @@XConstDef:
3911     @@@Name: INVALID_SOURCE_ERR
3912     @@@Value: 200
3913     @@@enDesc:
3914     The source input is well-formed but invalid.
3915     @@@XSubTypeDef:
3916     @@@@QName: NO_MODULE_QNAME_ERR
3917     @@@@enDesc:
3918     The <Q::dis:Module> element must have its <Q::dis:QName>
3919     attribute.
3920 wakaba 1.8 @@@@XSourceNodeParam:
3921     @@@XSubTypeDef:
3922     @@@@QName: NO_LOCAL_NAME_ERR
3923     @@@@enDesc:
3924     The resource does not have a local name.
3925     @@@@XSourceNodeParam:
3926 wakaba 1.4 @@@XSubTypeDef:
3927     @@@@QName: UNABLE_TO_GET_MODULE_ERR
3928     @@@@enDesc:
3929     The implementation is unable to get the module source.
3930     @@@@Def:
3931     @@@@@ContentType:
3932     lang:muf
3933     @@@@@lang:en
3934     @@@@@@:
3935     Unable to get the module source of <%p (name => {<Q::DIS:uri>});>
3936     @@@@XParam:
3937     @@@@@QName: uri
3938     @@@@@enDesc:
3939     The URI reference of the module.
3940     @@@@XParam:
3941     @@@@@QName: namespaceURI
3942     @@@@@enDesc:
3943     The namespace URI of the module name.
3944     @@@@XParam:
3945     @@@@@QName: localName
3946     @@@@@enDesc:
3947     The local name of the module name.
3948     @@@@XParam:
3949     @@@@@QName: for
3950     @@@@@enDesc:
3951     The <QUOTE::for> of the module.
3952 wakaba 1.5 @@@XSubTypeDef:
3953     @@@@QName: NO_FOR_QNAME_ERR
3954     @@@@enDesc:
3955     A <Q::dis:ForDef> element must have <Q::dis:QName> attribute.
3956     @@@@XSourceNodeParam:
3957     @@@XSubTypeDef:
3958     @@@@QName: FOR_ALREADY_DEFINED_ERR
3959     @@@@enDesc:
3960     The <QUOTE::for> named as the same URI reference has
3961     already defined.
3962     @@@@XSourceNodeParam:
3963     @@@@XParam:
3964     @@@@@QName: anotherSourceNode
3965     @@@@@enDesc:
3966     The node that defines the <QUOTE::for> URI reference before.
3967 wakaba 1.7 @@@@XParam:
3968     @@@@@Name: uri
3969     @@@@@enDesc:
3970     The URI reference of the <QUOTE::for> attempted to define.
3971     @@@@enMufDef:
3972     <QUOTE::For> <%p (name => {<Q::DIS:uri>});> is already defined
3973 wakaba 1.5 @@@XSubTypeDef:
3974     @@@@QName: RESOURCE_ALREADY_DEFINED_ERR
3975     @@@@enDesc:
3976     The <QUOTE::dis> resource named as the same URI reference has
3977     already defined.
3978     @@@@XSourceNodeParam:
3979     @@@@XParam:
3980     @@@@@QName: anotherSourceNode
3981     @@@@@enDesc:
3982     The node that defines the <QUOTE::for> URI reference before.
3983 wakaba 1.7 @@@@XParam:
3984     @@@@@Name: uri
3985     @@@@@enDesc:
3986     The URI reference of the resource attempted to define.
3987     @@@@enMufDef:
3988     Resource <%p (name => {<Q::DIS:uri>});> is already defined
3989 wakaba 1.5 @@@XSubTypeDef:
3990     @@@@QName: ELEMENT_NOT_ALLOWED_ERR
3991     @@@@enDesc:
3992     An element has occured where it is not allowed.
3993     @@@@enMufDef:
3994     Module <%p (name => {<Q::DIS:uri>});>:
3995     Element of type <%p (name => {<Q::DIS:elementType>});>
3996     is not allowed here
3997     @@@@XSourceNodeParam:
3998     @@@@XParam:
3999     @@@@@QName: elementType
4000     @@@@@enDesc:
4001     The expanded element type name of the element.
4002     @@@@XParam:
4003     @@@@@QName: uri
4004     @@@@@enDesc:
4005     The URI reference of the module.
4006 wakaba 1.7 @@@XSubTypeDef:
4007     @@@@QName: NO_REQUIRED_ATTR_ERR
4008     @@@@enDesc:
4009     A required attribute is not specified.
4010     @@@@XSourceNodeParam:
4011     @@@@XParam:
4012     @@@@@QName: elementType
4013     @@@@@enDesc:
4014     The expanded URI reference of the attribute name.
4015     @@@@enMufDef:
4016     Attribute <%p (name => {<Q::DIS:elementType>});> must be specified
4017 wakaba 1.8 @@@XSubTypeDef:
4018     @@@@QName: FOR_NOT_DEFINED_ERR
4019     @@@@enDesc:
4020     A <QUOTE::for> is referred but not defined.
4021     @@@@XSourceNodeParam:
4022     @@@@XParam:
4023     @@@@@QName: uri
4024     @@@@@enDesc:
4025     The URI reference of the <QUOTE::for> that is not defined.
4026     @@@@enMufDef:
4027     <QUOTE::For> <%p (name => {<Q::DIS:uri>});> is not defined
4028     @@@XSubTypeDef:
4029     @@@@QName: RESOURCE_NOT_DEFINED_ERR
4030     @@@@enDesc:
4031     A <QUOTE::dis> resource is referred but not defined.
4032     @@@@XSourceNodeParam:
4033     @@@@XParam:
4034     @@@@@QName: uri
4035     @@@@@enDesc:
4036     The URI reference of the resource that is not defined.
4037     @@@@enMufDef:
4038     Resource <%p (name => {<Q::DIS:uri>});> is not defined
4039     @@@XSubTypeDef:
4040     @@@@QName: RESERVED_PERL_METHOD_NAME_ERR
4041     @@@@enDesc:
4042     A reserved Perl method name is used.
4043     @@@@XParam:
4044     @@@@@QName:uri
4045     @@@@@enDesc:
4046     The URI reference of the method resource.
4047     @@@@XSourceNodeParam:
4048     @@@@XParam:
4049     @@@@@QName: generatedName
4050     @@@@@enDesc:
4051     A reserved method name.
4052     @@@XSubTypeDef:
4053     @@@@QName: NO_DIS_TYPE_ERR
4054     @@@@enDesc:
4055     <Q::dis:Type> attribute is not found.
4056     @@@@XSourceNodeParam:
4057 wakaba 1.4 ##DISException
4058 wakaba 1.5
4059     XParamDef:
4060     @QName: elementType
4061     @Type: ResourceURI
4062     @enDesc:
4063     The name of the element type.
4064    
4065     XParamDef:
4066     @QName: uri
4067     @Type: ResourceURI
4068     @enDesc:
4069     The name of the resource, composed from <Q::namespaceURI>,
4070     <Q::localName> and <Q::for>.
4071    
4072     XParamDef:
4073     @QName: localName
4074     @Type:
4075     DISCore:LocalName
4076     @enDesc:
4077     The local name of the resource, unique in <Q::namespaceURI> namespace.
4078    
4079     XParamDef:
4080     @QName: namespaceURI
4081     @Type: AnyURI
4082     @enDesc:
4083     The namespace URI reference of the resource name.
4084    
4085     XParamDef:
4086     @QName: for
4087     @Type: ForURI
4088     @enDesc:
4089     The <QUOTE::for> URI reference of the resource.
4090    
4091     ElementTypeBinding:
4092     @Name: XSourceNodeParam
4093     @ElementType:
4094     ManakaiDOM:exceptionOrWarningParameter
4095     @ShadowContent:
4096     @@QName: sourceNode
4097     @@Description:
4098     @@@lang:en
4099     @@@@:
4100     The node in which an error has occurred.
4101 wakaba 1.4
4102     ClsDef:
4103     @ClsQName: ManakaiDISExceptionTarget
4104     @enDesc:
4105     Objects that is able to be the target of an exception.
4106     @IntMethod:
4107     @@Operator:
4108     @@@@:
4109     ManakaiDOM:MUErrorHandler
4110     @@@ContentType:
4111     dis:TypeQName
4112     @@Description:
4113     @@@lang:en
4114     @@@@:
4115     This method is a generic error handler; all manakai exceptions
4116     and warnings associated to an object are once reported to this method
4117     and then delivered to appropriate entities.
4118     \
4119     If the error is an exception (such as <X::DOMCore:DOMException> or
4120     <X::ManakaiDOM:ManakaiDOMImplementationException>), it is
4121     simply thrown. If the error is only a warning, it is reported
4122     via the <IF::DOMCore:DOMError> interface.
4123     \
4124     See <PerlModule::Message::Util::Error> documentation for more
4125     information on the error reporting mechanism.
4126     \
4127     {NOTE:: This kind of methods are named as <Perl::___report_error>
4128     in the convention of <PerlModule::Message::Util::Error>.
4129     \
4130     }
4131     @@Param:
4132     @@@Name:err
4133     @@@Type:
4134     ManakaiDOM:ManakaiDOMExceptionOrWarning::ManakaiDOM:Perl
4135     @@@Description:
4136     @@@@lang:en
4137     @@@@@:
4138     An exception object that describes what kind of error it is
4139     and how it should be recovered.
4140     \
4141     {NOTE:: Exception objects in manakai implementation
4142     inherit the class <PerlModule::Message::Util::Error>,
4143     that in turn inherits <PerlModule::Error>.
4144     \
4145     }
4146     @@Return:
4147     @@@PerlDef:
4148     if ($err->isa (<ClassName::ManakaiDOM:ManakaiDOMException
4149     ::ManakaiDOM:Perl>)) {
4150     $err->throw;
4151     } else {
4152     \## TODO: Implement warning reporting
4153     warn $err->stringify;
4154     }
4155     ##DISExceptionTarget
4156    
4157     ForDef:
4158     @QName:
4159     DIS:ForIF
4160     ForDef:
4161     @QName:
4162     DIS:ForClass
4163    
4164     ElementTypeBinding:
4165     @Name: IFClsDef
4166     @ElementType:
4167     dis:ResourceDef
4168     @ShadowContent:
4169     @@rdf:type:
4170     @@@@:
4171     dis:MultipleResource
4172     @@@ForCheck: !ForClass !ForIF
4173     @@rdf:type:
4174     @@@@:
4175     ManakaiDOM:IF
4176     @@@ForCheck: ForIF
4177     @@rdf:type:
4178     @@@@:
4179     ManakaiDOM:Class
4180     @@@ForCheck: ForClass
4181     @@resourceFor: ForIF
4182     @@resourceFor:
4183     @@@@: ForClass
4184     @@@ForCheck: ForLatest
4185     @@DOMMain:implementFeature:
4186     @@@@:CoreFeature10
4187     @@@ForCheck: ForClass
4188     @@ForCheck:
4189     ManakaiDOM:Perl
4190 wakaba 1.3
4191     ElementTypeBinding:
4192     @Name: ClsDef
4193     @ElementType:
4194     dis:ResourceDef
4195     @ShadowContent:
4196     @@rdf:type:
4197     ManakaiDOM:Class
4198     @@AliasFor:
4199     @@@@:
4200     ::ForLatest
4201     @@@For:
4202     !=ForLatest
4203     @@ForCheck:
4204     ManakaiDOM:Perl
4205     @@DOMMain:implementFeature: CoreFeature10
4206    
4207     ElementTypeBinding:
4208     @Name: ExceptionDef
4209     @ElementType:
4210     dis:ResourceDef
4211     @ShadowContent:
4212     @@rdf:type:
4213     ManakaiDOM:ExceptionClass
4214     @@AliasFor:
4215     @@@@:
4216     ::ForLatest
4217     @@@For:
4218     !=ForLatest
4219     @@ForCheck:
4220     ManakaiDOM:Perl
4221     @@DOMMain:implementFeature: CoreFeature10
4222    
4223     ElementTypeBinding:
4224     @Name: ClsQName
4225     @ElementType:
4226     dis:QName
4227    
4228     ElementTypeBinding:
4229     @Name: ClsISA
4230     @ElementType:
4231     dis:ISA
4232    
4233     ElementTypeBinding:
4234     @Name: Method
4235     @ElementType:
4236     dis:ResourceDef
4237     @ShadowContent:
4238     @@rdf:type:
4239     DISLang:Method
4240    
4241     ElementTypeBinding:
4242     @Name: IntMethod
4243     @ElementType:
4244     dis:ResourceDef
4245     @ShadowContent:
4246     @@rdf:type:
4247     DISLang:Method
4248     @@ManakaiDOM:isForInternal:1
4249    
4250     ElementTypeBinding:
4251     @Name: Attr
4252     @ElementType:
4253     dis:ResourceDef
4254     @ShadowContent:
4255     @@rdf:type:
4256     DISLang:Attribute
4257    
4258     ElementTypeBinding:
4259     @Name: Return
4260     @ElementType:
4261     dis:ResourceDef
4262     @ShadowContent:
4263     @@rdf:type:
4264     DISLang:MethodReturn
4265    
4266     ElementTypeBinding:
4267     @Name: Get
4268     @ElementType:
4269     dis:ResourceDef
4270     @ShadowContent:
4271     @@rdf:type:
4272     DISLang:AttributeGet
4273    
4274     ElementTypeBinding:
4275     @Name: Set
4276     @ElementType:
4277     dis:ResourceDef
4278     @ShadowContent:
4279     @@rdf:type:
4280     DISLang:AttributeSet
4281    
4282     ElementTypeBinding:
4283     @Name: Param
4284     @ElementType:
4285     dis:ResourceDef
4286     @ShadowContent:
4287     @@rdf:type:
4288     DISLang:MethodParameter
4289    
4290     ElementTypeBinding:
4291     @Name: PerlDef
4292     @ElementType:
4293     dis:Def
4294     @ShadowContent:
4295     @@ContentType:
4296     lang:Perl
4297    
4298     ElementTypeBinding:
4299     @Name: disDef
4300     @ElementType:
4301     dis:Def
4302     @ShadowContent:
4303     @@ContentType:
4304     lang:dis
4305    
4306     ElementTypeBinding:
4307     @Name: InCase
4308     @ElementType:
4309     dis:ResourceDef
4310     @ShadowContent:
4311     @@rdf:type:
4312     ManakaiDOM:InCase
4313    
4314     ElementTypeBinding:
4315     @Name: nullCase
4316     @ElementType:
4317     dis:ResourceDef
4318     @ShadowContent:
4319     @@rdf:type:
4320     ManakaiDOM:InCase
4321     @@Value:
4322     @@@is-null:1
4323    
4324     ElementTypeBinding:
4325     @Name: TrueCase
4326     @ElementType:
4327     dis:ResourceDef
4328     @ShadowContent:
4329     @@rdf:type:
4330     ManakaiDOM:InCase
4331     @@Value:true
4332     @@Type:
4333     DOMMain:boolean
4334    
4335    
4336     ElementTypeBinding:
4337     @Name: FalseCase
4338     @ElementType:
4339     dis:ResourceDef
4340     @ShadowContent:
4341     @@rdf:type:
4342     ManakaiDOM:InCase
4343     @@Value:false
4344     @@Type:
4345     DOMMain:boolean
4346    
4347     ElementTypeBinding:
4348     @Name: enDesc
4349     @ElementType:
4350     dis:Description
4351     @ShadowContent:
4352     @@lang:en
4353    
4354     ElementTypeBinding:
4355     @Name: PropDef
4356     @ElementType:
4357     dis:ResourceDef
4358     @ShadowContent:
4359     @@rdf:type:
4360     rdf:Property
4361     @@AliasFor:
4362     @@@@:
4363     ::ManakaiDOM:all
4364     @@@For:
4365     !=ManakaiDOM:all
4366    
4367     ElementTypeBinding:
4368     @Name: MethodRedef
4369     @ElementType:
4370     dis:ResourceDef
4371     @ShadowContent:
4372     @@rdf:type:
4373     DISLang:Method
4374     @@ManakaiDOM:isRedefining:1
4375    
4376     ElementTypeBinding:
4377     @Name: NamedParam
4378     @ElementType:
4379     dis:ResourceDef
4380     @ShadowContent:
4381     @@rdf:type:
4382     DISLang:MethodParameter
4383     @@DISPerl:isNamedParameter:1
4384    
4385     ElementTypeBinding:
4386     @Name: NodeParam
4387     @ElementType:
4388     dis:ResourceDef
4389     @ShadowContent:
4390     @@rdf:type:
4391     DISLang:MethodParameter
4392     @@DISPerl:isNamedParameter:1
4393     @@Name: node
4394     @@Type: ManakaiDISNode
4395     @@Description:
4396     @@@lang:en
4397     @@@@:
4398     The node in which the name has occurred. It is intended
4399     to be reported when an exception had been raised.
4400     @@ResourceDef:
4401     @@@rdf:type:
4402     ManakaiDOM:InCase
4403     @@@Value:
4404     @@@@is-null:1
4405     @@@Description:
4406     @@@@lang:en
4407     @@@@@:
4408     The source of the name is not a node.
4409    
4410     ElementTypeBinding:
4411     @Name: ForParam
4412     @ElementType:
4413     dis:ResourceDef
4414     @ShadowContent:
4415     @@rdf:type:
4416     DISLang:MethodParameter
4417     @@DISPerl:isNamedParameter:1
4418     @@Name: forArg
4419     @@Type: ForURI
4420     @@Description:
4421     @@@lang:en
4422     @@@@:
4423     The <QUOTE::for> URI reference.
4424     @@ResourceDef:
4425     @@@rdf:type:
4426     ManakaiDOM:InCase
4427     @@@Value:
4428     @@@@is-null:1
4429     @@@Description:
4430     @@@@lang:en
4431     @@@@@:
4432     Equivalent to <Q::ManakaiDOM:all>, i.e. <QUOTE::for all>.
4433    
4434     ElementTypeBinding:
4435     @Name: ForpParam
4436     @ElementType:
4437     dis:ResourceDef
4438     @ShadowContent:
4439     @@rdf:type:
4440     DISLang:MethodParameter
4441     @@DISPerl:isNamedParameter:1
4442     @@Name: forpArg
4443     @@Type: ForURIList
4444     @@Description:
4445     @@@lang:en
4446     @@@@:
4447     An array reference containing additional <QUOTE::for>
4448     constraints (<QUOTE::For+> list).
4449     @@ResourceDef:
4450     @@@rdf:type:
4451     ManakaiDOM:InCase
4452     @@@Value:
4453     @@@@is-null:1
4454     @@@Description:
4455     @@@@lang:en
4456     @@@@@:
4457     Equivalent to the empty array reference.
4458    
4459     ElementTypeBinding:
4460     @Name: MediaTypeParam
4461     @ElementType:
4462     dis:ResourceDef
4463     @ShadowContent:
4464     @@rdf:type:
4465     DISLang:MethodParameter
4466     @@DISPerl:isNamedParameter:1
4467     @@Name: mediaType
4468     @@Type: MediaTypeURI
4469     @@Description:
4470     @@@lang:en
4471     @@@@:
4472     The URI reference identifying a media type.
4473     @@ResourceDef:
4474     @@@rdf:type:
4475     ManakaiDOM:InCase
4476     @@@Value:
4477     @@@@is-null:1
4478     @@@Description:
4479     @@@@lang:en
4480     @@@@@:
4481     No media type specified.
4482    
4483     ElementTypeBinding:
4484     @Name: MediaTypeDefaultParam
4485     @ElementType:
4486     dis:ResourceDef
4487     @ShadowContent:
4488     @@rdf:type:
4489     DISLang:MethodParameter
4490     @@DISPerl:isNamedParameter:1
4491     @@Name: defaultMediaType
4492     @@Type: MediaTypeURI
4493     @@Description:
4494     @@@lang:en
4495     @@@@:
4496     The default media type, i.e. the type used when no explicit
4497     specification is not found in the source tree.
4498     @@ResourceDef:
4499     @@@rdf:type:
4500     ManakaiDOM:InCase
4501     @@@Value:
4502     @@@@is-null:1
4503     @@@Description:
4504     @@@@lang:en
4505     @@@@@:
4506     Defaulted to <Q::DOMMain:any>.
4507    
4508     ElementTypeBinding:
4509     @Name: RaiseException
4510     @ElementType:
4511     ManakaiDOM:raises
4512    
4513     ElementTypeBinding:
4514     @Name: UndeclaredPrefixException
4515     @ElementType:
4516     ManakaiDOM:raises
4517     @ShadowContent:
4518     @@@: UNDECLARED_NS_PREFIX_ERR
4519     @@Description:
4520     @@@lang:en
4521     @@@@:
4522     The implementation has encounted an undeclared namespace prefix.
4523    
4524     ElementTypeBinding:
4525     @Name: NoDBException
4526     @ElementType:
4527     ManakaiDOM:raises
4528     @ShadowContent:
4529     @@@: NO_DB_ASSOCIATED_ERR
4530     @@Description:
4531     @@@lang:en
4532     @@@@:
4533     No <QUOTE::dis> database is associated to this document.
4534    
4535     ElementTypeBinding:
4536     @Name: XConstGroupDef
4537     @ElementType:
4538     dis:ResourceDef
4539     @ShadowContent:
4540     @@rdf:type:
4541     ManakaiDOM:ConstGroup
4542     @@Type:
4543     DOMMain:unsigned-short::ManakaiDOM:all
4544     @@rdfs:subClassOf:
4545     DOMMain:unsigned-short::ManakaiDOM:all
4546    
4547     ElementTypeBinding:
4548     @Name: XConstDef
4549     @ElementType:
4550     dis:ResourceDef
4551     @ShadowContent:
4552     @@rdf:type:
4553     ManakaiDOM:Const
4554    
4555     ElementTypeBinding:
4556     @Name: XSubTypeDef
4557     @ElementType:
4558     dis:ResourceDef
4559     @ShadowContent:
4560     @@rdf:type:
4561     ManakaiDOM:ExceptionOrWarningSubType
4562    
4563     ElementTypeBinding:
4564     @Name: XParam
4565     @ElementType:
4566     ManakaiDOM:exceptionOrWarningParameter
4567    
4568     ElementTypeBinding:
4569     @Name: XParamDef
4570     @ElementType:
4571     dis:ResourceDef
4572     @ShadowContent:
4573     @@rdf:type:
4574     DOMMain:XWParameter
4575     @@AliasFor:
4576     @@@For:
4577     !=ManakaiDOM:all
4578     @@@@:
4579     ::ManakaiDOM:all
4580    
4581     ElementTypeBinding:
4582     @Name: enMufDef
4583     @ElementType:
4584     dis:Def
4585     @ShadowContent:
4586     @@ContentType:
4587     lang:muf
4588     @@lang:en
4589    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24