io.warp10.ext.thrift.DynamicTBaseGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of warp10-ext-thrift Show documentation
Show all versions of warp10-ext-thrift Show documentation
Thrift WarpScript Extension
//
// Copyright 2020 SenX S.A.S.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package io.warp10.ext.thrift;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.thrift.protocol.TType;
import io.warp10.ext.thrift.DynamicType.Modifier;
import io.warp10.ext.thrift.antlr.ThriftParser.Base_typeContext;
import io.warp10.ext.thrift.antlr.ThriftParser.Const_map_entryContext;
import io.warp10.ext.thrift.antlr.ThriftParser.Const_ruleContext;
import io.warp10.ext.thrift.antlr.ThriftParser.Const_valueContext;
import io.warp10.ext.thrift.antlr.ThriftParser.Container_typeContext;
import io.warp10.ext.thrift.antlr.ThriftParser.DefinitionContext;
import io.warp10.ext.thrift.antlr.ThriftParser.DocumentContext;
import io.warp10.ext.thrift.antlr.ThriftParser.Enum_fieldContext;
import io.warp10.ext.thrift.antlr.ThriftParser.Enum_ruleContext;
import io.warp10.ext.thrift.antlr.ThriftParser.FieldContext;
import io.warp10.ext.thrift.antlr.ThriftParser.Field_typeContext;
import io.warp10.ext.thrift.antlr.ThriftParser.StructContext;
import io.warp10.ext.thrift.antlr.ThriftParser.TypedefContext;
import io.warp10.ext.thrift.antlr.ThriftParser.UnionContext;
public class DynamicTBaseGenerator {
private DynamicEnum currentEnum = null;
private int nextOrdinal = 0;
private List currentStructs = new ArrayList();
private Map types = new LinkedHashMap();
public DynamicTBaseGenerator() {
this(null);
}
public DynamicTBaseGenerator(Map