01: /*
02: * Copyright (C) 2007 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 13. July 2007 by Guilherme Silveira
10: */
11: package com.thoughtworks.xstream.builder.processor;
12:
13: import com.thoughtworks.xstream.XStream;
14:
15: /**
16: * A processor which omits a field.
17: *
18: * @author Guilherme Silveira
19: */
20: public class IgnoreFieldProcessor implements TypeConfigProcessor {
21:
22: private final String fieldName;
23:
24: public IgnoreFieldProcessor(String fieldName) {
25: this .fieldName = fieldName;
26: }
27:
28: public void process(XStream instance, Class type) {
29: instance.omitField(type, fieldName);
30: }
31:
32: }
|