$virtual = "false";
}
my $selector = get_attribute( $attribute_list, 'reporter:selector' );
+ my $datatype = get_attribute( $attribute_list, 'reporter:datatype' );
$$fieldmap{$fm}{fields}{ $name } =
{ virtual => ( $virtual eq 'true' ) ? 1 : 0,
required => ( $required eq 'true' ) ? 1 : 0,
position => $array_position,
+ datatype => $datatype,
};
$$fieldmap{$fm}{fields}{ $name }{validate} = qr/$validate/ if (defined($validate));
return $self->$f =~ $$fieldmap{$self->class_name}{fields}{$f}{validate};
}
+sub FieldInfo {
+ my $self = shift;
+ my $field = shift;
+ my $class_name = $self->class_name;
+ return undef unless ($field && $$fieldmap{$class_name}{fields}{$field});
+ return $$fieldmap{$class_name}{fields}{$field};
+}
+
+sub FieldDatatype {
+ my $self = shift;
+ my $field = shift;
+ my $class_name = $self->class_name;
+ return undef unless ($field && $$fieldmap{$class_name}{fields}{$field});
+ return $$fieldmap{$class_name}{fields}{$field}{datatype};
+}
+
sub class_name {
my $class_name = shift;
return ref($class_name) || $class_name;