public class SerializedItemBuilder extends java.lang.Object implements ItemBuilder
The SerializedItemBuilder is responsible for building SerializedItems and should be registered with the Core. It will store the name of a Painfully Simple Form file or an XML file and initialize a SerializedItem when the build() operation is called. It parses the InputStream to determine the Item name and type and resets that stream before creating the Item. These properties are determined when the builder is constructed so the reset is only performed once. The SerializedItem loads a SerializedItem from the stream to use as a template and will copy all new Items from this template. It attempts to close the input stream after loading the SerializedItem.
The Item Builder name of the Item is set to the name of the Item in file and the SerializedItemBuilder will return the same name by calling getItemName().
item
Constructor and Description |
---|
SerializedItemBuilder(java.io.InputStream inputStream)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
Item |
build(org.eclipse.core.resources.IProject projectSpace)
(non-Javadoc)
|
java.lang.String |
getItemName()
(non-Javadoc)
|
ItemType |
getItemType()
(non-Javadoc)
|
public SerializedItemBuilder(java.io.InputStream inputStream) throws java.io.IOException
The constructor. SerializedItemBuilders must be initialized with an InputStream. The stream can contain either a Painfully Simple Form file or an XML file that was created according to the JAXB-generated schemas for ICE Forms. If it is unable to load the InputStream or determines that the contents of the stream are not consistent with either the XML or the PSF formats, then it will throw an IOException.
inputStream
- The InputStream from which the SerializedItemBuilder should build the SerializedItem.
java.io.IOException
public java.lang.String getItemName()
getItemName
in interface ItemBuilder
The name
ItemBuilder.getItemName()
public ItemType getItemType()
getItemType
in interface ItemBuilder
The type
ItemBuilder.getItemType()
public Item build(org.eclipse.core.resources.IProject projectSpace)
build
in interface ItemBuilder
projectSpace
- The Eclipse project that the Item should use for storage.
The newly created Item.
ItemBuilder.build(IProject projectSpace)