ClassRegistry.pm untested

filter: Statementstmt 0.0% 0 / 172 Branchbran 0.0% 0 / 24 Conditioncond 0.0% 0 / 15 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 238 CC 13 SCAR 25.7
CC
13
Cov
0%
get_subclass_name
20.0
is_instance_of
20.0
value_exists
20.0
CRAP 13.0
1 =begin comment
2  
3 Copyright (c) 2019 Aspose Pty Ltd
4  
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11  
12 The above copyright notice and this permission notice shall be included in all
13 copies or substantial portions of the Software.
14  
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 SOFTWARE.
22  
23 =end comment
24  
25 =cut
26 package AsposeSlidesCloud::ClassRegistry;
27  
28 use strict;
29 use warnings;
30 use utf8;
31  
32 use JSON;
33 use Scalar::Util;
34  
35 my %hierarchy = (
36 'AccentElement' => 'MathElement',
37 'AddLayoutSlide' => 'Task',
38 'AddMasterSlide' => 'Task',
39 'AddShape' => 'Task',
40 'AddSlide' => 'Task',
41 'AlphaBiLevelEffect' => 'ImageTransformEffect',
42 'AlphaCeilingEffect' => 'ImageTransformEffect',
43 'AlphaFloorEffect' => 'ImageTransformEffect',
44 'AlphaInverseEffect' => 'ImageTransformEffect',
45 'AlphaModulateEffect' => 'ImageTransformEffect',
46 'AlphaModulateFixedEffect' => 'ImageTransformEffect',
47 'AlphaReplaceEffect' => 'ImageTransformEffect',
48 'ArcToPathSegment' => 'PathSegment',
49 'ArrayElement' => 'MathElement',
50 'AudioFrame' => 'GeometryShape',
51 'BarElement' => 'MathElement',
52 'Base64InputFile' => 'InputFile',
53 'BiLevelEffect' => 'ImageTransformEffect',
54 'BlockElement' => 'MathElement',
55 'BlurImageEffect' => 'ImageTransformEffect',
56 'BorderBoxElement' => 'MathElement',
57 'BoxElement' => 'MathElement',
58 'BubbleChartDataPoint' => 'ScatterChartDataPoint',
59 'BubbleSeries' => 'XYSeries',
60 'CaptionTrack' => 'ResourceBase',
61 'CaptionTracks' => 'ResourceBase',
62 'Chart' => 'ShapeBase',
63 'ClosePathSegment' => 'PathSegment',
64 'ColorChangeEffect' => 'ImageTransformEffect',
65 'ColorReplaceEffect' => 'ImageTransformEffect',
66 'ColorScheme' => 'ResourceBase',
67 'CommentAuthors' => 'ResourceBase',
68 'Connector' => 'GeometryShape',
69 'CubicBezierToPathSegment' => 'PathSegment',
70 'DelimiterElement' => 'MathElement',
71 'Document' => 'ResourceBase',
72 'DocumentProperties' => 'ResourceBase',
73 'DocumentProperty' => 'ResourceBase',
74 'DocumentReplaceResult' => 'Document',
75 'DuotoneEffect' => 'ImageTransformEffect',
76 'FileVersion' => 'StorageFile',
77 'FillOverlayImageEffect' => 'ImageTransformEffect',
78 'FontScheme' => 'ResourceBase',
79 'FormatScheme' => 'ResourceBase',
80 'FractionElement' => 'MathElement',
81 'FunctionElement' => 'MathElement',
82 'GeometryShape' => 'ShapeBase',
83 'GifExportOptions' => 'ImageExportOptionsBase',
84 'GradientFill' => 'FillFormat',
85 'GraphicalObject' => 'ShapeBase',
86 'GrayScaleEffect' => 'ImageTransformEffect',
87 'GroupShape' => 'ShapeBase',
88 'GroupingCharacterElement' => 'MathElement',
89 'HandoutLayoutingOptions' => 'SlidesLayoutOptions',
90 'HeaderFooter' => 'ResourceBase',
91 'HslEffect' => 'ImageTransformEffect',
92 'Html5ExportOptions' => 'ExportOptions',
93 'HtmlExportOptions' => 'ExportOptions',
94 'Image' => 'ResourceBase',
95 'ImageExportOptions' => 'ImageExportOptionsBase',
96 'ImageExportOptionsBase' => 'ExportOptions',
97 'Images' => 'ResourceBase',
98 'LayoutSlide' => 'ResourceBase',
99 'LayoutSlides' => 'ResourceBase',
100 'LeftSubSuperscriptElement' => 'MathElement',
101 'LimitElement' => 'MathElement',
102 'LineToPathSegment' => 'PathSegment',
103 'Literals' => 'DataSource',
104 'LuminanceEffect' => 'ImageTransformEffect',
105 'MarkdownExportOptions' => 'ExportOptions',
106 'MasterSlide' => 'ResourceBase',
107 'MasterSlides' => 'ResourceBase',
108 'MatrixElement' => 'MathElement',
109 'Merge' => 'Task',
110 'MoveToPathSegment' => 'PathSegment',
111 'NaryOperatorElement' => 'MathElement',
112 'NoFill' => 'FillFormat',
113 'NotesCommentsLayoutingOptions' => 'SlidesLayoutOptions',
114 'NotesSlide' => 'ResourceBase',
115 'NotesSlideHeaderFooter' => 'ResourceBase',
116 'OleObjectFrame' => 'ShapeBase',
117 'OneValueChartDataPoint' => 'DataPoint',
118 'OneValueSeries' => 'Series',
119 'Paragraph' => 'ResourceBase',
120 'Paragraphs' => 'ResourceBase',
121 'PathInputFile' => 'InputFile',
122 'PathOutputFile' => 'OutputFile',
123 'PatternFill' => 'FillFormat',
124 'PdfExportOptions' => 'ExportOptions',
125 'PhantomElement' => 'MathElement',
126 'PictureFill' => 'FillFormat',
127 'PictureFrame' => 'GeometryShape',
128 'Placeholder' => 'ResourceBase',
129 'Placeholders' => 'ResourceBase',
130 'Portion' => 'ResourceBase',
131 'Portions' => 'ResourceBase',
132 'PptxExportOptions' => 'ExportOptions',
133 'ProtectionProperties' => 'ResourceBase',
134 'QuadraticBezierToPathSegment' => 'PathSegment',
135 'RadicalElement' => 'MathElement',
136 'RemoveShape' => 'Task',
137 'RemoveSlide' => 'Task',
138 'ReorderSlide' => 'Task',
139 'ReplaceText' => 'Task',
140 'RequestInputFile' => 'InputFile',
141 'ResetSlide' => 'Task',
142 'ResponseOutputFile' => 'OutputFile',
143 'RightSubSuperscriptElement' => 'MathElement',
144 'Save' => 'Task',
145 'SaveShape' => 'Task',
146 'SaveSlide' => 'Task',
147 'ScatterChartDataPoint' => 'DataPoint',
148 'ScatterSeries' => 'XYSeries',
149 'Section' => 'ResourceBase',
150 'SectionZoomFrame' => 'ZoomObject',
151 'Sections' => 'ResourceBase',
152 'Shape' => 'GeometryShape',
153 'ShapeBase' => 'ResourceBase',
154 'Shapes' => 'ResourceBase',
155 'Slide' => 'ResourceBase',
156 'SlideAnimation' => 'ResourceBase',
157 'SlideBackground' => 'ResourceBase',
158 'SlideComment' => 'SlideCommentBase',
159 'SlideComments' => 'ResourceBase',
160 'SlideModernComment' => 'SlideCommentBase',
161 'SlideProperties' => 'ResourceBase',
162 'SlideReplaceResult' => 'Slide',
163 'SlideShowProperties' => 'ResourceBase',
164 'Slides' => 'ResourceBase',
165 'SmartArt' => 'ShapeBase',
166 'SmartArtShape' => 'GeometryShape',
167 'SolidFill' => 'FillFormat',
168 'SplitDocumentResult' => 'ResourceBase',
169 'SubscriptElement' => 'MathElement',
170 'SummaryZoomFrame' => 'ShapeBase',
171 'SummaryZoomSection' => 'SectionZoomFrame',
172 'SuperscriptElement' => 'MathElement',
173 'SvgExportOptions' => 'ExportOptions',
174 'SwfExportOptions' => 'ExportOptions',
175 'Table' => 'ShapeBase',
176 'TextElement' => 'MathElement',
177 'TextItems' => 'ResourceBase',
178 'Theme' => 'ResourceBase',
179 'TiffExportOptions' => 'ImageExportOptionsBase',
180 'TintEffect' => 'ImageTransformEffect',
181 'UpdateBackground' => 'Task',
182 'UpdateShape' => 'Task',
183 'VbaModule' => 'ResourceBase',
184 'VbaProject' => 'ResourceBase',
185 'VideoExportOptions' => 'ExportOptions',
186 'VideoFrame' => 'GeometryShape',
187 'ViewProperties' => 'ResourceBase',
188 'Workbook' => 'DataSource',
189 'XYSeries' => 'Series',
190 'XamlExportOptions' => 'ExportOptions',
191 'XpsExportOptions' => 'ExportOptions',
192 'ZoomFrame' => 'ZoomObject',
193 'ZoomObject' => 'ShapeBase',
194
195 );
196  
197 my %determiners = (
198 'AccentElement' => { 'Type' => 'Accent', },
199 'AccessPermissions' => { },
200 'AddLayoutSlide' => { 'Type' => 'AddLayoutSlide', },
201 'AddMasterSlide' => { 'Type' => 'AddMasterSlide', },
202 'AddShape' => { 'Type' => 'AddShape', },
203 'AddSlide' => { 'Type' => 'AddSlide', },
204 'AlphaBiLevelEffect' => { 'Type' => 'AlphaBiLevel', },
205 'AlphaCeilingEffect' => { 'Type' => 'AlphaCeiling', },
206 'AlphaFloorEffect' => { 'Type' => 'AlphaFloor', },
207 'AlphaInverseEffect' => { 'Type' => 'AlphaInverse', },
208 'AlphaModulateEffect' => { 'Type' => 'AlphaModulate', },
209 'AlphaModulateFixedEffect' => { 'Type' => 'AlphaModulateFixed', },
210 'AlphaReplaceEffect' => { 'Type' => 'AlphaReplace', },
211 'ApiInfo' => { },
212 'ArcToPathSegment' => { 'Type' => 'ArcTo', },
213 'ArrayElement' => { 'Type' => 'Array', },
214 'ArrowHeadProperties' => { },
215 'AudioFrame' => { 'Type' => 'AudioFrame', },
216 'Axes' => { },
217 'Axis' => { },
218 'AxisType' => { },
219 'BarElement' => { 'Type' => 'Bar', },
220 'Base64InputFile' => { 'Type' => 'Base64', },
221 'BiLevelEffect' => { 'Type' => 'BiLevel', },
222 'BlockElement' => { 'Type' => 'Block', },
223 'BlurEffect' => { },
224 'BlurImageEffect' => { 'Type' => 'Blur', },
225 'BorderBoxElement' => { 'Type' => 'BorderBox', },
226 'BoxElement' => { 'Type' => 'Box', },
227 'BubbleChartDataPoint' => { 'Type' => 'Bubble', },
228 'BubbleSeries' => { 'DataPointType' => 'Bubble', },
229 'Camera' => { },
230 'CaptionTrack' => { },
231 'CaptionTracks' => { },
232 'Chart' => { 'Type' => 'Chart', },
233 'ChartCategory' => { },
234 'ChartLinesFormat' => { },
235 'ChartSeriesGroup' => { },
236 'ChartTitle' => { },
237 'ChartWall' => { },
238 'ChartWallType' => { },
239 'ClosePathSegment' => { 'Type' => 'Close', },
240 'ColorChangeEffect' => { 'Type' => 'ColorChange', },
241 'ColorReplaceEffect' => { 'Type' => 'ColorReplace', },
242 'ColorScheme' => { },
243 'CommentAuthor' => { },
244 'CommentAuthors' => { },
245 'CommonSlideViewProperties' => { },
246 'Connector' => { 'Type' => 'Connector', },
247 'CubicBezierToPathSegment' => { 'Type' => 'CubicBezierTo', },
248 'CustomDashPattern' => { },
249 'DataPoint' => { },
250 'DataSource' => { },
251 'DelimiterElement' => { 'Type' => 'Delimiter', },
252 'DiscUsage' => { },
253 'Document' => { },
254 'DocumentProperties' => { },
255 'DocumentProperty' => { },
256 'DocumentReplaceResult' => { },
257 'DrawingGuide' => { },
258 'DuotoneEffect' => { 'Type' => 'Duotone', },
259 'Effect' => { },
260 'EffectFormat' => { },
261 'EntityExists' => { },
262 'Error' => { },
263 'ErrorDetails' => { },
264 'ExportFormat' => { },
265 'ExportOptions' => { },
266 'FileVersion' => { },
267 'FileVersions' => { },
268 'FilesList' => { },
269 'FilesUploadResult' => { },
270 'FillFormat' => { },
271 'FillOverlayEffect' => { },
272 'FillOverlayImageEffect' => { 'Type' => 'FillOverlay', },
273 'FontData' => { },
274 'FontFallbackRule' => { },
275 'FontScheme' => { },
276 'FontSet' => { },
277 'FontSubstRule' => { },
278 'FontsData' => { },
279 'FormatScheme' => { },
280 'FractionElement' => { 'Type' => 'Fraction', },
281 'FunctionElement' => { 'Type' => 'Function', },
282 'GeometryPath' => { },
283 'GeometryPaths' => { },
284 'GeometryShape' => { },
285 'GifExportOptions' => { 'Format' => 'gif', },
286 'GlowEffect' => { },
287 'GradientFill' => { 'Type' => 'Gradient', },
288 'GradientFillStop' => { },
289 'GraphicalObject' => { 'Type' => 'GraphicalObject', },
290 'GrayScaleEffect' => { 'Type' => 'GrayScale', },
291 'GroupShape' => { 'Type' => 'GroupShape', },
292 'GroupingCharacterElement' => { 'Type' => 'GroupingCharacter', },
293 'HandoutLayoutingOptions' => { 'LayoutType' => 'Handout', },
294 'HeaderFooter' => { },
295 'HslEffect' => { 'Type' => 'Hsl', },
296 'Html5ExportOptions' => { 'Format' => 'html5', },
297 'HtmlExportOptions' => { 'Format' => 'html', },
298 'Hyperlink' => { },
299 'IShapeExportOptions' => { },
300 'Image' => { },
301 'ImageExportFormat' => { },
302 'ImageExportOptions' => { 'Format' => 'image', },
303 'ImageExportOptionsBase' => { },
304 'ImageTransformEffect' => { },
305 'Images' => { },
306 'InnerShadowEffect' => { },
307 'Input' => { },
308 'InputFile' => { },
309 'InteractiveSequence' => { },
310 'LayoutSlide' => { },
311 'LayoutSlides' => { },
312 'LeftSubSuperscriptElement' => { 'Type' => 'LeftSubSuperscriptElement', },
313 'Legend' => { },
314 'LightRig' => { },
315 'LimitElement' => { 'Type' => 'Limit', },
316 'LineFormat' => { },
317 'LineToPathSegment' => { 'Type' => 'LineTo', },
318 'Literals' => { 'Type' => 'Literals', },
319 'LuminanceEffect' => { 'Type' => 'Luminance', },
320 'MarkdownExportOptions' => { 'Format' => 'md', },
321 'MasterSlide' => { },
322 'MasterSlides' => { },
323 'MathElement' => { },
324 'MathFormat' => { },
325 'MathParagraph' => { },
326 'MatrixElement' => { 'Type' => 'Matrix', },
327 'Merge' => { 'Type' => 'Merge', },
328 'MergingSource' => { },
329 'MoveToPathSegment' => { 'Type' => 'MoveTo', },
330 'NaryOperatorElement' => { 'Type' => 'NaryOperator', },
331 'NoFill' => { 'Type' => 'NoFill', },
332 'NormalViewRestoredProperties' => { },
333 'NotesCommentsLayoutingOptions' => { 'LayoutType' => 'NotesComments', },
334 'NotesSlide' => { },
335 'NotesSlideExportFormat' => { },
336 'NotesSlideHeaderFooter' => { },
337 'ObjectExist' => { },
338 'OleObjectFrame' => { 'Type' => 'OleObjectFrame', },
339 'OneValueChartDataPoint' => { 'Type' => 'OneValue', },
340 'OneValueSeries' => { 'DataPointType' => 'OneValue', },
341 'Operation' => { },
342 'OperationError' => { },
343 'OperationProgress' => { },
344 'OrderedMergeRequest' => { },
345 'OuterShadowEffect' => { },
346 'OutputFile' => { },
347 'Paragraph' => { },
348 'ParagraphFormat' => { },
349 'Paragraphs' => { },
350 'PathInputFile' => { 'Type' => 'Path', },
351 'PathOutputFile' => { 'Type' => 'Path', },
352 'PathSegment' => { },
353 'PatternFill' => { 'Type' => 'Pattern', },
354 'PdfExportOptions' => { 'Format' => 'pdf', },
355 'PdfImportOptions' => { },
356 'PhantomElement' => { 'Type' => 'Phantom', },
357 'PictureFill' => { 'Type' => 'Picture', },
358 'PictureFrame' => { 'Type' => 'PictureFrame', },
359 'Pipeline' => { },
360 'Placeholder' => { },
361 'Placeholders' => { },
362 'PlotArea' => { },
363 'Portion' => { },
364 'PortionFormat' => { },
365 'Portions' => { },
366 'PptxExportOptions' => { 'Format' => 'pptx', },
367 'PresentationToMerge' => { },
368 'PresentationsMergeRequest' => { },
369 'PresetShadowEffect' => { },
370 'ProtectionProperties' => { },
371 'QuadraticBezierToPathSegment' => { 'Type' => 'QuadBezierTo', },
372 'RadicalElement' => { 'Type' => 'Radical', },
373 'ReflectionEffect' => { },
374 'RemoveShape' => { 'Type' => 'RemoveShape', },
375 'RemoveSlide' => { 'Type' => 'RemoveSlide', },
376 'ReorderSlide' => { 'Type' => 'ReoderSlide', },
377 'ReplaceText' => { 'Type' => 'ReplaceText', },
378 'RequestInputFile' => { 'Type' => 'Request', },
379 'ResetSlide' => { 'Type' => 'ResetSlide', },
380 'ResourceBase' => { },
381 'ResourceUri' => { },
382 'ResponseOutputFile' => { 'Type' => 'Response', },
383 'RightSubSuperscriptElement' => { 'Type' => 'RightSubSuperscriptElement', },
384 'Save' => { 'Type' => 'Save', },
385 'SaveShape' => { 'Type' => 'SaveShape', },
386 'SaveSlide' => { 'Type' => 'SaveSlide', },
387 'ScatterChartDataPoint' => { 'Type' => 'Scatter', },
388 'ScatterSeries' => { 'DataPointType' => 'Scatter', },
389 'Section' => { },
390 'SectionZoomFrame' => { 'Type' => 'SectionZoomFrame', },
391 'Sections' => { },
392 'Series' => { },
393 'SeriesMarker' => { },
394 'Shape' => { 'Type' => 'Shape', },
395 'ShapeBase' => { },
396 'ShapeBevel' => { },
397 'ShapeExportFormat' => { },
398 'ShapeImageExportOptions' => { },
399 'ShapeThumbnailBounds' => { },
400 'ShapeType' => { },
401 'Shapes' => { },
402 'ShapesAlignmentType' => { },
403 'Slide' => { },
404 'SlideAnimation' => { },
405 'SlideBackground' => { },
406 'SlideComment' => { 'Type' => 'Regular', },
407 'SlideCommentBase' => { },
408 'SlideComments' => { },
409 'SlideExportFormat' => { },
410 'SlideModernComment' => { 'Type' => 'Modern', },
411 'SlideProperties' => { },
412 'SlideReplaceResult' => { },
413 'SlideShowProperties' => { },
414 'SlideShowTransition' => { },
415 'Slides' => { },
416 'SlidesLayoutOptions' => { },
417 'SmartArt' => { 'Type' => 'SmartArt', },
418 'SmartArtNode' => { },
419 'SmartArtShape' => { 'Type' => 'SmartArtShape', },
420 'SoftEdgeEffect' => { },
421 'SolidFill' => { 'Type' => 'Solid', },
422 'SpecialSlideType' => { },
423 'SplitDocumentResult' => { },
424 'StorageExist' => { },
425 'StorageFile' => { },
426 'SubscriptElement' => { 'Type' => 'SubscriptElement', },
427 'SummaryZoomFrame' => { 'Type' => 'SummaryZoomFrame', },
428 'SummaryZoomSection' => { 'Type' => 'SummaryZoomSection', },
429 'SuperscriptElement' => { 'Type' => 'SuperscriptElement', },
430 'SvgExportOptions' => { 'Format' => 'svg', },
431 'SwfExportOptions' => { 'Format' => 'swf', },
432 'Table' => { 'Type' => 'Table', },
433 'TableCell' => { },
434 'TableCellMergeOptions' => { },
435 'TableCellSplitType' => { },
436 'TableColumn' => { },
437 'TableRow' => { },
438 'Task' => { },
439 'TextBounds' => { },
440 'TextElement' => { 'Type' => 'Text', },
441 'TextFrameFormat' => { },
442 'TextItem' => { },
443 'TextItems' => { },
444 'Theme' => { },
445 'ThreeDFormat' => { },
446 'TiffExportOptions' => { 'Format' => 'tiff', },
447 'TintEffect' => { 'Type' => 'Tint', },
448 'UpdateBackground' => { 'Type' => 'UpdateBackground', },
449 'UpdateShape' => { 'Type' => 'UpdateShape', },
450 'VbaModule' => { },
451 'VbaProject' => { },
452 'VbaReference' => { },
453 'VideoExportOptions' => { 'Format' => 'mpeg4', },
454 'VideoFrame' => { 'Type' => 'VideoFrame', },
455 'ViewProperties' => { },
456 'Workbook' => { 'Type' => 'Workbook', },
457 'XYSeries' => { },
458 'XamlExportOptions' => { 'Format' => 'xaml', },
459 'XpsExportOptions' => { 'Format' => 'xps', },
460 'ZoomFrame' => { 'Type' => 'ZoomFrame', },
461 'ZoomObject' => { },
462 );
463  
464 sub has_class {
465 my ($self, $name) = @_;
466 return exists $determiners{$name};
467 }
468  
469 sub is_subclass {
470 my ($self, $subclass, $class) = @_;
471 if ($subclass eq $class) {
472 return 1;
473 }
474 for(keys %hierarchy) {
475 if ($hierarchy{$_} eq $class && $self->is_subclass($subclass, $_)) {
476 return 1;
477 }
478 }
479 return 0;
480 }
481  
482 sub get_class_name {
483 my ($self, $name, $data) = @_;
484 my $descendant = $self->get_subclass_name($name, $data);
485 if ($descendant) {
486 return $descendant;
487 }
488 return $name;
489 }
490  
491 sub get_subclass_name {
492 my ($self, $name, $data) = @_;
493 for(keys %hierarchy) {
494 if ($hierarchy{$_} eq $name) {
495 my $descendant = $self->get_subclass_name($_, $data);
496 if ($descendant) {
497 return $descendant;
498 }
499 if ($self->is_instance_of($_, $data)) {
500 return $_;
501 }
502 }
503 }
504 return "";
505 }
506  
507 sub is_instance_of {
508 my ($self, $name, $data) = @_;
509 if (!exists $determiners{$name} || !keys %{$determiners{$name}}) {
510 return 0;
511 }
512 my $data_decoded = $data;
513 if (ref $data ne "HASH") {
514 $data_decoded = decode_json($data);
515 }
516 for(keys %{$determiners{$name}}) {
517 if (!$self->value_exists($_, ${$determiners{$name}}{$_}, $data_decoded)) {
518 return 0;
519 }
520 }
521 return 1;
522 }
523  
524 sub value_exists {
525 my ($self, $key, $value, $data) = @_;
526 if (%$data{$key} && %$data{$key} eq $value) {
527 return 1;
528 }
529 my $lckey = lcfirst($key);
530 if (%$data{$lckey} && %$data{$lckey} eq $value) {
531 return 1;
532 }
533 my $uckey = ucfirst($key);
534 if (%$data{$uckey} && %$data{$uckey} eq $value) {
535 return 1;
536 }
537 return 0;
538 }
539  
540 1;