Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.commands
Class AbstractParameterValueConverter


java.lang.Object
  extended by 
org.eclipse.core.commands.AbstractParameterValueConverter

public abstract class AbstractParameterValueConverter
extends Object

Supports conversion between objects and strings for command parameter values. Extenders must produce strings that identify objects (of a specific command parameter type) as well as consume the strings to locate and return the objects they identify.

This class offers multiple handlers of a command a consistent way of converting string parameter values into the objects that the handlers would prefer to deal with. This class also gives clients a way to serialize object parameters as strings so that entire parameterized commands can be serialized, stored and later deserialized and executed.

This class will typically be extended so the subclass can be referenced from the converter attribute of the commandParameterType elemement of the org.eclipse.ui.commands extension-point. Objects implementing this interface may also be passed directly to ParameterType.define(String, AbstractParameterValueConverter) by clients.

Since:
3.2
See Also:
ParameterType.define(String, AbstractParameterValueConverter), ParameterizedCommand.serialize()

Constructor Summary
AbstractParameterValueConverter ()
           
 
Method Summary
abstract   Object convertToObject ( String parameterValue)
          Converts a string encoded command parameter value into the parameter value object.
abstract   String convertToString ( Object parameterValue)
          Converts a command parameter value object into a string that encodes a reference to the object or serialization of the object.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractParameterValueConverter

public AbstractParameterValueConverter()
Method Detail

convertToObject

public abstract 
Object convertToObject(
String parameterValue)
                                throws 
ParameterValueConversionException
Converts a string encoded command parameter value into the parameter value object.

Parameters:
parameterValue - a command parameter value string describing an object; may be null
Returns:
the object described by the command parameter value string; may be null
Throws:
ParameterValueConversionException - if an object cannot be produced from the parameterValue string

convertToString

public abstract 
String convertToString(
Object parameterValue)
                                throws 
ParameterValueConversionException
Converts a command parameter value object into a string that encodes a reference to the object or serialization of the object.

Parameters:
parameterValue - an object to convert into an identifying string; may be null
Returns:
a string describing the provided object; may be null
Throws:
ParameterValueConversionException - if a string reference or serialization cannot be provided for the parameterValue

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire