Class SISComponentID

    • Field Detail

      • COMPONENT_ID_PATTERN

        public static final Pattern COMPONENT_ID_PATTERN
      • COMPONENT_ID_PATTERN_NOTYPE

        public static final Pattern COMPONENT_ID_PATTERN_NOTYPE
    • Method Detail

      • fromString

        public static SISComponentID fromString​(String s)
                                         throws IllegalArgumentException
        Obtain a SISComponentID from a string with a type prefix, for example: MacroID[name=Foo,vendor=Bar,version=1.0].
        Parameters:
        s - the string to parse, must be of the form Type[name=X,vendor=Y,version=Z], or "null".
        Returns:
        an object of the type implied by the prefix, or null if the string equalled the literal "null".
        Throws:
        IllegalArgumentException - if the string could not be parsed, or the type was unknown.
      • fromString

        public static <T extends ComponentID> T fromString​(Class<T> type,
                                                           String s)
                                                    throws IllegalArgumentException
        Obtain a ComponentID from a string, with no type prefix, for example: name=Foo,vendor=Bar,version=1.0.
        Parameters:
        type - the desired ComponentID concrete class to return. The concrete class must have a public constructor with 3 string args (name, vendor, version).
        s - the string to parse, must be of the form name=x,vendor=y,version=z, or "null".
        Returns:
        an object of the given type, or null if the string equalled the literal "null".
        Throws:
        IllegalArgumentException - if the string could not be parsed, or an instance of the class could not be created.