01: /*
02: * XML 2 Java Binding (X2JB) - the excellent Java tool.
03: * Copyright 2007, by Richard Opalka.
04: *
05: * This is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU Lesser General Public License as
07: * published by the Free Software Foundation; either version 2.1 of
08: * the License, or (at your option) any later version.
09: *
10: * This software is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this software; if not see the FSF site:
17: * http://www.fsf.org/ and search for the LGPL License document there.
18: */
19: package com.x2jb.bind.provider;
20:
21: import org.x2jb.bind.Binding;
22: import org.x2jb.bind.provider.BindingDefinition;
23:
24: /**
25: * Binding implementation for Java 5 annotations
26: *
27: * @author <a href="mailto:richard_opalka@yahoo.com">Richard Opalka</a>
28: * @version 1.0
29: */
30: final class AnnotationBindingImpl implements BindingDefinition {
31:
32: private final Binding binding;
33:
34: AnnotationBindingImpl(Binding binding) {
35: this .binding = binding;
36: }
37:
38: public final Class getTypeHandler() {
39: Class handlerClass = binding.typeHandler();
40: return handlerClass.equals(Void.class) ? null : handlerClass;
41: }
42:
43: public final String getNodeName() {
44: return binding.nodeName();
45: }
46:
47: public final String getNodeNamespace() {
48: return binding.nodeNamespace();
49: }
50:
51: public final boolean isElementNode() {
52: return binding.isElementNode();
53: }
54:
55: public final boolean isNodeUnique() {
56: return binding.isNodeUnique();
57: }
58:
59: public final boolean isNodeMandatory() {
60: return binding.isNodeMandatory();
61: }
62:
63: }
|