Package hec.data

Class AbstractJDomDataObject

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, Serializable, Cloneable, Comparable, Observer, Modifiable
Direct Known Subclasses:
JDomAttributeParameterTypedValue, JDomCharacteristic, JDomCharacteristicType, JDomCharacteristicTypeRef, JDomEmbankmentImpl, JDomLocationLevelImpl, JDomLocationLevelRef, JDomLockCatalogImpl, JDomLockImpl, JDomLookupTypeImpl, JDomParameterTypedValueImpl, JDomProjectCatalogImpl, JDomProjectImpl, JDomSeasonalIntervalImpl, JDomSeasonalValueImpl, JDomSeasonalValuesImpl, JDomSpecifiedLevelImpl, JDomWaterSupplyPumpAccountingImpl, JDomWaterUserContractImpl, JDomWaterUserContractRef, JDomWaterUserImpl, OperationalProjectChanges, PhysicalStructure, PhysicalStructureOperationalChange, PhysicalStructureOperationalChangeRef, PhysicalStructureOperationalSetting

public abstract class AbstractJDomDataObject extends NamedType
See Also:
  • Field Details

  • Constructor Details

    • AbstractJDomDataObject

      public AbstractJDomDataObject()
  • Method Details

    • buildElement

      public abstract void buildElement(org.jdom.Element element)
      Populates the element with data from this object.
      Parameters:
      element -
    • parseInt

      protected int parseInt(org.jdom.Element parentElement, String childElementName, String[] units, int defaultValue)
    • parseFormattedDouble

      protected double parseFormattedDouble(org.jdom.Element parentElement, String childElementName, String[] units, double defaultValue)
    • parseDouble

      protected double parseDouble(org.jdom.Element parentElement, String childElementName, String[] units, double defaultValue)
    • camelCaseToLowerUnderbar

      public static String camelCaseToLowerUnderbar(String word)
      Converts a camelCase string to one with words separated by underbars (_) and lowercased. Loosely based on: http://www.malethan.com/article/humanise_camel_case_in_java.html
    • getDefaultElementName

      protected String getDefaultElementName()
    • toXmlString

      public String toXmlString()
      Writes an AbstractJDomDataObject to an xml string. This method is mostly for debugging. The root element of the string that is returned is named based on a lowercased and underscored version of the classname. If the classname starts with "JDom" or ends with "Impl" those are removed.
      Returns:
      the xml string
    • getXmlValue

      public static double getXmlValue(ParamDouble paramDouble, org.jdom.Element parent, String childElementName, int paramId)
    • setXmlValue

      public static void setXmlValue(ParamDouble paramDouble, org.jdom.Element parent, String childElementName, Double value, int paramId)
    • getXmlDate

      public static Date getXmlDate(org.jdom.Element parent, String childElementName, String dateFormat)
    • setXmlDate

      public static void setXmlDate(org.jdom.Element element, String childElementName, String dateFormat, Date date)
    • buildElementOrRemove

      protected org.jdom.Element buildElementOrRemove(org.jdom.Element element, String childElementName, AbstractJDomDataObject jdom)