All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.juneau.remote.RemoteInterfaceMethod Maven / Gradle / Ivy

There is a newer version: 9.0.1
Show newest version
// ***************************************************************************************************************************
// * 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.juneau.remote;

import static org.apache.juneau.internal.StringUtils.*;

import java.lang.reflect.*;

import org.apache.juneau.internal.*;

/**
 * Contains the meta-data about a Java method on a remote class.
 *
 * 

* Captures the information in {@link RemoteInterface @RemoteInterface} annotations for caching and reuse. * *

See Also:
*
    *
*/ public class RemoteInterfaceMethod { private final String url, path; private final Method method; /** * Constructor. * * @param restUrl The absolute URL of the REST interface backing the interface proxy. * @param m The Java method. */ public RemoteInterfaceMethod(final String restUrl, Method m) { this.method = m; this.path = m.getName() + '/' + HttpUtils.getMethodArgsSignature(m, true); this.url = trimSlashes(restUrl) + '/' + urlEncode(path); } /** * Returns the absolute URL of the REST interface invoked by this Java method. * * @return The absolute URL of the REST interface, never null. */ public String getUrl() { return url; } /** * Returns the HTTP path of this method. * * @return * The HTTP path of this method relative to the parent interface. *
Never null. *
Never has leading or trailing slashes. */ public String getPath() { return path; } /** * Returns the underlying Java method that this metadata is about. * * @return * The underlying Java method that this metadata is about. *
Never null. */ public Method getJavaMethod() { return method; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy