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

io.micronaut.http.server.ExecutableRouteInfo Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2017-2021 original authors
 *
 * 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
 *
 * https://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 io.micronaut.http.server;

import io.micronaut.core.annotation.AnnotationMetadata;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.type.Argument;
import io.micronaut.core.type.ReturnType;
import io.micronaut.http.body.MessageBodyHandlerRegistry;
import io.micronaut.inject.ExecutableMethod;
import io.micronaut.inject.MethodReference;
import io.micronaut.web.router.DefaultRouteInfo;

import java.lang.reflect.Method;
import java.util.List;

class ExecutableRouteInfo extends DefaultRouteInfo implements MethodReference {

    private final ExecutableMethod method;

    ExecutableRouteInfo(ExecutableMethod method,
                        boolean errorRoute) {
        super(method, method.getReturnType(), List.of(), List.of(), method.getDeclaringType(), errorRoute, false, MessageBodyHandlerRegistry.EMPTY);
        this.method = method;
    }

    @Override
    public Argument[] getArguments() {
        return method.getArguments();
    }

    @Override
    public Method getTargetMethod() {
        return method.getTargetMethod();
    }

    @Override
    public ReturnType getReturnType() {
        return method.getReturnType();
    }

    @Override
    public Class getDeclaringType() {
        return method.getDeclaringType();
    }

    @Override
    public String getMethodName() {
        return method.getMethodName();
    }

    @Override
    @NonNull
    public AnnotationMetadata getAnnotationMetadata() {
        return method.getAnnotationMetadata();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy