Class CardinalityLeafSpec

  • All Implemented Interfaces:
    BaseSpec

    public class CardinalityLeafSpec
    extends CardinalitySpec
    Leaf level CardinalitySpec object.

    If this CardinalitySpec's PathElement matches the input (successful parallel tree walk) this CardinalitySpec has the information needed to write the given data to the output object.

    • Constructor Detail

      • CardinalityLeafSpec

        public CardinalityLeafSpec​(java.lang.String rawKey,
                                   java.lang.Object rhs)
    • Method Detail

      • applyCardinality

        public boolean applyCardinality​(java.lang.String inputKey,
                                        java.lang.Object input,
                                        WalkedPath walkedPath,
                                        java.lang.Object parentContainer)
        If this CardinalitySpec matches the inputkey, then do the work of modifying the data and return true.
        Specified by:
        applyCardinality in class CardinalitySpec
        Returns:
        true if this this spec "handles" the inputkey such that no sibling specs need to see it
      • applyToParentContainer

        public java.lang.Object applyToParentContainer​(java.lang.String inputKey,
                                                       java.lang.Object input,
                                                       WalkedPath walkedPath,
                                                       java.lang.Object parentContainer)
        This should only be used by composite specs with an '@' child
        Returns:
        null if no work was done, otherwise returns the re-parented data
      • performCardinalityAdjustment

        private java.lang.Object performCardinalityAdjustment​(java.lang.String inputKey,
                                                              java.lang.Object input,
                                                              WalkedPath walkedPath,
                                                              java.util.Map parentContainer,
                                                              MatchedElement thisLevel)
        Returns:
        null if no work was done, otherwise returns the re-parented data