Eclipse Platform
Release 3.8

org.eclipse.equinox.bidi.advanced
Class STextExpertFactory

java.lang.Object
  extended by org.eclipse.equinox.bidi.advanced.STextExpertFactory

public final class STextExpertFactory
extends Object

Obtains ISTextExpert instances. An ISTextExpert instance (called in short an "expert") provides the advanced methods to process a certain type of structured text, and is thus related to a specific structured text type handler. There are two kinds of experts:

Only the stateful kind can remember the state established by a call to a text processing method and transmit it as initial state in the next call to a text processing method.

In other words, the methods ISTextExpert.getState(), ISTextExpert.setState(java.lang.Object) and ISTextExpert.clearState() of ISTextExpert are inoperative for experts which are not stateful.

Using a stateful expert is more resource intensive, thus not stateful experts should be used when feasible.


Method Summary
static ISTextExpert getExpert()
          Obtains a ISTextExpert instance for processing structured text with a default type handler segmenting the text according to default separators.
static ISTextExpert getExpert(String type)
          Obtains a ISTextExpert instance for processing structured text with the specified type handler.
static ISTextExpert getExpert(String type, STextEnvironment environment)
          Obtains a ISTextExpert instance for processing structured text with the specified type handler and the specified environment.
static ISTextExpert getStatefulExpert(STextTypeHandler handler, STextEnvironment environment)
          Obtains a ISTextExpert instance for processing structured text with the specified type handler and the specified environment.
static ISTextExpert getStatefulExpert(String type)
          Obtains a ISTextExpert instance for processing structured text with the specified type handler.
static ISTextExpert getStatefulExpert(String type, STextEnvironment environment)
          Obtains a ISTextExpert instance for processing structured text with the specified type handler and the specified environment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getExpert

public static ISTextExpert getExpert()
Obtains a ISTextExpert instance for processing structured text with a default type handler segmenting the text according to default separators. This expert instance does not handle states.

Returns:
the ISTextExpert instance.
See Also:
STextProcessor.getDefaultSeparators()

getExpert

public static ISTextExpert getExpert(String type)
Obtains a ISTextExpert instance for processing structured text with the specified type handler. This expert instance does not handle states.

Parameters:
type - the identifier for the required type handler. This identifier may be one of those listed in STextTypeHandlerFactory or it may be have been registered by a plug-in.
Returns:
the ISTextExpert instance.
Throws:
IllegalArgumentException - if type is not a known type identifier.

getExpert

public static ISTextExpert getExpert(String type,
                                     STextEnvironment environment)
Obtains a ISTextExpert instance for processing structured text with the specified type handler and the specified environment. This expert instance does not handle states.

Parameters:
type - the identifier for the required type handler. This identifier may be one of those listed in STextTypeHandlerFactory or it may be have been registered by a plug-in.
environment - the current environment, which may affect the behavior of the expert. This parameter may be specified as null, in which case the STextEnvironment.DEFAULT environment should be assumed.
Returns:
the ISTextExpert instance.
Throws:
IllegalArgumentException - if type is not a known type identifier.

getStatefulExpert

public static ISTextExpert getStatefulExpert(String type)
Obtains a ISTextExpert instance for processing structured text with the specified type handler. This expert instance can handle states.

Parameters:
type - the identifier for the required type handler. This identifier may be one of those listed in STextTypeHandlerFactory or it may be have been registered by a plug-in.
Returns:
the ISTextExpert instance.
Throws:
IllegalArgumentException - if type is not a known type identifier.

getStatefulExpert

public static ISTextExpert getStatefulExpert(String type,
                                             STextEnvironment environment)
Obtains a ISTextExpert instance for processing structured text with the specified type handler and the specified environment. This expert instance can handle states.

Parameters:
type - the identifier for the required type handler. This identifier may be one of those listed in STextTypeHandlerFactory or it may be have been registered by a plug-in.
environment - the current environment, which may affect the behavior of the expert. This parameter may be specified as null, in which case the STextEnvironment.DEFAULT environment should be assumed.
Returns:
the ISTextExpert instance.
Throws:
IllegalArgumentException - if type is not a known type identifier.

getStatefulExpert

public static ISTextExpert getStatefulExpert(STextTypeHandler handler,
                                             STextEnvironment environment)
Obtains a ISTextExpert instance for processing structured text with the specified type handler and the specified environment. This expert instance can handle states.

Parameters:
handler - the type handler instance. It may have been obtained using STextTypeHandlerFactory.getHandler(String) or by instantiating a type handler.
environment - the current environment, which may affect the behavior of the expert. This parameter may be specified as null, in which case the STextEnvironment.DEFAULT environment should be assumed.
Returns:
the ISTextExpert instance.
Throws:
IllegalArgumentException - if type is not a known type identifier.

Eclipse Platform
Release 3.8

Guidelines for using Eclipse APIs.

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