com.intuit.ipp.query.MyMethodInterceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ipp-v3-java-devkit Show documentation
Show all versions of ipp-v3-java-devkit Show documentation
IPP Java V3 DevKit Project - Core
The newest version!
/*******************************************************************************
* Copyright (c) 2017 Intuit
*
* 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 com.intuit.ipp.query;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import com.intuit.ipp.exception.FMSException;
import com.intuit.ipp.util.Logger;
import net.bytebuddy.implementation.bind.annotation.*;
/**
* For intercepting method and adding the name of method called in threadlocal stringbuilder.
*
* @author lokeshg
*
*/
public class MyMethodInterceptor {
/**
* logger instance
*/
private static final org.slf4j.Logger LOG = Logger.getLogger();
/**
* variable NUM_3
*/
private static final int NUM_3 = 3;
/**
* variable NUM_2
*/
private static final int NUM_2 = 2;
/**
* variable CLASSNAME_SPLIT_PATTERN
*/
private static final String CLASSNAME_SPLIT_PATTERN = "\\$";
/**
* Constructor MyMethodInterceptor
*
*/
public MyMethodInterceptor() {
}
@RuntimeType
public Object intercept(@This Object proxyObject, @Origin Method method, @AllArguments Object[] methodArgs, @SuperMethod(nullIfImpossible = true) Method superMethod) throws FMSException {
if (GenerateQuery.path.get() == null) {
GenerateQuery.path.set(new Path