public class MetaFactoryData
extends java.lang.Object
| Constructor and Description |
|---|
MetaFactoryData()
Create a new instance of MetaFactoryData
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToContainer(org.licas_xml.abs.Element scriptXml,
org.licas_xml.abs.Element toAdd)
Add the new XML element to the admin document/script under the appropriate element type.
|
boolean |
addToContainer(org.licas_xml.abs.Element scriptXml,
org.licas_xml.abs.Element toAdd,
java.lang.String resourceID)
Add the new XML element to the admin document/script under the appropriate element type.
|
org.licas_xml.abs.Element |
createDataTypeValue(java.lang.String dataType,
java.util.ArrayList<?> infoData)
Create an XML element that can be used as part of a script to define a data resource.
|
org.licas_xml.abs.Element |
createDataTypeValue(java.lang.String dataType,
org.licas_xml.abs.Element infoData)
Create an XML element that can be used as part of a script to define a data resource.
|
org.licas_xml.abs.Element |
createDataTypeValue(java.lang.String dataType,
java.lang.String infoData)
Create an XML element that can be used as part of a script to define a data resource.
|
protected org.licas_xml.abs.Element |
createDataValue(java.lang.String dataType,
java.lang.Object infoData)
Create an XML element that can be used as part of a script to define a data resource.
|
org.licas_xml.abs.Element |
createResourceContainer(java.lang.String containerType)
Create a root Resource Container XML element that can be used as the base of a
script to describe resources to load.
|
java.lang.String |
getDataType(org.licas_xml.abs.Element dataXml)
Parse the data element type from the service info data description.
|
java.lang.String |
innerText(org.licas_xml.abs.Element rootElem)
Parse the root element and store all text content for it and any nested elements.
|
boolean |
setDataType(java.lang.String dataType,
org.licas_xml.abs.Element dataXml)
Set the data element type from the service info data description.
|
public MetaFactoryData()
public org.licas_xml.abs.Element createResourceContainer(java.lang.String containerType)
<Data><DataType>containerType</DataType><Value></Value></Data>.
You can then add resources to it, for example, by calling
addToContainer(containerXml, createDataTypeValueXml(type, urlPath).
Construct this way, because the single resource descriptions
should be placed inside of the container's Value element.containerType - the type of container to create.public boolean addToContainer(org.licas_xml.abs.Element scriptXml,
org.licas_xml.abs.Element toAdd)
scriptXml - the current admin document/script. Can use createAdminXML
to create an empty admin document, for example.toAdd - the XML element to add to the script.public boolean addToContainer(org.licas_xml.abs.Element scriptXml,
org.licas_xml.abs.Element toAdd,
java.lang.String resourceID)
scriptXml - the current admin document/script. Can use createAdminXML
to create an empty admin document, for example.toAdd - the XML element to add to the script.resourceID - if not null, then a UUID field is added to the toAdd
description and used as the unique resource id.public org.licas_xml.abs.Element createDataTypeValue(java.lang.String dataType,
java.lang.String infoData)
throws java.lang.Exception
Data section and it stores a
description of a data type and value. The returned value is
<Data><DataType>dataType</DataType><Value>infoData</Value></Data>dataType - the data type of the value. Its class name.infoData - the data itself. If null, only the type is added.java.lang.Exception - any error.public org.licas_xml.abs.Element createDataTypeValue(java.lang.String dataType,
org.licas_xml.abs.Element infoData)
throws java.lang.Exception
Data section and it stores a
description of a data type and value. The returned value is
<Data><DataType>dataType</DataType><Value><XML infoData></Value></Data>dataType - the data type of the value. Its class name.infoData - the data itself. If null, only the type is added.java.lang.Exception - any error.public org.licas_xml.abs.Element createDataTypeValue(java.lang.String dataType,
java.util.ArrayList<?> infoData)
throws java.lang.Exception
Data section and it stores a
description of a data type and value. The returned value is
<Data><DataType>dataType</DataType><Value>infoData1</Value><Value>infoData2</Value></Data>dataType - the data type of the value. Its class name.infoData - the data itself. This list should be either XML elements or simple
types that can be converted directly to Strings. If null, only the type is added.java.lang.Exception - any error.protected org.licas_xml.abs.Element createDataValue(java.lang.String dataType,
java.lang.Object infoData)
throws java.lang.Exception
Data section and it stores a
description of a data value only. The returned value is
<Data><Value>String or XML infoData</Value></Data>dataType - the data type of the value - its class name. This might be required
for serializing the data object into a string, but is not added to the script.
Use createDataValueTypeXML for that.infoData - the data itself. This can be a String, XML element, or simple
type that can be converted directly to a String.java.lang.Exception - any error.public java.lang.String getDataType(org.licas_xml.abs.Element dataXml)
throws java.lang.Exception
dataXml - this is the base data or dataset element with nested elements that include
directly, Const.DATATYPE or DATASETTYPE, plus a VALUE
elements for parsing. If they are missing, a convertParameter call is
tried on the whole XML object.java.lang.Exception - any error.public boolean setDataType(java.lang.String dataType,
org.licas_xml.abs.Element dataXml)
dataType - the new data type to set the value to.dataXml - this is the base data or dataset element with nested elements that include
directly, Const.DATATYPE or DATASETTYPE elements for parsing.public java.lang.String innerText(org.licas_xml.abs.Element rootElem)
rootElem - the root element to parse from.