Class RegExpTypePermission

java.lang.Object
com.thoughtworks.xstream.security.RegExpTypePermission
All Implemented Interfaces:
TypePermission
Direct Known Subclasses:
WildcardTypePermission

public class RegExpTypePermission extends Object implements TypePermission
Permission for any type with a name matching one of the provided regular expressions.
Since:
1.4.7
  • Field Details

    • patterns

      private final Pattern[] patterns
  • Constructor Details

    • RegExpTypePermission

      public RegExpTypePermission(String[] patterns)
    • RegExpTypePermission

      public RegExpTypePermission(Pattern[] patterns)
  • Method Details

    • allows

      public boolean allows(Class type)
      Description copied from interface: TypePermission
      Check permission for a provided type.
      Specified by:
      allows in interface TypePermission
      Parameters:
      type - the type to check
      Returns:
      true if provided type is allowed, false if permission does not handle the type
    • getPatterns

      private static Pattern[] getPatterns(String[] patterns)