/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3.dd;

import java.util.ArrayList;
import java.util.List;
import org.jboss.logging.Logger;

/**
 * Represents an <method-permission> element of the ejb-jar.xml deployment descriptor
 * for the 1.4 schema
 *
 * @author <a href="mailto:bdecoste@jboss.com">William DeCoste</a>
 * @version <tt>$Revision: 1.7.2.3 $</tt>
 */
public class MethodPermission
{
   private static final Logger log = Logger.getLogger(MethodPermission.class);

   private List roleNames = new ArrayList();
   private boolean isUnchecked = false;
   private List<Method> methods = new ArrayList();

   public boolean isUnchecked()
   {
      return isUnchecked;
   }

   public void setUnchecked(boolean isUnchecked)
   {
      this.isUnchecked = isUnchecked;
   }

   public List getRoleNames()
   {
      return roleNames;
   }

   public void addRoleName(String roleName)
   {
      roleNames.add(roleName);
   }

   public List<Method> getMethods()
   {
      return methods;
   }

   public void addMethod(Method method)
   {
      methods.add(method);
   }

   public String toString()
   {
      StringBuffer sb = new StringBuffer(100);
      sb.append("[");
      sb.append("roleNames=").append(roleNames);
      sb.append("]");
      return sb.toString();
   }
}
