001 /*
002 * Copyright (C) 2014 XStream Committers.
003 * All rights reserved.
004 *
005 * Created on 09. January 2014 by Joerg Schaible
006 */
007 package com.thoughtworks.xstream.security;
008
009 import com.thoughtworks.xstream.mapper.Mapper;
010
011 /**
012 * Permission for <code>null</code> or XStream's null replacement type.
013 *
014 * @author Jörg Schaible
015 * @since 1.4.7
016 */
017 public 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 }