Interface Declaration

    • Method Detail

      • getGroup

        java.lang.String getGroup()
                           throws java.rmi.RemoteException
        Returns:
        The group the declaration belongs to. Empty String if no Group is defined.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setGroup

        void setGroup​(java.lang.String group)
               throws java.rmi.RemoteException
        Set the group the declaration should belong to.
        Parameters:
        group - The new group. Null or an string containing only whitespaces will be reduced to an empty string.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getUnit

        java.lang.String getUnit()
                          throws java.rmi.RemoteException
        Returns the name of the unit of the declaration. For complex types units of subvariables are united.
        For unstructured declarations it is recommended to use getUnitObject().
        Returns:
        current unit as a string
        Throws:
        java.rmi.RemoteException - remote communication problem
      • getUnitObject

        Unit getUnitObject()
                    throws ApiException,
                           java.rmi.RemoteException
        Returns the Unit set to this declaration. The method is only allowed on non-structured declarations. Use getUnit() for structured declarations.
        Returns:
        the unit for this declaration or null if no unit is set.
        Throws:
        java.rmi.RemoteException - remote communication problem
        ApiException - If this declaration has a structured type.
      • setUnit

        void setUnit​(java.lang.String unit)
              throws ApiException,
                     java.rmi.RemoteException
        Set the unit of the declaration. For structs, maps and curves provide a comma separated list of units in braces, which fits their structure. The units name and symbol can be used.
        For unstructured declarations it is recommended to use setUnit(Unit).

        Note: At the moment single units without curly braces (e.g. "km") are accepted for curves and maps. In this case the unit of the value element will be set. In the future this might be rejected.
        Parameters:
        unit - The new unit of the declaration. Null will be reduced to an empty string.
        Throws:
        ApiException - If unit string format is invalid, structure does not match type of the declaration or unit does not exist.
        java.rmi.RemoteException - remote communication problem
      • setUnit

        void setUnit​(Unit unit)
              throws ApiException,
                     java.rmi.RemoteException
        Set the unit of this declaration. The method is only allowed on unstructured declarations. Use setUnit(String) for structured declarations.
        Parameters:
        unit - to be set or null to remove unit.
        Throws:
        ApiException - If this declaration has a structured type.
        java.rmi.RemoteException - remote communication problem
      • getDefaultValue

        java.lang.String getDefaultValue()
                                  throws java.rmi.RemoteException
        Get the default value of the declaration. The format is the same as seen in tptaif or the declaration editor.
        Returns:
        The default value string.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setDefaultValue

        void setDefaultValue​(java.lang.String defaultValue)
                      throws ApiException,
                             java.rmi.RemoteException
        Set the default value of the declaration. The format is the same as seen in tptaif or the declaration editor.
        Parameters:
        defaultValue - The new default value.
        Throws:
        ApiException - If the given defaultValue string could not be parsed.
        java.rmi.RemoteException - remote communication problem
      • getType

        Type getType()
              throws java.rmi.RemoteException
        Get the type of the declaration.
        Returns:
        The type of the declaration.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setType

        void setType​(Type type)
              throws ApiException,
                     java.rmi.RemoteException
        Set the type of the declaration. Anonymous types are copied so the following code will return false:
         Type anonymousType = project.createType(null, "float[]");
         Channel channel = project.createChannel("myChannel");
         channel.setType(anonymousType);
         return channel.getType().equals(anonymousType); // false
         
        If the new type is a struct, map or curve and the declaration has a unit set, the unit will be removed since units are not allowed for declarations of these types.
        Parameters:
        type - The new type of the declaration. This will reset the default value.
        Throws:
        ApiException - If the given type is unknown in the TPT project.
        java.rmi.RemoteException - remote communication problem
      • getDescription

        java.lang.String getDescription()
                                 throws java.rmi.RemoteException
        Get the description of the declaration.
        Returns:
        The description of the declaration.
        Throws:
        java.rmi.RemoteException - remote communication problem
      • setDescription

        void setDescription​(java.lang.String description)
                     throws java.rmi.RemoteException
        Set the description of the declaration.
        Parameters:
        description - The new description of the declaration. Null will be reduced to an empty string.
        Throws:
        java.rmi.RemoteException - remote communication problem