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

com.kero.security.core.proxy.ProxyWrapper Maven / Gradle / Ivy

Go to download

Kero-Security is a library for statically controlling access to properties of objects / classes.

There is a newer version: 0.1.39
Show newest version
package com.kero.security.core.proxy;

import java.lang.reflect.Modifier;

import com.kero.security.core.config.PreparedAccessConfiguration;
import com.kero.security.core.utils.ByteBuddyClassUtils;

public interface ProxyWrapper {

	public Object wrap(Object obj, PreparedAccessConfiguration pac);

	public static ProxyWrapper create(Class targetClass) {
		
		boolean accessible = ByteBuddyClassUtils.checkAccessible(targetClass);
		
		if(!Modifier.isFinal(targetClass.getModifiers()) && accessible) {
			
			return new SubclassProxyWrapper(targetClass);
		}
		else {
			
			return new AdaptiveProxyWrapper(targetClass);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy