]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldMetaData.as
buildsys: switch source download to quincy
[ceph.git] / ceph / src / jaegertracing / thrift / lib / as3 / src / org / apache / thrift / meta_data / FieldMetaData.as
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20 package org.apache.thrift.meta_data {
21
22 import flash.utils.Dictionary;
23
24 /**
25 * This class is used to store meta data about thrift fields. Every field in a
26 * a struct should have a corresponding instance of this class describing it.
27 *
28 */
29 public class FieldMetaData {
30
31 public var fieldName:String;
32 public var requirementType:int;
33 public var valueMetaData:FieldValueMetaData;
34
35 private static var structMap:Dictionary = new Dictionary();
36
37 public function FieldMetaData(name:String, req:int, vMetaData:FieldValueMetaData) {
38 this.fieldName = name;
39 this.requirementType = req;
40 this.valueMetaData = vMetaData;
41 }
42
43 public static function addStructMetaDataMap(sClass:Class, map:Dictionary):void{
44 structMap[sClass] = map;
45 }
46
47 /**
48 * Returns a map with metadata (i.e. instances of FieldMetaData) that
49 * describe the fields of the given class.
50 *
51 * @param sClass The TBase class for which the metadata map is requested
52 */
53 public static function getStructMetaDataMap(sClass:Class):Dictionary {
54 return structMap[sClass];
55 }
56 }
57 }