Class PatternIdentifierParser

java.lang.Object
gov.nist.secauto.oscal.lib.profile.resolver.policy.PatternIdentifierParser
All Implemented Interfaces:
IIdentifierParser

public class PatternIdentifierParser extends Object implements IIdentifierParser
  • Constructor Details

  • Method Details

    • getPattern

      public Pattern getPattern()
    • getIdentifierGroup

      public int getIdentifierGroup()
    • parse

      public String parse(@NonNull String referenceText)
      Description copied from interface: IIdentifierParser
      Parse the referenceText for the identifier.
      Specified by:
      parse in interface IIdentifierParser
      Parameters:
      referenceText - the reference text containing the identifier
      Returns:
      the identifier, or null if the identifier could not be parsed
    • update

      public String update(@NonNull String referenceText, @NonNull String newIdentifier)
      Description copied from interface: IIdentifierParser
      Substitute the provided newIdentifier with the identifier in the referenceText.
      Specified by:
      update in interface IIdentifierParser
      Parameters:
      referenceText - the reference text containing the original identifier
      newIdentifier - the new identifier to replace the existing identifier
      Returns:
      the updated reference text with the identifier replaced