com.microfocus.awm.meta.util

## Class LineReplacementRule

- java.lang.Object
- - com.microfocus.awm.meta.util.LineReplacementRule

- All Implemented Interfaces:
    ILowLevelConvertionRule

      public abstract class LineReplacementRule
      extends java.lang.Object
      implements ILowLevelConvertionRule

  A replacement rule that is used by the `TaurusModelConverter` to make complex conversions in the AWM model.

  Copyright Micro Focus GmbH.

  Author:
    NicolasP

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LineReplacementRule()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `convertLine(java.lang.String pLine)` Attempts to convert the given line from an AWM XML model.
    `java.lang.String` | `getNewValue()` Gets the new value of this rule.
    `java.lang.String` | `getOutdatedValue()` Gets the outdated value of this rule (the value to be replaced).
    `abstract java.lang.String` | `replaceLine(java.lang.String pLine)`
    `static java.lang.String` | `replaceXMLAttribute(java.lang.String pLine, java.lang.String pAttributeLabel, java.lang.String pNewValue, boolean pRemoveAttributeValue)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LineReplacementRule

          public LineReplacementRule()

  - ### Method Detail

    - #### convertLine

          public java.lang.String convertLine(java.lang.String pLine)

      Description copied from interface: `ILowLevelConvertionRule`
      Attempts to convert the given line from an AWM XML model. If no conversion is done, the original line must be returned.
      Specified by:
        `convertLine` in interface `ILowLevelConvertionRule`
      Parameters:
        `pLine` - the line for potential conversion
      Returns:
        the converted or unchanged line

    - #### replaceLine

          public abstract java.lang.String replaceLine(java.lang.String pLine)

      Parameters:
        `pLine` - the line that should be replaced
      Returns:
        the replaced line or the same line, if nothing changed

    - #### getNewValue

          public java.lang.String getNewValue()

      Description copied from interface: `ILowLevelConvertionRule`
      Gets the new value of this rule.
      Specified by:
        `getNewValue` in interface `ILowLevelConvertionRule`
      Returns:
        the new value

    - #### getOutdatedValue

          public java.lang.String getOutdatedValue()

      Description copied from interface: `ILowLevelConvertionRule`
      Gets the outdated value of this rule (the value to be replaced).
      Specified by:
        `getOutdatedValue` in interface `ILowLevelConvertionRule`
      Returns:
        the outdated value

    - #### replaceXMLAttribute

          public static java.lang.String replaceXMLAttribute(java.lang.String pLine,
                                                             java.lang.String pAttributeLabel,
                                                             java.lang.String pNewValue,
                                                             boolean pRemoveAttributeValue)

      Parameters:
        `pLine` - the line that should be edited
        `pAttributeLabel` - the xml attribute label, that should be edited
        `pNewValue` - the new value, that should replace the old value
        `pRemoveAttributeValue` - whether the value of the attribute should be replaced aswell or not
      Returns:
        the edited line as `String`

Copyright © 2015 Micro Focus GmbH. All rights reserved.