ilog.rules.xml.model

Interface IlrXmlSimpleType

  • All Superinterfaces:
    IlrXmlType


    public interface IlrXmlSimpleType
    extends IlrXmlType
    This class represents an XML Schema simple type. A simple type is derived from a schema built-in type by restricting its values. This restriction is performed by adding constraints.

    Some simple types are declared as primitive types of the Java language, and others are sub-classes of the Object. In any case, their implementation type as a slot of an IlrXmlObject is always a Java class. Java wrappers are used instead of primitive types. The implementation type is returned by the getJavaClass method.

    Runtime methods handle instances of the simple type. Values can be created, checked or compared.

    Constraint data makes a distinction between local information, which concerns constraints at the type level, and global information which is a synthesis of constraints at a supertype level.

    • Method Detail

      • getDynamicJavaClass

        java.lang.Class getDynamicJavaClass()
        Get the XOM declaration Java type of the simple type. It is different from the return of getJavaClass when primitive types are used.
      • getSupertype

        IlrXmlSimpleType getSupertype()
        Return the supertype. By definition, the derivation is a restriction.
      • getLocalConstraints

        IlrXmlConstraints getLocalConstraints()
        Get the local constraints. These constraints are local to the current simple type. The supertype constraints are discarded.
        See Also:
        IlrXmlConstraints
      • getGlobalConstraints

        IlrXmlConstraints getGlobalConstraints()
        Get the global contraints. These constraints constitute the constraints of all the supertypes. A synthesis over the inheritance tree of the constraints is returned.
        See Also:
        IlrXmlConstraints
      • getVarietyTypes

        IlrXmlSimpleType[] getVarietyTypes()
        Return the variety types involved in the simple type definition. In case of atomic type, this type is returned. In case of list type, the item type is returned. In case of union type, the member types are returned.
      • newInstance

        java.lang.Object newInstance(java.lang.String str)
                                     throws IlrXmlException
        Build a new simple type instance from a string. The string format is defined in the W3C XML Schema Recommendation (http://www.w3.org/TR/xmlschema-2/)
        Throws:
        IlrXmlException - Raised in case of invalid format.
        Parameters:
        str - The string.
        Returns:
        the new instance.
      • isInstance

        boolean isInstance(java.lang.Object object)
        To determine if an object is an instance of the simple type its Java class and its constraints compliance are checked.
        Parameters:
        object - The object to be checked.
        Returns:
        true if it is an instance.
      • compare

        int compare(java.lang.Object obj1,
                  java.lang.Object obj2)
                    throws IlrXmlException
        Compare two objects of simple type.
        Throws:
        IlrXmlException - Raised in case of invalidity.
        Parameters:
        obj1 - The first object.
        obj2 - The second object.
        Returns:
        The comparison result as equal, less, greater or not comparable.
        See Also:
        EQUAL, LOWER, GREATER, NOT_COMPARABLE

© Copyright IBM Corp. 1987, 2017