Class ValueCopy

  • All Implemented Interfaces:
    IValueVisitor

    class ValueCopy
    extends java.lang.Object
    implements IValueVisitor
    Filters a given Value and creates a copy without filtered elements.
    Author:
    El-Sharkawy
    • Field Detail

      • copiedValue

        private Value copiedValue
        Stores the current visited value. Maybe the same instance or a copied/filtered version. Maybe null if the current value shall be filtered out.
      • valuesOmmited

        private boolean valuesOmmited
    • Constructor Detail

      • ValueCopy

        ValueCopy​(RewriteContext context,
                  Value value)
        Single constructor of this class.
        Parameters:
        context - The context, containing information about filtered elements.
        value - The value to be copied.
    • Method Detail

      • getValue

        Value getValue()
        Returns the filtered and copied value.
        Returns:
        Maybe the same instance if filtering was not needed. Maybe null if complete value was filtered.
      • valuesOmitted

        boolean valuesOmitted()
        Returns whether the original value will be returned or whether at least one value was removed from the original value.
        Returns:
        true if at least one value was removed, false if the original value will be returned.
      • visitConstraintValue

        public void visitConstraintValue​(ConstraintValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting ConstraintValue.
        Specified by:
        visitConstraintValue in interface IValueVisitor
        Parameters:
        value - One ConstraintValue which should be visited.
      • visitEnumValue

        public void visitEnumValue​(EnumValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting EnumValue.
        Specified by:
        visitEnumValue in interface IValueVisitor
        Parameters:
        value - One EnumValue which should be visited.
      • visitStringValue

        public void visitStringValue​(StringValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting StringValue.
        Specified by:
        visitStringValue in interface IValueVisitor
        Parameters:
        value - One StringValue which should be visited.
      • visitCompoundValue

        public void visitCompoundValue​(CompoundValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting CompoundValue.
        Specified by:
        visitCompoundValue in interface IValueVisitor
        Parameters:
        value - One CompoundValue which should be visited.
      • visitContainerValue

        public void visitContainerValue​(ContainerValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting ContainerValue.
        Specified by:
        visitContainerValue in interface IValueVisitor
        Parameters:
        value - One CompoundValue which should be visited.
      • visitIntValue

        public void visitIntValue​(IntValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting IntValue.
        Specified by:
        visitIntValue in interface IValueVisitor
        Parameters:
        value - One IntValue which should be visited.
      • visitRealValue

        public void visitRealValue​(RealValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting RealValue.
        Specified by:
        visitRealValue in interface IValueVisitor
        Parameters:
        value - One RealValue which should be visited.
      • visitBooleanValue

        public void visitBooleanValue​(BooleanValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting BooleanValue.
        Specified by:
        visitBooleanValue in interface IValueVisitor
        Parameters:
        value - One BooleanValue which should be visited.
      • visitReferenceValue

        public void visitReferenceValue​(ReferenceValue referenceValue)
        Description copied from interface: IValueVisitor
        This method is used for visiting referenceValue.
        Specified by:
        visitReferenceValue in interface IValueVisitor
        Parameters:
        referenceValue - One referenceValue which should be visited.
      • visitMetaTypeValue

        public void visitMetaTypeValue​(MetaTypeValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting meta type value.
        Specified by:
        visitMetaTypeValue in interface IValueVisitor
        Parameters:
        value - a value which should be visited.
      • visitVersionValue

        public void visitVersionValue​(VersionValue value)
        Description copied from interface: IValueVisitor
        This method is used for visiting a version value.
        Specified by:
        visitVersionValue in interface IValueVisitor
        Parameters:
        value - a value which should be visited.