ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/jasper/compiler/BeanRepository.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/jasper/compiler/BeanRepository.java
Status
scanned
Type
file
Name
BeanRepository.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2339 (2.3 KB)
MD5
88c3edb562a285aa5ee076157d8ecbc1
SHA1
44f24407ed7db7b38a5742de91399d01be42ce84
SHA256
cd4e6b0a1e9c2ca68e63f81799d9504143cf174630c6f28b6c792f3d39675580
SHA512

      
    
SHA1_git
10d7da7a6b49f668d9953dca2e2009d407210009
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
BeanRepository.java | 2.3 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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 org.apache.jasper.compiler; import java.util.HashMap; import org.apache.jasper.JasperException; /** * Repository of {page, request, session, application}-scoped beans */ public class BeanRepository { private final HashMap<String,String> beanTypes; private final ClassLoader loader; private final ErrorDispatcher errDispatcher; /** * Constructor. * * @param loader The class loader * @param err The error dispatcher that will be used to report errors */ public BeanRepository(ClassLoader loader, ErrorDispatcher err) { this.loader = loader; this.errDispatcher = err; beanTypes = new HashMap<>(); } public void addBean(Node.UseBean n, String s, String type, String scope) throws JasperException { if (!(scope == null || scope.equals("page") || scope.equals("request") || scope.equals("session") || scope.equals("application"))) { errDispatcher.jspError(n, "jsp.error.usebean.badScope"); } beanTypes.put(s, type); } public Class<?> getBeanType(String bean) throws JasperException { Class<?> clazz; try { clazz = loader.loadClass(beanTypes.get(bean)); } catch (ClassNotFoundException ex) { throw new JasperException(ex); } return clazz; } public boolean checkVariable(String bean) { return beanTypes.containsKey(bean); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
45.59
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9