Package com.esprow.oapi.util
Class TextItem
java.lang.Object
com.esprow.oapi.util.TextItem
- All Implemented Interfaces:
MixedContent.Item
The text item corresponding to Text or CDATA XML node.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.emf.ecore.util.FeatureMap.Entry
createEntry
(String object) Create an entry corresponding to the given value object.getValue()
Returns the actual value.static String
multiLineTrim
(String text) Removes all leading and trailing space, as well as indentation space, from the given string.protected String
resolve
(org.eclipse.emf.ecore.util.FeatureMap.Entry entry) Create a value object instance from the given entry.
-
Constructor Details
-
TextItem
Create an item with a given value- Parameters:
value
- the text
-
TextItem
protected TextItem(org.eclipse.emf.ecore.util.FeatureMap.Entry entry) Create unresolved item- Parameters:
entry
- the text entry to be wrapped
-
-
Method Details
-
createEntry
Create an entry corresponding to the given value object. This method is called by the framework once the client creates new Item.- Parameters:
object
- the value object- Returns:
- the feature map entry
-
resolve
Create a value object instance from the given entry. This method is called by the framework once the client requests the actual value.- Parameters:
entry
- the feature map entry- Returns:
- the value object
-
multiLineTrim
Removes all leading and trailing space, as well as indentation space, from the given string. Indentation space is a set of whitespace and tab characters at the beginning of each line in a multi-line string.- Parameters:
text
- the input string- Returns:
- the trimmed string
-
getValue
Description copied from interface:MixedContent.Item
Returns the actual value.- Specified by:
getValue
in interfaceMixedContent.Item
- Returns:
- the value object
-