line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# Copyright (c) 2005-2006 IBM Corporation. |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# All rights reserved. This program and the accompanying materials |
5
|
|
|
|
|
|
|
# are made available under the terms of the Eclipse Public License v1.0 |
6
|
|
|
|
|
|
|
# which accompanies this distribution, and is available at |
7
|
|
|
|
|
|
|
# http://www.eclipse.org/legal/epl-v10.html |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# File: $Source: /var/lib/cvs/ODO/lib/ODO/Ontology/RDFS/ObjectWriter.pm,v $ |
10
|
|
|
|
|
|
|
# Created by: Stephen Evanchik( evanchik@us.ibm.com ) |
11
|
|
|
|
|
|
|
# Created on: 03/02/2005 |
12
|
|
|
|
|
|
|
# Revision: $Id: ObjectWriter.pm,v 1.2 2009-11-25 17:58:26 ubuntu Exp $ |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# Contributors: |
15
|
|
|
|
|
|
|
# IBM Corporation - initial API and implementation |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
package ODO::Ontology::RDFS::ObjectWriter::Constructor; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
2
|
|
14
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
99
|
|
20
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
73
|
|
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
2
|
|
11
|
use base qw/ODO::Ontology::ObjectWriter/; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1718
|
|
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
2
|
|
17
|
use vars qw /$VERSION/; |
|
2
|
|
|
|
|
35
|
|
|
2
|
|
|
|
|
150
|
|
25
|
|
|
|
|
|
|
$VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /: (\d+)\.(\d+)/; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
2
|
|
11
|
use ODO::Exception; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1913
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
our @METHODS = qw/URI description schemaURI propertyContainerName properties queryString queryObject/; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(@METHODS); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=item serialize( ) |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub serialize { |
38
|
0
|
|
|
0
|
|
|
my $self = shift; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $cons_data = { |
41
|
|
|
|
|
|
|
URI=> $self->URI(), |
42
|
|
|
|
|
|
|
description=> $self->description(), |
43
|
|
|
|
|
|
|
schemaURI=> $self->schemaURI(), |
44
|
|
|
|
|
|
|
queryString=> $self->queryString(), |
45
|
|
|
|
|
|
|
propertyInitializers=> $self->serializePropertyInitializers(), |
46
|
|
|
|
|
|
|
propertyContainerName=> $self->propertyContainerName(), |
47
|
|
|
|
|
|
|
properties=> $self->properties(), |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $self->SUPER::serialize(template_data=> $cons_data); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub serializePropertyInitializers { |
55
|
0
|
|
|
0
|
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my @initializerMethods; |
58
|
0
|
|
|
|
|
|
foreach my $p (@{ $self->properties() }) { |
|
0
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
push @initializerMethods, ODO::Ontology::RDFS::ObjectWriter::PropertyInitializer->new(%{ $p })->serialize(); |
|
0
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
0
|
|
|
|
|
|
return \@initializerMethods; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub init { |
66
|
0
|
|
|
0
|
|
|
my ($self, $config) = @_; |
67
|
0
|
|
|
|
|
|
$self = $self->SUPER::init($config); |
68
|
0
|
|
|
|
|
|
$self->params($config, @METHODS); |
69
|
0
|
|
|
|
|
|
$self->template_filename('ODO/Ontology/RDFS/Templates/Constructor.tt'); |
70
|
0
|
|
|
|
|
|
return $self; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
package ODO::Ontology::RDFS::ObjectWriter::PropertyInitializer; |
74
|
|
|
|
|
|
|
|
75
|
2
|
|
|
2
|
|
14
|
use base qw/ODO::Ontology::ObjectWriter/; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
587
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
our @METHODS = qw/shortName packageName/; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(@METHODS); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item serialize( ) |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub serialize { |
87
|
0
|
|
|
0
|
|
|
my $self = shift; |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
my $property_initializer = { |
90
|
|
|
|
|
|
|
shortName=> $self->shortName(), |
91
|
|
|
|
|
|
|
packageName=> $self->packageName(), |
92
|
|
|
|
|
|
|
}; |
93
|
|
|
|
|
|
|
|
94
|
0
|
|
|
|
|
|
return $self->SUPER::serialize(template_data=> $property_initializer); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub init { |
99
|
0
|
|
|
0
|
|
|
my ($self, $config) = @_; |
100
|
0
|
|
|
|
|
|
$self = $self->SUPER::init($config); |
101
|
0
|
|
|
|
|
|
$self->params($config, @METHODS); |
102
|
0
|
|
|
|
|
|
$self->template_filename('ODO/Ontology/RDFS/Templates/PropertyInitializer.tt'); |
103
|
0
|
|
|
|
|
|
return $self; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
package ODO::Ontology::RDFS::ObjectWriter::Package; |
108
|
|
|
|
|
|
|
|
109
|
2
|
|
|
2
|
|
12
|
use base qw/ODO::Ontology::ObjectWriter::Package/; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
1343
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
package ODO::Ontology::RDFS::ObjectWriter::PropertiesContainer; |
113
|
|
|
|
|
|
|
|
114
|
2
|
|
|
2
|
|
14
|
use base qw/ODO::Ontology::ObjectWriter::PropertiesContainer/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1480
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
1; |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
__END__ |