org.granite.messaging.amf.io
Class RegexAMF3DeserializerSecurizer

java.lang.Object
  extended by org.granite.messaging.amf.io.RegexAMF3DeserializerSecurizer
All Implemented Interfaces:
AMF3DeserializerSecurizer

public class RegexAMF3DeserializerSecurizer
extends Object
implements AMF3DeserializerSecurizer

A default implementation of the securizer interface that prevents arbitrary class instantiation based on a regex pattern.

Author:
Franck WOLFF

Constructor Summary
RegexAMF3DeserializerSecurizer()
           
 
Method Summary
 boolean allowInstantiation(String className)
          Checks if the given class name isn't matched by the configured pattern.
 String getParam()
          Return this securizer pattern.
 void setParam(String param)
          Set this securizer pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexAMF3DeserializerSecurizer

public RegexAMF3DeserializerSecurizer()
Method Detail

allowInstantiation

public boolean allowInstantiation(String className)
Checks if the given class name isn't matched by the configured pattern. Note that null or empty class names are allowed.

Specified by:
allowInstantiation in interface AMF3DeserializerSecurizer
Parameters:
className - the class to check.
Returns:
true if the given class name is allowed to be instantiated, false otherwise.

setParam

public void setParam(String param)
Set this securizer pattern. Note that you may use whitespaces in your pattern in order to improve readability: theses extra characters will be ignored.

Specified by:
setParam in interface AMF3DeserializerSecurizer
Parameters:
param - a regex containing allowed class name patterns.
Throws:
PatternSyntaxException - if the given value isn't a valid regex pattern.

getParam

public String getParam()
Return this securizer pattern.

Specified by:
getParam in interface AMF3DeserializerSecurizer
Returns:
this securizer pattern.