File: NoTypePermission.java

package info (click to toggle)
activemq 5.6.0%2Bdfsg-1%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 36,352 kB
  • sloc: java: 280,223; xml: 12,475; jsp: 1,352; sh: 805; ruby: 114; makefile: 11
file content (36 lines) | stat: -rw-r--r-- 764 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (C) 2014 XStream Committers.
 * All rights reserved.
 *
 * Created on 08. January 2014 by Joerg Schaible
 */
package com.thoughtworks.xstream.security;

/**
 * No permission for any type.
 * <p>
 * Can be used to skip any existing default permission.
 * </p>
 * 
 * @author J&ouml;rg Schaible
 * @since 1.4.7
 */
public class NoTypePermission implements TypePermission {

    /**
     * @since 1.4.7
     */
    public static final TypePermission NONE = new NoTypePermission();

    public boolean allows(Class type) {
        throw new ForbiddenClassException(type);
    }

    public int hashCode() {
        return 1;
    }

    public boolean equals(Object obj) {
        return obj != null && obj.getClass() == NoTypePermission.class;
    }
}