001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2015 ForgeRock AS. 015 */ 016 017package org.forgerock.util.query; 018 019import java.util.List; 020 021/** 022 * A base implementation of {@link org.forgerock.util.query.QueryFilterVisitor} where 023 * all methods throw an {@link java.lang.UnsupportedOperationException} by default - 024 * override just the methods you need. 025 * 026 * @see org.forgerock.util.query.QueryFilterVisitor 027 * 028 * @param <R> 029 * The return type of this visitor's methods. Use 030 * {@link java.lang.Void} for visitors that do not need to return 031 * results. 032 * @param <P> 033 * The type of the additional parameter to this visitor's methods. 034 * Use {@link java.lang.Void} for visitors that do not need an 035 * additional parameter. 036 * @param <F> 037 * The type of the field definitions in this visitor's methods. 038 */ 039public abstract class BaseQueryFilterVisitor<R, P, F> implements QueryFilterVisitor<R, P, F> { 040 @Override 041 public R visitAndFilter(P p, List<QueryFilter<F>> subFilters) { 042 throw new UnsupportedOperationException(); 043 } 044 045 @Override 046 public R visitBooleanLiteralFilter(P p, boolean value) { 047 throw new UnsupportedOperationException(); 048 } 049 050 @Override 051 public R visitContainsFilter(P p, F field, Object valueAssertion) { 052 throw new UnsupportedOperationException(); 053 } 054 055 @Override 056 public R visitEqualsFilter(P p, F field, Object valueAssertion) { 057 throw new UnsupportedOperationException(); 058 } 059 060 @Override 061 public R visitExtendedMatchFilter(P p, F field, String operator, Object valueAssertion) { 062 throw new UnsupportedOperationException(); 063 } 064 065 @Override 066 public R visitGreaterThanFilter(P p, F field, Object valueAssertion) { 067 throw new UnsupportedOperationException(); 068 } 069 070 @Override 071 public R visitGreaterThanOrEqualToFilter(P p, F field, Object valueAssertion) { 072 throw new UnsupportedOperationException(); 073 } 074 075 @Override 076 public R visitLessThanFilter(P p, F field, Object valueAssertion) { 077 throw new UnsupportedOperationException(); 078 } 079 080 @Override 081 public R visitLessThanOrEqualToFilter(P p, F field, Object valueAssertion) { 082 throw new UnsupportedOperationException(); 083 } 084 085 @Override 086 public R visitNotFilter(P p, QueryFilter<F> subFilter) { 087 throw new UnsupportedOperationException(); 088 } 089 090 @Override 091 public R visitOrFilter(P p, List<QueryFilter<F>> subFilters) { 092 throw new UnsupportedOperationException(); 093 } 094 095 @Override 096 public R visitPresentFilter(P p, F field) { 097 throw new UnsupportedOperationException(); 098 } 099 100 @Override 101 public R visitStartsWithFilter(P p, F field, Object valueAssertion) { 102 throw new UnsupportedOperationException(); 103 } 104}