All Downloads are FREE. Search and download functionalities are using the official Maven repository.

delight.rhinosandox.internal.SafeClassShutter Maven / Gradle / Ivy

package delight.rhinosandox.internal;

import java.util.HashSet;
import java.util.Set;
import org.mozilla.javascript.ClassShutter;
import org.mozilla.javascript.EcmaError;

@SuppressWarnings("all")
public class SafeClassShutter implements ClassShutter {
  public final Set allowedClasses;
  
  @Override
  public boolean visibleToScripts(final String fullClassName) {
    boolean _startsWith = fullClassName.startsWith("adapter");
    if (_startsWith) {
      return true;
    }
    return this.allowedClasses.contains(fullClassName);
  }
  
  public SafeClassShutter() {
    HashSet _hashSet = new HashSet();
    this.allowedClasses = _hashSet;
    this.allowedClasses.add(EcmaError.class.getName());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy