| 1 | |
package org.naftulin.configmgr.content; |
| 2 | |
|
| 3 | |
import org.naftulin.configmgr.parsers.ConfigEntryParser; |
| 4 | |
import org.naftulin.configmgr.parsers.XmlFileParserImpl; |
| 5 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
| 6 | |
|
| 7 | |
|
| 8 | |
public class XmlRecordImpl extends AbstractRecordImpl { |
| 9 | |
private String className; |
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
public XmlRecordImpl() { |
| 15 | 10 | super(); |
| 16 | 10 | } |
| 17 | |
|
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
public XmlRecordImpl(final String key, final String fileName, final String className) { |
| 24 | 0 | super(key, fileName); |
| 25 | 0 | this.className = className; |
| 26 | 0 | } |
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
public ConfigEntryParser getParser() { |
| 34 | 5 | return new XmlFileParserImpl(className); |
| 35 | |
} |
| 36 | |
|
| 37 | |
|
| 38 | |
public String getClassName() { |
| 39 | 5 | return className; |
| 40 | |
} |
| 41 | |
|
| 42 | |
public void setClassName(final String className) { |
| 43 | 10 | this.className = className; |
| 44 | 10 | } |
| 45 | |
|
| 46 | |
|
| 47 | |
|
| 48 | |
|
| 49 | |
|
| 50 | |
public String toString() { |
| 51 | 15 | return new ToStringBuilder(this).append("key", this.getKey()).append( |
| 52 | 15 | "parser", this.getParser()).append("fileName", |
| 53 | 10 | this.getFileName()).toString(); |
| 54 | |
} |
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
} |