001/** 002 * Copyright (c) 2015-2022, Michael Yang 杨福海 (fuhai999@gmail.com). 003 * <p> 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * <p> 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * <p> 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package io.jboot.support.swagger; 017 018import io.swagger.models.Swagger; 019import io.swagger.models.parameters.Parameter; 020 021import java.util.ArrayList; 022import java.util.List; 023 024/** 025 * The <code>ReaderContext</code> class is wrapper for the <code>Reader</code> parameters. 026 */ 027public class ReaderContext { 028 029 private Swagger swagger; 030 private Class<?> cls; 031 private String parentPath; 032 private String parentHttpMethod; 033 private boolean readHidden; 034 private List<String> parentConsumes = new ArrayList<>(); 035 private List<String> parentProduces = new ArrayList<>(); 036 private List<String> parentTags = new ArrayList<>(); 037 private List<Parameter> parentParameters = new ArrayList<>(); 038 039 public ReaderContext(Class<?> cls, String parentPath, String parentHttpMethod, 040 boolean readHidden) { 041 setCls(cls); 042 setParentPath(parentPath); 043 setParentHttpMethod(parentHttpMethod); 044 setReadHidden(readHidden); 045 } 046 047 048 public Class<?> getCls() { 049 return cls; 050 } 051 052 public void setCls(Class<?> cls) { 053 this.cls = cls; 054 } 055 056 public String getParentPath() { 057 return parentPath; 058 } 059 060 public void setParentPath(String parentPath) { 061 this.parentPath = parentPath; 062 } 063 064 public String getParentHttpMethod() { 065 return parentHttpMethod; 066 } 067 068 public void setParentHttpMethod(String parentHttpMethod) { 069 this.parentHttpMethod = parentHttpMethod; 070 } 071 072 public boolean isReadHidden() { 073 return readHidden; 074 } 075 076 public void setReadHidden(boolean readHidden) { 077 this.readHidden = readHidden; 078 } 079 080 public List<String> getParentConsumes() { 081 return parentConsumes; 082 } 083 084 public void setParentConsumes(List<String> parentConsumes) { 085 this.parentConsumes = parentConsumes; 086 } 087 088 public List<String> getParentProduces() { 089 return parentProduces; 090 } 091 092 public void setParentProduces(List<String> parentProduces) { 093 this.parentProduces = parentProduces; 094 } 095 096 public List<String> getParentTags() { 097 return parentTags; 098 } 099 100 public void setParentTags(List<String> parentTags) { 101 this.parentTags = parentTags; 102 } 103 104 public List<Parameter> getParentParameters() { 105 return parentParameters; 106 } 107 108 public void setParentParameters(List<Parameter> parentParameters) { 109 this.parentParameters = parentParameters; 110 } 111}