Interface DataComponent

All Superinterfaces:
AbstractSWE, AbstractSWEIdentifiable, HasCopy, Serializable
All Known Subinterfaces:
BlockComponent, Boolean, Category, CategoryOrRange, CategoryRange, Count, CountOrRange, CountRange, DataArray, DataChoice, DataRecord, GeometryData, Matrix, Quantity, QuantityOrRange, QuantityRange, RangeComponent, ScalarComponent, SimpleComponent, Text, Time, TimeOrRange, TimeRange, Vector
All Known Implementing Classes:
AbstractArrayImpl, AbstractDataComponentImpl, AbstractRangeComponentImpl, AbstractRecordImpl, AbstractSimpleComponentImpl, BooleanImpl, CategoryImpl, CategoryRangeImpl, CountImpl, CountRangeImpl, DataArrayImpl, DataChoiceImpl, DataList, DataRecordImpl, DataValue, GeometryDataImpl, MatrixImpl, QuantityImpl, QuantityRangeImpl, SWEData, TextImpl, TimeImpl, TimeRangeImpl, VectorImpl

public interface DataComponent extends AbstractSWEIdentifiable, HasCopy

Base interface for all SWE Common data components. It provides an API auto-generated from XML schemas as well as a generic API that useful to navigate a component tree in a more generic manner.

Since:
Nov 10, 2014
  • Method Details

    • getUpdatable

      boolean getUpdatable()
      Gets the updatable property
      Returns:
      true if component can be updated dynamically
    • isSetUpdatable

      boolean isSetUpdatable()
      Checks if updatable is set
      Returns:
      true if the updatable attribute is set
    • setUpdatable

      void setUpdatable(boolean updatable)
      Sets the updatable property
      Parameters:
      updatable -
    • unSetUpdatable

      void unSetUpdatable()
      Unsets the updatable property
    • getOptional

      boolean getOptional()
      Gets the optional property
      Returns:
      true if component value is optional in the stream
    • isSetOptional

      boolean isSetOptional()
      Checks if optional is set
      Returns:
      true if the optional attribute is set
    • setOptional

      void setOptional(boolean optional)
      Sets the optional property
      Parameters:
      optional -
    • unSetOptional

      void unSetOptional()
      Unsets the optional property
    • getDefinition

      String getDefinition()
      Gets the definition property
      Returns:
      definition URI
    • isSetDefinition

      boolean isSetDefinition()
      Checks if definition is set
      Returns:
      true if the definition attribute is set
    • setDefinition

      void setDefinition(String definition)
      Sets the definition property
      Parameters:
      definition - definition URI
    • getComponentCount

      int getComponentCount()
      Returns number of sub-components in this component
      Returns:
      number of direct sub-components
    • getComponent

      DataComponent getComponent(int index)
      Get the sub-component located at the specified index
      Parameters:
      index - index of component to lookup
      Returns:
      child component or null if none exists at the specified index
    • getComponent

      DataComponent getComponent(String name)
      Get the sub-component registered with the specified name
      Parameters:
      name - name of component to lookup
      Returns:
      child component or null if none exists with the specified name
    • getComponentIndex

      int getComponentIndex(String name)
      Get the index of the sub-component registered with this name
      Parameters:
      name - name of component to lookup
      Returns:
      index of child component or -1 if none exists with the specified name
    • addComponent

      void addComponent(String name, DataComponent component)
      Add a sub-component and registers a name for it
      Parameters:
      name - name of component to use
      component - new sub-component to append to this component
    • removeComponent

      DataComponent removeComponent(int index)
      Remove the sub-component at the specified index
      Parameters:
      index -
      Returns:
      the component that was just removed
    • removeComponent

      DataComponent removeComponent(String name)
      Remove sub-component with the specified name
      Parameters:
      name -
      Returns:
      the component that was just removed
    • getParent

      DataComponent getParent()
      Returns:
      parent component of this component
    • getName

      String getName()
      Returns:
      name of sub-component
    • setName

      void setName(String name)
      Sets the name of this component
      Parameters:
      name -
    • hasData

      boolean hasData()
      Returns:
      true if a datablock is associated to this component
    • getData

      DataBlock getData()
      Get the datablock associated to this component
      Returns:
      datablock object or null if none has been generated yet
    • setData

      void setData(DataBlock dataBlock)
      Assign a new datablock to this component. This will recursively assign the right datablocks to sub-components recursively.
      Parameters:
      dataBlock -
    • clearData

      void clearData()
      Clear the datablock used by this component. This will also clear data from all the sub-components recursively.
    • validateData

      void validateData(List<ValidationException> errorList)
      Validates datablock against constraints if any. No exceptions are thrown, rather they are appended to the provided list.
      Parameters:
      errorList - list to which validation exceptions will be appended
    • hasConstraints

      boolean hasConstraints()
      Recursively checks if constraints are specified in this component or any of its sub-components
      Returns:
      true if at least one constraint is found, false otherwise
    • copy

      Return a structural copy of this component The copy is done recursively, but only the structure is copied (not the data)
      Specified by:
      copy in interface HasCopy
      Returns:
      copy of this component, including sub-components
    • clone

      DataComponent clone()
      Get a full recursive copy of this component. Both structure and data are copied
      Returns:
      clone of this component, including sub-components
    • createDataBlock

      DataBlock createDataBlock()
      Create a new datablock for holding data of this component
      Returns:
      new datablock object
    • assignNewDataBlock

      void assignNewDataBlock()
      Create and assign a new datablock structure to this component. This will also assign the right datablocks to sub-components recursively.
    • renewDataBlock

      void renewDataBlock()
      Renew the datablock of this component. This method is faster than recreating a datablock from scratch with createDataBlock().
    • accept

      void accept(DataComponentVisitor visitor)