Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2008, Red Hat Middleware LLC, and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors. 
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.jboss.security.acl.config;
 
 import java.util.Set;
 
 

A container for holding the contents parsed from a <acl-definition> section of jboss-acl.xml.

Author(s):
Stefan Guilhen
 
 public class ACLDefinition implements GenericValueContainer
 {
 
    private static Logger logger = Logger.getLogger(ACLDefinition.class);
 
    private String resource;
 
    private String baseResource;
 
    private final Set<ACLEntryentries = new HashSet<ACLEntry>();
 
    /*
     * (non-Javadoc)
     * 
     * @see org.jboss.xb.binding.GenericValueContainer#addChild(javax.xml.namespace.QName, java.lang.Object)
     */
    public void addChild(QName nameObject value)
    {
       .debug("addChild: name=" + name + ", value=" + value);
 
       if ("resource".equals(name.getLocalPart()))
       {
          this. = (Stringvalue;
       }
       else if ("extends".equals(name.getLocalPart()))
       {
          this. = (Stringvalue;
       }
    }
 
    /*
     * (non-Javadoc)
     * 
     * @see org.jboss.xb.binding.GenericValueContainer#instantiate()
     */
    public Object instantiate()
    {
       return this;
    }
 
    /*
     * (non-Javadoc)
     * 
     * @see org.jboss.xb.binding.GenericValueContainer#getTargetClass()
     */
    public Class<?> getTargetClass()
    {
       return ACLDefinition.class;
    }

   

Adds a parsed ACLEntry to the list of entries of this ACLDefinition.

Parameters:
entry the ACLEntry to be added.
 
    public void addACLEntry(Object entry)
    {
       .debug("addEntry: " + entry);
      if (entry instanceof ACLEntry)
         this..add((ACLEntryentry);
   }

   

Obtains the configured <acl-definition> resource.

Returns:
a String containing the resource as configured in the XML file.
   public String getResource()
   {
      return ;
   }

   

Obtains the configured <acl-definition> base-resource, as per the extends attribute in the XML file.

Returns:
a String containing the base-resource as configured in the XML file, or null if no base resource is available.
   public String getBaseResource()
   {
      return ;
   }

   

Obtains the ACL entries that have been configured in this ACL definition.

Returns:
a List<ACLEntry> containing the configured entries.
   public Set<ACLEntrygetEntries()
   {
      return ;
   }
   /*
    * (non-Javadoc)
    * 
    * @see java.lang.Object#equals(java.lang.Object)
    */
   public boolean equals(Object obj)
   {
      if (obj instanceof ACLDefinition)
      {
         ACLDefinition other = (ACLDefinitionobj;
         return this..equals(other.resource);
      }
      return false;
   }
   /*
    * (non-Javadoc)
    * 
    * @see java.lang.Object#hashCode()
    */
   public int hashCode()
   {
      return this..hashCode();
   }
New to GrepCode? Check out our FAQ X