company logo

TypeDefinition :: propertyDefinition - Get property definition

The function returns the property definition for the requested property. Property definitions are available for complex data types (view, class, structure), only.

When calling the function with an invalid type definition or when the type definition does not refer to a complex data type, the function throws an exception. The function also throws an exception, when the requested property is not defined in the context of the complex data type.

Return value:  Property definition ( odaba::PropertyDefinition  )

The property definition provides meta-information about the property.

Implementation overview

Implementation details

  1. Return property definition by name or path
    const odaba::PropertyDefinition TypeDefinition  :: propertyDefinition ( odaba::String &sPropertyName )

    The function returns the property definition for the property name or path passed sPropertyName. The string passed may contain a property path. The property is looked for in the current type definition and, when not being found, in subsequent type definitions for base types.

    When the requested property definition could not be provided, the function throws an exception.

    • sPropertyName - Property name

      The property name may contain a property path that consists of a sequence of property names. Not allowed are operation paths or path properties, i.e. the property name must consist of identifiers separated by dots (.), only.

      In order to pass no property name, an empty string ( String() ) has to be passed.

  2. to list
  3. Get property definition by position
    const odaba::PropertyDefinition TypeDefinition  :: propertyDefinition ( int32 iPosition )

    The function returns the property definition at requested position. Property definitions are ordered by type, i.e. base type definitions are followed by attribute, reference and relationship definitions. Base types are returned as one property. Base type details must be retrieved separately of by calling attributeName() or referenceName().

    When the requested property definition could not be provided, the function throws an exception.

    // fragment

    ... function(typeDefinition &typeDef,iPosition) {

      PropertyDefinition   pd;

      String               name;

      

      name = typeDef.attributeName(iPosition,false,true);

      if ( !name.isEmpty() )  // attribute path found

        pd = typeDef.propertyDefinition(name);

      return ( pd );

    }

    • iPosition - Position in collection

      The position of an element in a collection is beginning with 0 for the first element.

  4. to list