com.sun.xml.txw2.DatatypeWriter Maven / Gradle / Ivy
/*
* Copyright (c) 2005, 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 com.sun.xml.txw2;
import java.util.AbstractList;
import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName;
/**
* Pluggable datatype writer.
*
* @author Kohsuke Kawaguchi
*/
public interface DatatypeWriter {
/**
* Gets the Java class that this writer can write.
*
* @return
* must not be null. Must be the same value always.
*/
Class getType();
/**
* Prints the given datatype object and appends that result
* into the given buffer.
*
* @param dt
* the datatype object to be printed.
* @param resolver
* allows the converter to declare additional namespace prefixes.
* @param buf
* buffer
*/
void print(DT dt, NamespaceResolver resolver, StringBuilder buf);
List> BUILTIN = Collections.unmodifiableList(new AbstractList<>() {
@SuppressWarnings({"unchecked", "rawtypes"})
private DatatypeWriter