001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2008 Sun Microsystems, Inc. 025 */ 026package org.forgerock.opendj.config; 027 028/** 029 * A visitor of default behavior providers, in the style of the visitor design 030 * pattern. Classes implementing this interface can query default behavior 031 * providers in a type-safe manner when the kind of default behavior provider is 032 * unknown at compile time. When a visitor is passed to a default behavior 033 * provider's accept method, the corresponding visit method most applicable to 034 * that default behavior provider is invoked. 035 * 036 * @param <T> 037 * The type of values represented by the default value provider. 038 * @param <R> 039 * The return type of this visitor's methods. Use 040 * {@link java.lang.Void} for visitors that do not need to return 041 * results. 042 * @param <P> 043 * The type of the additional parameter to this visitor's methods. 044 * Use {@link java.lang.Void} for visitors that do not need an 045 * additional parameter. 046 */ 047public interface DefaultBehaviorProviderVisitor<T, R, P> { 048 049 /** 050 * Visit an absolute inherited default behavior provider. 051 * 052 * @param d 053 * The absolute inherited default behavior provider to visit. 054 * @param p 055 * A visitor specified parameter. 056 * @return Returns a visitor specified result. 057 */ 058 R visitAbsoluteInherited(AbsoluteInheritedDefaultBehaviorProvider<T> d, P p); 059 060 /** 061 * Visit an alias default behavior provider. 062 * 063 * @param d 064 * The alias default behavior provider to visit. 065 * @param p 066 * A visitor specified parameter. 067 * @return Returns a visitor specified result. 068 */ 069 R visitAlias(AliasDefaultBehaviorProvider<T> d, P p); 070 071 /** 072 * Visit an defined default behavior provider. 073 * 074 * @param d 075 * The defined default behavior provider to visit. 076 * @param p 077 * A visitor specified parameter. 078 * @return Returns a visitor specified result. 079 */ 080 R visitDefined(DefinedDefaultBehaviorProvider<T> d, P p); 081 082 /** 083 * Visit a relative inherited default behavior provider. 084 * 085 * @param d 086 * The relative inherited default behavior provider to visit. 087 * @param p 088 * A visitor specified parameter. 089 * @return Returns a visitor specified result. 090 */ 091 R visitRelativeInherited(RelativeInheritedDefaultBehaviorProvider<T> d, P p); 092 093 /** 094 * Visit an undefined default behavior provider. 095 * 096 * @param d 097 * The undefined default behavior provider to visit. 098 * @param p 099 * A visitor specified parameter. 100 * @return Returns a visitor specified result. 101 */ 102 R visitUndefined(UndefinedDefaultBehaviorProvider<T> d, P p); 103 104}