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

com.feilong.lib.xstream.security.NoPermission Maven / Gradle / Ivy

Go to download

feilong is a suite of core and expanded libraries that include utility classes, http, excel,cvs, io classes, and much much more.

There is a newer version: 4.0.8
Show newest version
/*
 * Copyright (C) 2014 XStream Committers.
 * All rights reserved.
 *
 * Created on 09. January 2014 by Joerg Schaible
 */
package com.feilong.lib.xstream.security;

/**
 * Wrapper to negate another type permission.
 * 

* If the wrapped {@link TypePermission} allows the type, this instance will throw a {@link ForbiddenClassException} * instead. An instance of this permission cannot be used to allow a type. *

* * @author Jörg Schaible * @since 1.4.7 */ public class NoPermission implements TypePermission{ private final TypePermission permission; /** * Construct a NoPermission. * * @param permission * the permission to negate or null to forbid any type * @since 1.4.7 */ public NoPermission(final TypePermission permission){ this.permission = permission; } @Override public boolean allows(final Class type){ if (permission == null || permission.allows(type)){ throw new ForbiddenClassException(type); } return false; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy