annotate Lib/IMPL/DOM/Schema/ValidationError.pm @ 118:79cdd6c86409

JSON support (experimental)
author wizard
date Mon, 07 Jun 2010 08:21:26 +0400
parents 196bf443b5e1
children a4b0a819bbda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
1 package IMPL::DOM::Schema::ValidationError;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
2 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
3 use warnings;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
4
104
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
5 use overload
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
6 '""' => \&toString,
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
7 'fallback' => 1;
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
8
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
9 use base qw(IMPL::Object);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
10 use IMPL::Class::Property;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
11 use IMPL::Class::Property::Direct;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
12 use IMPL::Resources::Format qw(FormatMessage);
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
13
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
14 BEGIN {
104
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
15 public _direct property Node => prop_get; # target document node (if exists)
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
16 public _direct property Schema => prop_get; # a schema for the target node (if exists)
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
17 public _direct property Source => prop_get; # a schema which triggered this error (can be equal to the Schema)
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
18 public _direct property Parent => prop_get;
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
19 public _direct property Message => prop_get; # displayable message
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
20 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
21
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
22 sub CTOR {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
23 my ($this,%args) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
24
100
df6b4f054957 Schema in progress
wizard
parents: 49
diff changeset
25 $this->{$Node} = $args{Node};
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
26 $this->{$Schema} = $args{Schema} if $args{Schema};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
27 $this->{$Source} = $args{Source} if $args{Source};
102
cf3b6ef2be22 Schema beta version
wizard
parents: 100
diff changeset
28 $this->{$Parent} = $args{Parent} if $args{Parent};
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
29 $this->{$Message} = FormatMessage(delete $args{Message}, \%args) if $args{Message};
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
30 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
31
104
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
32 sub toString {
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
33 (my $this) = @_;
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
34 return $this->Message;
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
35 }
196bf443b5e1 DOM::Schema RC0 inflators support, validation and some other things,
wizard
parents: 102
diff changeset
36
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 24
diff changeset
37 1;