comparison Lib/IMPL/Config.pm @ 278:4ddb27ff4a0b

core refactoring
author cin
date Mon, 04 Feb 2013 02:10:37 +0400
parents 0f59b2de72af
children 212cc86e470b
comparison
equal deleted inserted replaced
277:6585464c4664 278:4ddb27ff4a0b
1 package IMPL::Config; 1 package IMPL::Config;
2 use strict; 2 use strict;
3 use warnings; 3 use warnings;
4 4
5 use IMPL::Const qw(:access);
5 use IMPL::declare { 6 use IMPL::declare {
6 base => [ 7 base => [
7 'IMPL::Object::Accessor' => undef, 8 'IMPL::Object::Accessor' => undef,
8 'IMPL::Object::Serializable' => undef, 9 'IMPL::Object::Serializable' => undef,
9 'IMPL::Object::Autofill' => '@_' 10 'IMPL::Object::Autofill' => '@_'
26 my ($self,$file) = @_; 27 my ($self,$file) = @_;
27 28
28 my $class = ref $self || $self; 29 my $class = ref $self || $self;
29 30
30 my $serializer = new IMPL::Serializer( 31 my $serializer = new IMPL::Serializer(
31 Formatter => new IMPL::Serialization::XmlFormatter( 32 formatter => new IMPL::Serialization::XmlFormatter(
32 IdentOutput => 1, 33 IdentOutput => 1,
33 SkipWhitespace => 1 34 SkipWhitespace => 1
34 ) 35 )
35 ); 36 );
36 37
50 51
51 sub SaveXMLFile { 52 sub SaveXMLFile {
52 my ($this,$file) = @_; 53 my ($this,$file) = @_;
53 54
54 my $serializer = new IMPL::Serializer( 55 my $serializer = new IMPL::Serializer(
55 Formatter => new IMPL::Serialization::XmlFormatter( 56 formatter => new IMPL::Serialization::XmlFormatter(
56 IdentOutput => 1, 57 IdentOutput => 1,
57 SkipWhitespace => 1 58 SkipWhitespace => 1
58 ) 59 )
59 ); 60 );
60 61
64 } 65 }
65 66
66 sub xml { 67 sub xml {
67 my $this = shift; 68 my $this = shift;
68 my $serializer = new IMPL::Serializer( 69 my $serializer = new IMPL::Serializer(
69 Formatter => new IMPL::Serialization::XmlFormatter( 70 formatter => new IMPL::Serialization::XmlFormatter(
70 IdentOutput => 1, 71 IdentOutput => 1,
71 SkipWhitespace => 1 72 SkipWhitespace => 1
72 ) 73 )
73 ); 74 );
74 my $str = ''; 75 my $str = '';
87 my $val; 88 my $val;
88 89
89 $val = $this->rawGet($_) and $ctx->AddVar($_ => $val) foreach map $_->Name, $this->get_meta( 90 $val = $this->rawGet($_) and $ctx->AddVar($_ => $val) foreach map $_->Name, $this->get_meta(
90 'IMPL::Class::PropertyInfo', 91 'IMPL::Class::PropertyInfo',
91 sub { 92 sub {
92 $_->Access == IMPL::Class::Member::MOD_PUBLIC and 93 $_->access == ACCESS_PUBLIC and
93 $_->canGet; 94 $_->setter;
94 }, 95 },
95 1); 96 1);
96 } 97 }
97 98
98 sub spawn { 99 sub spawn {