Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.opensymphony.xwork2.config.impl;
import com.opensymphony.xwork2.util.PatternMatcher;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.Serializable;
import java.util.*;
/**
*
Matches patterns against pre-compiled wildcard expressions pulled from
* target objects. It uses the wildcard matcher from the Apache Cocoon
* project. Patterns will be matched in the order they were added. The first
* match wins, so more specific patterns should be defined before less specific
* patterns.
*
* @since 2.1
*/
public abstract class AbstractMatcher implements Serializable {
/**
*
The logging instance
*/
private static final Logger log = LogManager.getLogger(AbstractMatcher.class);
/**
*
Handles all wildcard pattern matching.
*/
PatternMatcher
*/
private static class Mapping implements Serializable {
/**
*
The original pattern.
*/
private String original;
/**
*
The compiled pattern.
*/
private Object pattern;
/**
*
The original object.
*/
private E config;
/**
*
Contructs a read-only Mapping instance.
*
* @param original The original pattern
* @param pattern The compiled pattern
* @param config The original object
*/
public Mapping(String original, Object pattern, E config) {
this.original = original;
this.pattern = pattern;
this.config = config;
}
/**
*
Gets the compiled wildcard pattern.
*
* @return The compiled pattern
*/
public Object getPattern() {
return this.pattern;
}
/**
*
Gets the object that contains the pattern.
*
* @return The associated object
*/
public E getTarget() {
return this.config;
}
/**
*
Gets the original wildcard pattern.
*
* @return The original pattern
*/
public String getOriginalPattern() {
return this.original;
}
}
}