com.google.api.generator.engine.ast.VariableExpr Maven / Gradle / Ivy
// Copyright 2020 Google LLC
//
// 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 com.google.api.generator.engine.ast;
import com.google.api.generator.engine.lexicon.Keyword;
import com.google.auto.value.AutoValue;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
@AutoValue
public abstract class VariableExpr implements Expr {
public abstract Variable variable();
@Nullable
public abstract Expr exprReferenceExpr();
@Nullable
public abstract TypeNode staticReferenceType();
/** Variable declaration fields. */
public abstract boolean isDecl();
public abstract ScopeNode scope();
public abstract boolean isStatic();
public abstract boolean isFinal();
public abstract boolean isVolatile();
// Optional
public abstract ImmutableList annotations();
// Please use this only in conjunction with methods.
// Supports only parameterized types like Map.
// TODO(unsupported): Fully generic arguments, e.g. foobar(K key, V value).
// This list can contain only IdentifierNode or TypeNode.
public abstract ImmutableList templateNodes();
// Private.
// Can either contain String or TypeNode objects.
abstract ImmutableList
© 2015 - 2024 Weber Informatics LLC | Privacy Policy