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
10 * http://www.apache.org/licenses/LICENSE-2.0
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
20 package org.apache.thrift.meta_data {
22 import flash.utils.Dictionary;
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.
29 public class FieldMetaData {
31 public var fieldName:String;
32 public var requirementType:int;
33 public var valueMetaData:FieldValueMetaData;
35 private static var structMap:Dictionary = new Dictionary();
37 public function FieldMetaData(name:String, req:int, vMetaData:FieldValueMetaData) {
38 this.fieldName = name;
39 this.requirementType = req;
40 this.valueMetaData = vMetaData;
43 public static function addStructMetaDataMap(sClass:Class, map:Dictionary):void{
44 structMap[sClass] = map;
48 * Returns a map with metadata (i.e. instances of FieldMetaData) that
49 * describe the fields of the given class.
51 * @param sClass The TBase class for which the metadata map is requested
53 public static function getStructMetaDataMap(sClass:Class):Dictionary {
54 return structMap[sClass];