org.ops4j.pax.swissbox.converter.java.io
Class ToPrintStreamConverter

java.lang.Object
  extended by org.ops4j.pax.swissbox.converter.java.io.ToPrintStreamConverter
All Implemented Interfaces:
Converter

public class ToPrintStreamConverter
extends java.lang.Object
implements Converter

JAVADOC

Author:
Alin Dreghiciu (adreghiciu@gmail.com)

Field Summary
static ToPrintStreamConverter INSTANCE
           
 
Constructor Summary
ToPrintStreamConverter()
           
ToPrintStreamConverter(Converter escape)
           
 
Method Summary
 boolean canConvert(java.lang.Object sourceObject, ReifiedType targetType)
          Return if this converter is able to convert the specified object to the specified type.
 java.lang.Object convert(java.lang.Object sourceObject, ReifiedType targetType)
          Convert the specified object to an instance of the specified type.
 java.io.PrintStream convertToPrintStream(java.lang.Object sourceObject, ReifiedType targetType)
           
static ToPrintStreamConverter toPrintStreamConverter()
           
static ToPrintStreamConverter toPrintStreamConverter(Converter escape)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ToPrintStreamConverter INSTANCE
Constructor Detail

ToPrintStreamConverter

public ToPrintStreamConverter()

ToPrintStreamConverter

public ToPrintStreamConverter(Converter escape)
Method Detail

canConvert

public boolean canConvert(java.lang.Object sourceObject,
                          ReifiedType targetType)
Description copied from interface: Converter
Return if this converter is able to convert the specified object to the specified type.

Specified by:
canConvert in interface Converter
Parameters:
sourceObject - The source object s to convert.
targetType - The target type T.
Returns:
true if the conversion is possible, false otherwise.

convert

public java.lang.Object convert(java.lang.Object sourceObject,
                                ReifiedType targetType)
                         throws java.lang.Exception
Description copied from interface: Converter
Convert the specified object to an instance of the specified type.

Specified by:
convert in interface Converter
Parameters:
sourceObject - The source object s to convert.
targetType - The target type T.
Returns:
An instance with a type that is assignable from targetType's raw class
Throws:
java.lang.Exception - If the conversion cannot succeed. This exception should not be thrown when the canConvert method has returned true.

convertToPrintStream

public java.io.PrintStream convertToPrintStream(java.lang.Object sourceObject,
                                                ReifiedType targetType)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

toPrintStreamConverter

public static ToPrintStreamConverter toPrintStreamConverter()

toPrintStreamConverter

public static ToPrintStreamConverter toPrintStreamConverter(Converter escape)


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.