View Javadoc
1   /*
2    * Copyright 2012 Olivier Godineau
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * the License at http://www.apache.org/licenses/LICENSE-2.0
7    * 
8    * Unless required by applicable law or agreed to in writing, software
9    * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11   * License for the specific language governing permissions and limitations under
12   * the License.
13   */
14  package olg.csv.bean.loader.getter.impl;
15  
16  import javax.xml.xpath.XPathExpressionException;
17  
18  import olg.csv.bean.getter.AbstractGetter;
19  import olg.csv.bean.loader.LoadException;
20  import olg.csv.bean.loader.getter.AbstractGetterLoader;
21  
22  import org.w3c.dom.Element;
23  
24  /**
25   * The loader characteristic of the constant getter.
26   * 
27   * @see AbstractGetter#getConstant(String)
28   */
29  public final class ConstantGetterLoader extends AbstractGetterLoader {
30  	/**
31  	 * Constructs a loader bound with the constant node.
32  	 * 
33  	 * @param successor
34  	 *            the next getter loader in the loader chain.
35  	 */
36  	public ConstantGetterLoader(AbstractGetterLoader successor) {
37  		super("constant", successor);
38  
39  	}
40  
41  	@Override
42  	protected AbstractGetter getConcreteGetter(Element node, String defaultValue) throws XPathExpressionException,
43  			LoadException {
44  		return AbstractGetter.getConstant(defaultValue);
45  	}
46  
47  }