net.openhft.chronicle.wire.GenerateMethodBridge Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2016-2022 chronicle.software
*
* https://chronicle.software
*
* 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
*
* 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 net.openhft.chronicle.wire;
import net.openhft.chronicle.bytes.UpdateInterceptor;
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.wire.utils.SourceCodeFormatter;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* This is the GenerateMethodBridge class, extending AbstractClassGenerator with MethodBridgeMetaData.
* The primary purpose of this class is to generate a bridge for a given method, helping in the dynamic creation of objects.
*/
public class GenerateMethodBridge extends AbstractClassGenerator {
// List containing the field names.
private List fnameList;
/**
* Default constructor initializing with new MethodBridgeMetaData.
*/
public GenerateMethodBridge() {
super(new MethodBridgeMetaData());
}
/**
* Creates a bridge for the provided destination type.
*
* @param destType The class type for which a bridge is to be created.
* @param toInvoke List of objects to be invoked.
* @param ui The UpdateInterceptor instance, it can be null.
* @return The created bridge object for the specified destination type.
*/
public static Object bridgeFor(Class> destType, List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy