001/*
002 * Copyright (C) 2014 XStream Committers.
003 * All rights reserved.
004 *
005 * Created on 09. January 2014 by Joerg Schaible
006 */
007package com.thoughtworks.xstream.security;
008
009import com.thoughtworks.xstream.mapper.Mapper;
010
011/**
012 * Permission for <code>null</code> or XStream's null replacement type.
013 * 
014 * @author J&ouml;rg Schaible
015 * @since 1.4.7
016 */
017public class NullPermission implements TypePermission {
018    /**
019     * @since 1.4.7
020     */
021    public static final TypePermission NULL = new NullPermission();
022
023    public boolean allows(Class type) {
024        return type == null || type == Mapper.Null.class;
025    }
026}