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

org.babyfish.jimmer.client.runtime.Metadata Maven / Gradle / Ivy

There is a newer version: 0.9.35
Show newest version
package org.babyfish.jimmer.client.runtime;

import org.babyfish.jimmer.client.meta.TypeName;
import org.babyfish.jimmer.client.runtime.impl.MetadataBuilder;
import org.jetbrains.annotations.Nullable;

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface Metadata {

    boolean isGenericSupported();

    Map> getPathMap();

    List getServices();

    List getFetchedTypes();

    List getDynamicTypes();

    List getEmbeddableTypes();

    List getStaticTypes();

    List getEnumTypes();

    Type getType(Class type);

    static Builder newBuilder() {
        return new MetadataBuilder();
    }

    interface Builder {

        Builder setOperationParser(OperationParser operationParser);

        Builder setParameterParser(ParameterParser parameterParser);

        Builder setGroups(Collection groups);

        Builder setGenericSupported(boolean genericSupported);

        Builder setUriPrefix(String uriPrefix);

        Builder setControllerNullityChecked(boolean checked);

        Builder setVirtualTypeMap(Map virtualTypeMap);

        Builder addIgnoredParameterTypes(Class... types);

        Builder addIllegalReturnTypes(Class... types);

        Builder addIgnoredParameterTypeNames(String ... typeNames);

        Builder addIllegalReturnTypeNames(String ... typeNames);

        Metadata build();
    }

    interface OperationParser {

        String uri(AnnotatedElement element);

        Operation.HttpMethod[] http(Method method);

        boolean isStream(Method method);
    }

    interface ParameterParser {

        @Nullable
        String requestHeader(Parameter javaParameter);

        @Nullable
        String requestParam(Parameter javaParameter);

        @Nullable
        String pathVariable(Parameter javaParameter);

        @Nullable
        String requestPart(Parameter javaParameter);

        @Nullable
        String defaultValue(Parameter javaParameter);

        boolean isOptional(Parameter javaParameter);

        boolean isRequestBody(Parameter javaParameter);

        boolean isRequestPartRequired(Parameter javaParameter);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy