001/*
002 * Copyright 2015-2018 Ping Identity Corporation
003 *
004 * This program is free software; you can redistribute it and/or modify
005 * it under the terms of the GNU General Public License (GPLv2 only)
006 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
007 * as published by the Free Software Foundation.
008 *
009 * This program is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012 * GNU General Public License for more details.
013 *
014 * You should have received a copy of the GNU General Public License
015 * along with this program; if not, see <http://www.gnu.org/licenses>.
016 */
017
018package com.unboundid.scim2.server.utils;
019
020import com.unboundid.scim2.common.Path;
021import com.unboundid.scim2.common.types.AttributeDefinition;
022import com.unboundid.scim2.common.utils.FilterEvaluator;
023
024/**
025 * A schema aware filter evaluator that respects case sensitivity.
026 */
027public class SchemaAwareFilterEvaluator extends FilterEvaluator
028{
029  private final ResourceTypeDefinition resourceType;
030
031  /**
032   * Create a new schema aware filter evaluator.
033   *
034   * @param resourceType The resource type definition.
035   */
036  public SchemaAwareFilterEvaluator(final ResourceTypeDefinition resourceType)
037  {
038    this.resourceType = resourceType;
039  }
040
041  /**
042   * {@inheritDoc}
043   */
044  @Override
045  protected AttributeDefinition getAttributeDefinition(final Path path)
046  {
047    return resourceType.getAttributeDefinition(path);
048  }
049}