ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/websocket/pojo/PojoPathParam.java

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

      
    
Rootfs path

      
    
Size
2352 (2.3 KB)
MD5
22a15d996dbb891c7c2b992dfeadc955
SHA1
93dab90c9c90198d12ebad781d4514e36c6bef81
SHA256
c427eb2d720d1af4afe96d0a731ce00e12358bef1902b649c75d3ffbc723c431
SHA512

      
    
SHA1_git
d458235ae1a2e8c57f10d62612763e0609c7f318
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
PojoPathParam.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.tomcat.websocket.pojo; import jakarta.websocket.DeploymentException; import org.apache.tomcat.util.res.StringManager; import org.apache.tomcat.websocket.Util; /** * Stores the parameter type and name for a parameter that needs to be passed to an onXxx method of * {@link jakarta.websocket.Endpoint}. The name is only present for parameters annotated with * {@link jakarta.websocket.server.PathParam}. For the {@link jakarta.websocket.Session} and {@link java.lang.Throwable} * parameters, {@link #getName()} will always return <code>null</code>. */ public class PojoPathParam { private static final StringManager sm = StringManager.getManager(PojoPathParam.class); private final Class<?> type; private final String name; public PojoPathParam(Class<?> type, String name) throws DeploymentException { if (name != null) { // Annotated as @PathParam so validate type validateType(type); } this.type = type; this.name = name; } public Class<?> getType() { return type; } public String getName() { return name; } private static void validateType(Class<?> type) throws DeploymentException { if (String.class == type) { return; } if (Util.isPrimitive(type)) { return; } throw new DeploymentException(sm.getString("pojoPathParam.wrongType", type.getName())); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
43.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