View Javadoc

    1   /* Copyright 2004, 2005 Acegi Technology Pty Limited
    2    *
    3    * Licensed under the Apache License, Version 2.0 (the "License");
    4    * you may not use this file except in compliance with the License.
    5    * You may obtain a copy of the License at
    6    *
    7    *     http://www.apache.org/licenses/LICENSE-2.0
    8    *
    9    * Unless required by applicable law or agreed to in writing, software
    10   * distributed under the License is distributed on an "AS IS" BASIS,
    11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12   * See the License for the specific language governing permissions and
    13   * limitations under the License.
    14   */
    15
    16  package org.acegisecurity.domain.validation;
    17
    18  import java.util.List;
    19
    20
    21  /***
    22   * Indicates a concrete class capable of introspecting a domain object for its
    23   * immediate children.
    24   *
    25   * <p>
    26   * Implementations may use a choice of reflective introspection or querying a
    27   * persistence metadata API to locate the internal children.
    28   * </p>
    29   *
    30   * @author Ben Alex
    31   * @version $Id: IntrospectionManager.java,v 1.3 2005/11/17 00:55:50 benalex Exp $
    32   */
    33  public interface IntrospectionManager {
    34      //~ Methods ================================================================
    35
    36      /***
    37       * Locates any direct children of a domain object.
    38       *
    39       * <p>
    40       * Typically used with a {@link ValidationManager} to validate each of the
    41       * located children.
    42       * </p>
    43       *
    44       * <P>
    45       * Implementations should only add the <b>immediate layer of children</b>.
    46       * Grandchildren, great-grandchildren etc should not be added.
    47       * </p>
    48       *
    49       * @param parentObject the immediate parent which all children should share
    50       *        (guaranteed to never be <code>null</code>)
    51       * @param allObjects the list to which this method should append each
    52       *        immediate child (guaranteed to never be <code>null</code>)
    53       */
    54      public void obtainImmediateChildren(Object parentObject, List<Object> allObjects);
    55  }