Class StructuredTextExpertFactory
java.lang.Object
org.eclipse.equinox.bidi.advanced.StructuredTextExpertFactory
Obtains IStructuredTextExpert instances. An
IStructuredTextExpert
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:
- stateful, obtained by calling
getStatefulExpert(java.lang.String)
. - not stateful, obtained by calling
getExpert()
.
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 IStructuredTextExpert.getState()
,
IStructuredTextExpert.setState(java.lang.Object)
and
IStructuredTextExpert.clearState()
of IStructuredTextExpert
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
Modifier and TypeMethodDescriptionstatic IStructuredTextExpert
Obtains a IStructuredTextExpert instance for processing structured text with a default type handler segmenting the text according to default separators.static IStructuredTextExpert
Obtains a IStructuredTextExpert instance for processing structured text with the specified type handler.static IStructuredTextExpert
getExpert
(String type, StructuredTextEnvironment environment) Obtains a IStructuredTextExpert instance for processing structured text with the specified type handler and the specified environment.static IStructuredTextExpert
getStatefulExpert
(String type) Obtains a IStructuredTextExpert instance for processing structured text with the specified type handler.static IStructuredTextExpert
getStatefulExpert
(String type, StructuredTextEnvironment environment) Obtains a IStructuredTextExpert instance for processing structured text with the specified type handler and the specified environment.static IStructuredTextExpert
getStatefulExpert
(StructuredTextTypeHandler handler, StructuredTextEnvironment environment) Obtains a IStructuredTextExpert instance for processing structured text with the specified type handler and the specified environment.
-
Method Details
-
getExpert
Obtains a IStructuredTextExpert 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 IStructuredTextExpert instance.
- See Also:
-
getExpert
Obtains a IStructuredTextExpert 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 inStructuredTextTypeHandlerFactory
or it may be have been registered by a plug-in.- Returns:
- the IStructuredTextExpert instance.
- Throws:
IllegalArgumentException
- iftype
is not a known type identifier.
-
getExpert
Obtains a IStructuredTextExpert 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 inStructuredTextTypeHandlerFactory
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 asnull
, in which case theStructuredTextEnvironment.DEFAULT
environment should be assumed.- Returns:
- the IStructuredTextExpert instance.
- Throws:
IllegalArgumentException
- iftype
is not a known type identifier.
-
getStatefulExpert
Obtains a IStructuredTextExpert 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 inStructuredTextTypeHandlerFactory
or it may be have been registered by a plug-in.- Returns:
- the IStructuredTextExpert instance.
- Throws:
IllegalArgumentException
- iftype
is not a known type identifier.
-
getStatefulExpert
public static IStructuredTextExpert getStatefulExpert(String type, StructuredTextEnvironment environment) Obtains a IStructuredTextExpert 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 inStructuredTextTypeHandlerFactory
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 asnull
, in which case theStructuredTextEnvironment.DEFAULT
environment should be assumed.- Returns:
- the IStructuredTextExpert instance.
- Throws:
IllegalArgumentException
- iftype
is not a known type identifier.
-
getStatefulExpert
public static IStructuredTextExpert getStatefulExpert(StructuredTextTypeHandler handler, StructuredTextEnvironment environment) Obtains a IStructuredTextExpert 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 usingStructuredTextTypeHandlerFactory.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 asnull
, in which case theStructuredTextEnvironment.DEFAULT
environment should be assumed.- Returns:
- the IStructuredTextExpert instance
- Throws:
IllegalArgumentException
- if thehandler
isnull
-