com.wewebu.ow.server.ecmimpl.cmis.util
Class OwCMISSameTypeConverter<S>

java.lang.Object
  extended by com.wewebu.ow.server.ecmimpl.cmis.util.OwCMISSameTypeConverter<S>
All Implemented Interfaces:
OwCMISValueConverter<S,S>, OwCMISValueConverterClass<S,S>

public class OwCMISSameTypeConverter<S>
extends Object
implements OwCMISValueConverter<S,S>, OwCMISValueConverterClass<S,S>

OwCMISSameTypeConverter. Simple list to array converter or list to single value, and vis versa.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Constructor Summary
OwCMISSameTypeConverter(Class<S> oClass_p)
           
 
Method Summary
 List<S> fromArrayValue(S[] owdValue_p)
          Converts the array back from type O to a list of type L.
 List<S> fromValue(S owdValue_p)
          Vice-versa conversion to OwCMISValueConverter.toValue(List).
 OwCMISValueConverterClass<S,S> getConverterClass()
           
 Class<S> getOClass()
          Return the java.lang.Class which should be the resulting type at end of conversion.
 OwCMISValueConverter<S,S> newConverter(OwCMISNetwork network_p)
           
 S[] toArrayValue(List<S> cmisValue_p)
          Converts the list into an array of the resulting type.
 S[] toStaticArrayValue(List<S> cmisValue_p)
          Statically converts the list into an array of the resulting type.
 S toStaticValue(List<S> cmisValue_p)
          Return a statically-created (non OwCMISNetwork depended) representation of the given List as type O or simply converts the first entry of the list into the resulting type.
 S toValue(List<S> cmisValue_p)
          Return a representation of the given List as type O, or simply converts the first entry of the list into the resulting type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwCMISSameTypeConverter

public OwCMISSameTypeConverter(Class<S> oClass_p)
Method Detail

fromArrayValue

public List<S> fromArrayValue(S[] owdValue_p)
Description copied from interface: OwCMISValueConverter
Converts the array back from type O to a list of type L.

Specified by:
fromArrayValue in interface OwCMISValueConverter<S,S>
Parameters:
owdValue_p - array of resulting type, can be null
Returns:
a list of base types, or empty list

fromValue

public List<S> fromValue(S owdValue_p)
Description copied from interface: OwCMISValueConverter
Vice-versa conversion to OwCMISValueConverter.toValue(List).

Specified by:
fromValue in interface OwCMISValueConverter<S,S>
Parameters:
owdValue_p - O resulting type, can be null
Returns:
List of base types, or empty list

toArrayValue

public S[] toArrayValue(List<S> cmisValue_p)
Description copied from interface: OwCMISValueConverter
Converts the list into an array of the resulting type.

Specified by:
toArrayValue in interface OwCMISValueConverter<S,S>
Parameters:
cmisValue_p - List to be converted
Returns:
Array type O, or null

toValue

public S toValue(List<S> cmisValue_p)
Description copied from interface: OwCMISValueConverter
Return a representation of the given List as type O, or simply converts the first entry of the list into the resulting type.

Specified by:
toValue in interface OwCMISValueConverter<S,S>
Parameters:
cmisValue_p - List of values to convert
Returns:
Resulting type or null

getOClass

public Class<S> getOClass()
Description copied from interface: OwCMISValueConverterClass
Return the java.lang.Class which should be the resulting type at end of conversion.

Specified by:
getOClass in interface OwCMISValueConverterClass<S,S>
Returns:
Class

newConverter

public OwCMISValueConverter<S,S> newConverter(OwCMISNetwork network_p)
Specified by:
newConverter in interface OwCMISValueConverterClass<S,S>
Parameters:
network_p - the OwCMISNetwork that the resulting converter depends on
Returns:
a converter object corresponding to this converter-class object

toStaticArrayValue

public S[] toStaticArrayValue(List<S> cmisValue_p)
Description copied from interface: OwCMISValueConverterClass
Statically converts the list into an array of the resulting type. The conversion is non OwCMISNetwork depended.

Specified by:
toStaticArrayValue in interface OwCMISValueConverterClass<S,S>
Parameters:
cmisValue_p - List to be converted
Returns:
Array type O, or null

toStaticValue

public S toStaticValue(List<S> cmisValue_p)
Description copied from interface: OwCMISValueConverterClass
Return a statically-created (non OwCMISNetwork depended) representation of the given List as type O or simply converts the first entry of the list into the resulting type.

Specified by:
toStaticValue in interface OwCMISValueConverterClass<S,S>
Parameters:
cmisValue_p - List of values to convert
Returns:
Resulting type or null

getConverterClass

public OwCMISValueConverterClass<S,S> getConverterClass()
Specified by:
getConverterClass in interface OwCMISValueConverter<S,S>
Returns:
the class/definition object of this converter


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.