org.apache.abdera.util
Class AbstractNamedWriter

java.lang.Object
  extended by org.apache.abdera.util.AbstractWriter
      extended by org.apache.abdera.util.AbstractNamedWriter
All Implemented Interfaces:
NamedItem, NamedWriter, Writer
Direct Known Subclasses:
JSONWriter, PrettyWriter

public abstract class AbstractNamedWriter
extends AbstractWriter
implements NamedWriter

Base abstract implementation of NamedWriter


Field Summary
protected  String[] formats
           
protected  String name
           
 
Fields inherited from class org.apache.abdera.util.AbstractWriter
options
 
Constructor Summary
protected AbstractNamedWriter(String name, String... formats)
           
 
Method Summary
 String getName()
           
 String[] getOutputFormats()
          Return a listing of MIME Media formats this NamedWriter is capable of outputting.
 boolean outputsFormat(String mediatype)
          Returns true if the format produced by this writer matches the specified media type
 
Methods inherited from class org.apache.abdera.util.AbstractWriter
finishCompressedOutputStream, getCompressedOutputStream, getDefaultWriterOptions, initDefaultWriterOptions, setDefaultWriterOptions, write, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.writer.Writer
getDefaultWriterOptions, setDefaultWriterOptions, write, write, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 

Field Detail

name

protected final String name

formats

protected final String[] formats
Constructor Detail

AbstractNamedWriter

protected AbstractNamedWriter(String name,
                              String... formats)
Method Detail

getName

public String getName()
Specified by:
getName in interface NamedItem

getOutputFormats

public String[] getOutputFormats()
Description copied from interface: NamedWriter
Return a listing of MIME Media formats this NamedWriter is capable of outputting.

Specified by:
getOutputFormats in interface NamedWriter

outputsFormat

public boolean outputsFormat(String mediatype)
Description copied from interface: NamedWriter
Returns true if the format produced by this writer matches the specified media type

Specified by:
outputsFormat in interface NamedWriter


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.