Class ElementDefinition.Slicing

  • All Implemented Interfaces:
    Visitable
    Enclosing class:
    ElementDefinition

    public static class ElementDefinition.Slicing
    extends BackboneElement
    Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).
    • Method Detail

      • getDiscriminator

        public List<ElementDefinition.Slicing.Discriminator> getDiscriminator()
        Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.
        Returns:
        An unmodifiable list containing immutable objects of type ElementDefinition.Slicing.Discriminator that may be empty.
      • getDescription

        public String getDescription()
        A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.
        Returns:
        An immutable object of type String that may be null.
      • getOrdered

        public Boolean getOrdered()
        If the matching elements have to occur in the same order as defined in the profile.
        Returns:
        An immutable object of type Boolean that may be null.
      • getRules

        public SlicingRules getRules()
        Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.
        Returns:
        An immutable object of type SlicingRules that is non-null.
      • accept

        public void accept​(String elementName,
                           int elementIndex,
                           Visitor visitor)
        Description copied from interface: Visitable
        Accept a Visitor and invoke the appropriate visit methods. A typical implementation would look like this:
         if (visitor.preVisit(this)) {
             visitor.visitStart(elementName, elementIndex, this);
             if (visitor.visit(elementName, elementIndex, this)) {
                 // visit children
             }
             visitor.visitEnd(elementName, elementIndex, this);
             visitor.postVisit(this);
         }
         
        Specified by:
        accept in interface Visitable
        Specified by:
        accept in class AbstractVisitable
        Parameters:
        elementName - the name of the element in the context of this visit
        elementIndex - the index of the element in a list or -1 if it is not contained within a List
        visitor - the visitor to use
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object