TransducedAccessor_field_Integer.java revision 325
0N/A/*
196N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
0N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
0N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A * or visit www.oracle.com if you need additional information or have any
0N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.xml.internal.bind.v2.runtime.reflect.opt;
0N/A
0N/Aimport java.io.IOException;
0N/A
0N/Aimport javax.xml.stream.XMLStreamException;
0N/A
0N/Aimport com.sun.xml.internal.bind.DatatypeConverterImpl;
113N/Aimport com.sun.xml.internal.bind.api.AccessorException;
0N/Aimport com.sun.xml.internal.bind.v2.runtime.Name;
0N/Aimport com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
0N/Aimport com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor;
0N/Aimport com.sun.xml.internal.bind.v2.runtime.reflect.DefaultTransducedAccessor;
0N/A
0N/Aimport org.xml.sax.SAXException;
0N/A
0N/A/**
0N/A * Template {@link TransducedAccessor} for a byte field.
0N/A *
0N/A * <p>
0N/A * All the TransducedAccessor_field are generated from <code>TransducedAccessor_field_B y t e</code>
0N/A *
0N/A * @author Kohsuke Kawaguchi
0N/A *
0N/A * @see TransducedAccessor#get
0N/A */
0N/Apublic final class TransducedAccessor_field_Integer extends DefaultTransducedAccessor {
0N/A public String print(Object o) {
0N/A return DatatypeConverterImpl._printInt( ((Bean)o).f_int );
0N/A }
0N/A
0N/A public void parse(Object o, CharSequence lexical) {
0N/A ((Bean)o).f_int=DatatypeConverterImpl._parseInt(lexical);
0N/A }
0N/A
0N/A public boolean hasValue(Object o) {
0N/A return true;
0N/A }
0N/A
0N/A @Override
0N/A public void writeLeafElement(XMLSerializer w, Name tagName, Object o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException {
0N/A w.leafElement(tagName, ((Bean)o).f_int, fieldName );
0N/A }
0N/A}
0N/A