All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.glassfish.jaxb.runtime.v2.runtime.reflect.opt.TransducedAccessor_field_Integer Maven / Gradle / Ivy

There is a newer version: 4.0.5
Show newest version
/*
 * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0, which is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package org.glassfish.jaxb.runtime.v2.runtime.reflect.opt;

import org.glassfish.jaxb.runtime.DatatypeConverterImpl;
import org.glassfish.jaxb.runtime.api.AccessorException;
import org.glassfish.jaxb.runtime.v2.runtime.Name;
import org.glassfish.jaxb.runtime.v2.runtime.XMLSerializer;
import org.glassfish.jaxb.runtime.v2.runtime.reflect.DefaultTransducedAccessor;
import org.glassfish.jaxb.runtime.v2.runtime.reflect.TransducedAccessor;
import org.xml.sax.SAXException;

import javax.xml.stream.XMLStreamException;
import java.io.IOException;

/**
 * Template {@link TransducedAccessor} for a byte field.
 *
 * 

* All the TransducedAccessor_field are generated from TransducedAccessor_field_Byte * * @author Kohsuke Kawaguchi * * @see TransducedAccessor#get */ @SuppressWarnings({"deprecation"}) public final class TransducedAccessor_field_Integer extends DefaultTransducedAccessor { @Override public String print(T o) { return DatatypeConverterImpl._printInt( ((Bean)o).f_int ); } @Override public void parse(T o, CharSequence lexical) { ((Bean)o).f_int=DatatypeConverterImpl._parseInt(lexical); } @Override public boolean hasValue(T o) { return true; } @Override public void writeLeafElement(XMLSerializer w, Name tagName, T o, String fieldName) throws SAXException, AccessorException, IOException, XMLStreamException { w.leafElement(tagName, ((Bean)o).f_int, fieldName ); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy