445 |
and harmless as far as possible. |
and harmless as far as possible. |
446 |
} |
} |
447 |
|
|
448 |
|
@IntMethod: |
449 |
|
@@Name: new |
450 |
|
@@enDesc: |
451 |
|
Creates a new <IF::URIReference> object. For internal use. |
452 |
|
@@Param: |
453 |
|
@@@Name: uri |
454 |
|
@@@Type: String |
455 |
|
@@@enDesc: |
456 |
|
The DOM URI. |
457 |
|
@@@InCase: |
458 |
|
@@@@Type: DISPerl|SCALAR||ManakaiDOM|all |
459 |
|
@@@InCase: |
460 |
|
@@@@Type: URIReference |
461 |
|
@@Return: |
462 |
|
@@@Type: URIReference |
463 |
|
@@@PerlDef: |
464 |
|
my $v; |
465 |
|
if (ref $uri) { |
466 |
|
if (UNIVERSAL::isa ($uri, <IFName::URIReference>)) { |
467 |
|
my $w = $$uri; |
468 |
|
$v = \$w; |
469 |
|
} elsif (ref $uri eq 'SCALAR') { |
470 |
|
$v = $uri; |
471 |
|
} else { |
472 |
|
$v = \$uri; |
473 |
|
} |
474 |
|
} else { |
475 |
|
$v = \$uri; |
476 |
|
} |
477 |
|
$r = bless $v, <ClassName::ManakaiURIReference>; |
478 |
|
|
479 |
|
@@Test: |
480 |
|
@@@QName: URIRef.new.test |
481 |
|
@@@PerlDef: |
482 |
|
$test->id ('str'); |
483 |
|
my $u1 = <ClassM::ManakaiURIReference.new> (q<http://www.example/>); |
484 |
|
$test->assert_isa ($u1, <IFName::URIReference>); |
485 |
|
$test->assert_equals |
486 |
|
($u1-><AG::URIReference.uriReference>, q<http://www.example/>); |
487 |
|
|
488 |
|
$test->id ('strref'); |
489 |
|
my $u = q<http://www.example/>; |
490 |
|
my $u2 = <ClassM::ManakaiURIReference.new> (\$u); |
491 |
|
$test->assert_isa ($u2, <IFName::URIReference>); |
492 |
|
$test->assert_equals |
493 |
|
($u2-><AG::URIReference.uriReference>, q<http://www.example/>); |
494 |
|
|
495 |
|
$test->id ('uri'); |
496 |
|
my $u3 = <ClassM::ManakaiURIReference.new> ($u1); |
497 |
|
$test->assert_isa ($u3, <IFName::URIReference>); |
498 |
|
$test->assert_equals |
499 |
|
($u3-><AG::URIReference.uriReference>, q<http://www.example/>); |
500 |
|
|
501 |
|
$test->id ('uri.mod'); |
502 |
|
$u3-><AS::URIReference.uriScheme> ('ftp'); |
503 |
|
$test->assert_equals |
504 |
|
($u1-><AG::URIReference.uriReference>, q<http://www.example/>); |
505 |
|
$test->assert_equals |
506 |
|
($u3-><AG::URIReference.uriReference>, q<ftp://www.example/>); |
507 |
|
|
508 |
@Attr: |
@Attr: |
509 |
@@Name: uriReference |
@@Name: uriReference |
510 |
@@Operator: |
@@Operator: |