Package rma.util
Class RmaBaseXmlUtilities
java.lang.Object
rma.util.RmaBaseXmlUtilities
- Direct Known Subclasses:
BaseXMLUtilities
A base base xml utilities class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAttributes
(org.jdom.Element elem, Map attributes) Store the key/value pairs in the Map attributes as XML Attributes in the Element elemstatic void
addXMLSchemaNamespaceDeclaration
(org.jdom.Element elem) add the default XML schema location to the element.static void
addXSDLocation
(org.jdom.Element elem, String schemaLocation) add the schema location to the Element elem.static void
addXSLTLocation
(org.jdom.Document doc, String xsltLocation) add the XML stylesheet information to the XML Document.static Map
attributeListToMap
(List attributes) static org.jdom.Element
buildElement
(Reader reader) static org.jdom.Element
buildElement
(String xml) static boolean
createArrayElements
(org.jdom.Element base, byte[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, byte[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, char[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, char[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, double[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, double[][] array) static boolean
createArrayElements
(org.jdom.Element base, double[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, float[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, float[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, int[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, int[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, String[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
static boolean
createArrayElements
(org.jdom.Element base, String[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
protected static boolean
displayArrays
(org.jdom.Document doc) static boolean
getAttributeValueAsBoolean
(org.jdom.Element elem, String attributeName, boolean defaultValue) get an attribute as an boolean.static double
getAttributeValueAsDouble
(org.jdom.Element elem, String attributeName, double defaultValue) get an attribute as an double.static float
getAttributeValueAsFloat
(org.jdom.Element elem, String attributeName, float defaultValue) get an attribute as a float.static int
getAttributeValueAsInt
(org.jdom.Element elem, String attributeName, int defaultValue) get an attribute as an int.static long
getAttributeValueAsLong
(org.jdom.Element elem, String attributeName, long defaultValue) get an attribute as a long.static short
getAttributeValueAsShort
(org.jdom.Element elem, String attributeName, short defaultValue) static boolean
getChildElementAsBoolean
(org.jdom.Element parent, String childElementName, boolean defaultValue) Returns the child element text as an boolean value.static Color
getChildElementAsColor
(org.jdom.Element parent, String childElementName, Color defaultColor) Gets the Color saved in the element text of the parent's child.static double
getChildElementAsDouble
(org.jdom.Element parent, String childElementName, double defaultValue) Returns the child element text as a double value.static int
getChildElementAsInt
(org.jdom.Element parent, String childElementName, int defaultValue) Returns the child element text as an int value.static long
getChildElementAsLong
(org.jdom.Element parent, String childElementName, long defaultValue) static String
getChildElementAsString
(org.jdom.Element parent, String childElementName, boolean trim, String defaultValue) static String
getChildElementAsString
(org.jdom.Element parent, String childElementName, String defaultValue) Returns the child element text as an String value.static String
getChildElementAttribute
(org.jdom.Element parent, String childElementName, String attribute) Will return the attribute value from the child of the parent.static boolean
getContentAsBoolean
(org.jdom.Element elem, boolean defaultValue) Returns the element content as an boolean value.static double
getContentAsDouble
(org.jdom.Element elem, double defaultValue) Returns the content of the element as a double value.static int
getContentAsInt
(org.jdom.Element elem, int defaultValue) Returns the element content as an int value.static long
getContentAsLong
(org.jdom.Element elem, long defaultValue) static String
getContentAsString
(org.jdom.Element elem, boolean trim, String defaultValue) static String
getContentAsString
(org.jdom.Element elem, String defaultValue) Returns the element content as an String value.static String
getDescription
(org.jdom.Element descElem) get the description.static double[]
getDoubleArrayElements
(org.jdom.Element elem) static float[]
getFloatArrayElements
(org.jdom.Element elem) static int[]
getIntArrayElements
(org.jdom.Element elem) static org.jdom.Element
getOrCreateChild
(org.jdom.Element parent, String childElementName) Deprecated.protected static int
getStepSize
(Object array) return the step size to write the arrays out withstatic String[]
getStringArrayElements
(org.jdom.Element elem) static Color
get the Color saved in Element elem with the attribute name of attributeNamestatic org.jdom.Document
loadDocument
(Reader reader) create and load the XML Document from the Reader reader.static org.jdom.Element
saveChildElement
(org.jdom.Element parent, String childName, boolean boolValue) create a new Element with name childName, containing the value boolValue, add it to parent and return the childstatic org.jdom.Element
saveChildElement
(org.jdom.Element parent, String childName, double textValue) create a new Element with name childName, containing the value textValue, add it to parent and return the childstatic org.jdom.Element
saveChildElement
(org.jdom.Element parent, String childName, int textValue) create a new Element with name childName, containing the value textValue, add it to parent and return the childstatic org.jdom.Element
saveChildElement
(org.jdom.Element parent, String childName, String textValue) create a new Element with name childName, containing the value textValue, add it to parent and return the childstatic void
save the Color color to the Element elem with the attribute name of attributeNamestatic void
saveDescription
(org.jdom.Element parent, String desc) This saves the description as an Element with each line of description stored as a child Element.static void
saveWindowSizeAndLocation
(org.jdom.Element node, Window w) static void
setAttributeValueAsDouble
(org.jdom.Element elem, String attributeName, double value) Creates a named attribute on the element for the double value.static void
setAttributeValueAsLong
(org.jdom.Element elem, String attributeName, long value) Creates a named attribute on the element for the long value.static void
setChildElementAsColor
(org.jdom.Element parent, String childElementName, Color color) Sets the element text for the named child of the parent to a color string.static void
setChildElementAsDouble
(org.jdom.Element parent, String childElementName, double value) Sets the child element text to a double value.static void
setChildElementAsInt
(org.jdom.Element parent, String childElementName, int value) Sets the child element text to an int value.static void
setChildElementAttribute
(org.jdom.Element parent, String childElementName, String attribute, String value) Will set the attribute value of the child of the parent creating the child element if necessary.static void
setWindowSizeAndLocation
(org.jdom.Element node, Window window) static String
toXmlString
(org.jdom.Element element) static String
toXmlString
(org.jdom.Element element, org.jdom.output.Format format)
-
Field Details
-
INT_ARRAY_NODE_NAME
- See Also:
-
DOUBLE_ARRAY_NODE_NAME
- See Also:
-
STRING_ARRAY_NODE_NAME
- See Also:
-
FLOAT_ARRAY_NODE_NAME
- See Also:
-
TWO_D_DOUBLE_ARRAY_NODE_NAME
- See Also:
-
WORLD_PT_NODE
- See Also:
-
WORLD_LINE_NODE
- See Also:
-
WORLD_REGION_NODE
- See Also:
-
LOCAL_RECT_NODE
- See Also:
-
WORLD_RECT_NODE
- See Also:
-
WORLD_REGION_CLOCKWISE
- See Also:
-
WORLD_REGION_SELF_INTERSECTING
- See Also:
-
NUM_POINTS_ATTR
- See Also:
-
LENGTH_ATTRIBUTE
- See Also:
-
STEP_ATTRIBUTE
- See Also:
-
RANGE_ATTRIBUTE
- See Also:
-
DATA_ATTRIBUTE
- See Also:
-
NAME_ATTRIBUTE
- See Also:
-
INDEX_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
RmaBaseXmlUtilities
public RmaBaseXmlUtilities()
-
-
Method Details
-
addXMLSchemaNamespaceDeclaration
public static void addXMLSchemaNamespaceDeclaration(org.jdom.Element elem) add the default XML schema location to the element. This is the xmlns:xsi entry in the Element. Typically set to http://www.w3.org/2001/XMLSchema-instance- Parameters:
elem
- the element to add the default XML schema to.
-
addXSLTLocation
add the XML stylesheet information to the XML Document.- Parameters:
doc
- The XML DocumentxsltLocation
- the XML stylesheet information.
-
addXSDLocation
add the schema location to the Element elem.- Parameters:
elem
- the Element (typically the root Element) to attach the XML Schema toschemaLocation
- the location of the XML schema
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, int[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to save- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, int[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to savestep
- the number of array positions to store in each array Element- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, double[][] array) -
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, double[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to save- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, double[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to savestep
- the number of array positions to store in each array Element- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, float[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to save- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, float[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to savestep
- the number of array positions to store in each array Element- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, byte[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to save- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, byte[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to savestep
- the number of array positions to store in each array Element- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, char[] array) add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to save- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
public static boolean createArrayElements(org.jdom.Element base, char[] array, int step) add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to savestep
- the number of array positions to store in each array Element- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
add the Elements that represent the array to theElement
base with theDEFAULT_STEP
number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to save- Returns:
- true if the array Elements were successfully added to the base Element
-
createArrayElements
add the Elements that represent the array to theElement
base with the step number of array entries per arrayElement
- Parameters:
base
- the Element to add the array Elements toarray
- the array to savestep
- the number of array positions to store in each array Element- Returns:
- true if the array Elements were successfully added to the base Element
-
getDoubleArrayElements
public static double[] getDoubleArrayElements(org.jdom.Element elem) -
getIntArrayElements
public static int[] getIntArrayElements(org.jdom.Element elem) -
getFloatArrayElements
public static float[] getFloatArrayElements(org.jdom.Element elem) -
getStringArrayElements
-
getStepSize
return the step size to write the arrays out with- Parameters:
length
- the length of the array- Returns:
- the step size
-
displayArrays
protected static boolean displayArrays(org.jdom.Document doc) -
saveDescription
This saves the description as an Element with each line of description stored as a child Element. XML doesn't preserve the newlines when just an attribute is used.- Parameters:
parent
- the parent to add the description Element to.desc
- the description
-
getDescription
get the description.- Parameters:
descElem
-- Returns:
-
getAttributeValueAsInt
public static int getAttributeValueAsInt(org.jdom.Element elem, String attributeName, int defaultValue) get an attribute as an int.- Parameters:
elem
- the Element that holds the attributeattributeName
- the Attribute namedefaultValue
- the default value if the Attribute can't be found or converted into an int- Returns:
- the int value of Attribute or defaultValue
-
getAttributeValueAsShort
public static short getAttributeValueAsShort(org.jdom.Element elem, String attributeName, short defaultValue) - Parameters:
myElem
-string
-elementType
-
-
getAttributeValueAsLong
public static long getAttributeValueAsLong(org.jdom.Element elem, String attributeName, long defaultValue) get an attribute as a long.- Parameters:
elem
- the Element that holds the attributeattributeName
- the Attribute namedefaultValue
- the default value if the Attribute can't be found or converted into an long- Returns:
- the long value of Attribute or defaultValue
-
setAttributeValueAsLong
Creates a named attribute on the element for the long value.- Parameters:
elem
- the Element that owns the attributeattributeName
- the Attribute namevalue
- the long value.
-
getAttributeValueAsFloat
public static float getAttributeValueAsFloat(org.jdom.Element elem, String attributeName, float defaultValue) get an attribute as a float.- Parameters:
elem
- the Element that holds the attributeattributeName
- the Attribute namedefaultValue
- the default value if the Attribute can't be found or converted into an float- Returns:
- the float value of Attribute or defaultValue
-
getAttributeValueAsDouble
public static double getAttributeValueAsDouble(org.jdom.Element elem, String attributeName, double defaultValue) get an attribute as an double.- Parameters:
elem
- the Element that holds the attributeattributeName
- the Attribute namedefaultValue
- the default value if the Attribute can't be found or converted into an double- Returns:
- the double value of Attribute or defaultValue
-
setAttributeValueAsDouble
public static void setAttributeValueAsDouble(org.jdom.Element elem, String attributeName, double value) Creates a named attribute on the element for the double value.- Parameters:
elem
- the Element that owns the attributeattributeName
- the Attribute namevalue
- the double value.
-
getAttributeValueAsBoolean
public static boolean getAttributeValueAsBoolean(org.jdom.Element elem, String attributeName, boolean defaultValue) get an attribute as an boolean.- Parameters:
elem
- the Element that holds the attributeattributeName
- the Attribute namedefaultValue
- the default value if the Attribute can't be found or converted into an boolean- Returns:
- the boolean value of Attribute or defaultValue
-
saveColor
save the Color color to the Element elem with the attribute name of attributeName- Parameters:
elem
- the Element to save toattributeName
- the name of the attributecolor
- the Color to save
-
loadColor
get the Color saved in Element elem with the attribute name of attributeName- Parameters:
elem
- the Element to get the color attribute fromattributeName
- the name of the color attributedefaultColor
- the default Color- Returns:
- the Color or the defaultColor if elem or attributeName is null or the attribute doesn't exist in the Element
-
loadDocument
create and load the XML Document from the Reader reader. The reader isn't closed after the read is finished. That's up to the caller- Parameters:
reader
- the reader to read from.- Returns:
-
addAttributes
Store the key/value pairs in the Map attributes as XML Attributes in the Element elem- Parameters:
elem
- XML Element to store the Attributes inattributes
- Map of attributes to store
-
attributeListToMap
- Parameters:
attributes
-- Returns:
-
saveWindowSizeAndLocation
-
setWindowSizeAndLocation
-
getChildElementAsString
public static String getChildElementAsString(org.jdom.Element parent, String childElementName, String defaultValue) Returns the child element text as an String value.- Parameters:
parent
- Parent that holds the String element.childElementName
- Name of the child String element.defaultValue
- Default String value.- Returns:
- The String value defined in the child element or the default value if parent/child are null or element text doesnt parse.
-
getChildElementAsString
-
getChildElementAsBoolean
public static boolean getChildElementAsBoolean(org.jdom.Element parent, String childElementName, boolean defaultValue) Returns the child element text as an boolean value.- Parameters:
parent
- Parent that holds the boolean element.childElementName
- Name of the child boolean element.defaultValue
- Default boolean value.- Returns:
- The boolean value defined in the child element or the default value if parent/child are null or element text doesnt parse.
-
getContentAsString
Returns the element content as an String value.- Parameters:
elem
- The element with the String content.defaultValue
- The default String value.- Returns:
- The String value defined in the element content or the default value if the element is null or the element text does not parse.
-
getContentAsString
-
getContentAsBoolean
public static boolean getContentAsBoolean(org.jdom.Element elem, boolean defaultValue) Returns the element content as an boolean value.- Parameters:
elem
- The element with the boolean content.defaultValue
- The default boolean value.- Returns:
- The boolean value defined in the element content or the default value if the element is null or the element text does not parse.
-
setChildElementAsInt
public static void setChildElementAsInt(org.jdom.Element parent, String childElementName, int value) Sets the child element text to an int value. Note that this method will create the child if it does not exist.- Parameters:
parent
- The parent element of the child int element.childElementName
- The name fo the child int element.value
- The value to set as the child text.
-
getChildElementAsDouble
public static double getChildElementAsDouble(org.jdom.Element parent, String childElementName, double defaultValue) Returns the child element text as a double value.- Parameters:
parent
- Parent that holds the double element.childElementName
- Name of the child double element.defaultValue
- Default double value.- Returns:
- The double value defined in the child element or the default value if parent/child are null or element text doesnt parse.
-
getChildElementAsColor
public static Color getChildElementAsColor(org.jdom.Element parent, String childElementName, Color defaultColor) Gets the Color saved in the element text of the parent's child.- Parameters:
parent
- Parent that holds the color element.childElementName
- Name of the child color element.defaultColor
- Default color.- Returns:
- The Color defined in the child element or the default color if the parent, child, or color text is not defined.
-
setChildElementAsColor
public static void setChildElementAsColor(org.jdom.Element parent, String childElementName, Color color) Sets the element text for the named child of the parent to a color string. Note that this method will create the child element if it does not exist.- Parameters:
parent
- The parent of the color element.childElementName
- The name of the color element.color
- The color to be set.
-
getContentAsDouble
public static double getContentAsDouble(org.jdom.Element elem, double defaultValue) Returns the content of the element as a double value.- Parameters:
elem
- The element with the double content.defaultValue
- The default double value.- Returns:
- The double value defined in the element or default value if content is null or element text doesnt parse.
-
setChildElementAsDouble
public static void setChildElementAsDouble(org.jdom.Element parent, String childElementName, double value) Sets the child element text to a double value. Note that this method will create the child if it does not exist.- Parameters:
parent
- The parent element of the child double element.childElementName
- The name fo the child double element.value
- The value to set as the child text.
-
getContentAsInt
public static int getContentAsInt(org.jdom.Element elem, int defaultValue) Returns the element content as an int value.- Parameters:
elem
- The element with the int content.defaultValue
- The default int value.- Returns:
- The int value defined in the element content or the default value if the element is null or the element text does not parse.
-
getContentAsLong
public static long getContentAsLong(org.jdom.Element elem, long defaultValue) -
getChildElementAsInt
public static int getChildElementAsInt(org.jdom.Element parent, String childElementName, int defaultValue) Returns the child element text as an int value.- Parameters:
parent
- Parent that holds the int element.childElementName
- Name of the child int element.defaultValue
- Default int value.- Returns:
- The int value defined in the child element or the default value if parent/child are null or element text doesnt parse.
-
getChildElementAsLong
public static long getChildElementAsLong(org.jdom.Element parent, String childElementName, long defaultValue) -
getOrCreateChild
@Deprecated public static org.jdom.Element getOrCreateChild(org.jdom.Element parent, String childElementName) Deprecated.Returns the child from the parent if it exists otherwise creates the child, adds it to the parent and returns the child.- Parameters:
childElementName
- The name of the child to add.parent
- The parent that the child will be attached to.- Returns:
- The child element.
- See Also:
-
XMLUtilities.getOrCreateChild(Element, String)
-
getChildElementAttribute
public static String getChildElementAttribute(org.jdom.Element parent, String childElementName, String attribute) Will return the attribute value from the child of the parent.- Parameters:
parent
- The parent elementchildElementName
- The name of the child elementattribute
- The name of the attribute- Returns:
- The attribute value or null if parent, child, or attribute value are null
-
setChildElementAttribute
public static void setChildElementAttribute(org.jdom.Element parent, String childElementName, String attribute, String value) Will set the attribute value of the child of the parent creating the child element if necessary.- Parameters:
parent
- The parent elementchildElementName
- The name of the child elementattribute
- The name of the attributevalue
- The value for the attribute
-
buildElement
public static org.jdom.Element buildElement(Reader reader) throws org.jdom.JDOMException, IOException - Throws:
org.jdom.JDOMException
IOException
-
buildElement
- Throws:
org.jdom.JDOMException
IOException
-
toXmlString
- Throws:
IOException
-
toXmlString
public static String toXmlString(org.jdom.Element element, org.jdom.output.Format format) throws IOException - Throws:
IOException
-
saveChildElement
public static org.jdom.Element saveChildElement(org.jdom.Element parent, String childName, double textValue) create a new Element with name childName, containing the value textValue, add it to parent and return the child- Parameters:
parent
- the parent to add the new child Element tochildName
- the name the new child ElementtextValue
- double for the text value of the new child Element- Returns:
- the new child
-
saveChildElement
public static org.jdom.Element saveChildElement(org.jdom.Element parent, String childName, int textValue) create a new Element with name childName, containing the value textValue, add it to parent and return the child- Parameters:
parent
- the parent to add the new child Element tochildName
- the name the new child ElementtextValue
- int for the text value of the new child Element- Returns:
- the new child
-
saveChildElement
public static org.jdom.Element saveChildElement(org.jdom.Element parent, String childName, String textValue) create a new Element with name childName, containing the value textValue, add it to parent and return the child- Parameters:
parent
- the parent to add the new child Element tochildName
- the name the new child ElementtextValue
- String for the text value of the new child Element- Returns:
- the new child
-
saveChildElement
public static org.jdom.Element saveChildElement(org.jdom.Element parent, String childName, boolean boolValue) create a new Element with name childName, containing the value boolValue, add it to parent and return the child- Parameters:
parent
- the parent to add the new child Element tochildName
- the name the new child ElementboolValue
- boolean for the text value of the new child Element- Returns:
- the new child
-