public static Cpe parse ( String cpeString , boolean lenient ) throws CpeParsingException { if ( cpeString == null ) { throw new CpeParsingException ( "CPE String is null and cannot be parsed" ) ; } else if ( cpeString . regionMatches ( 0 , "cpe:/" , 0 , 5 ) ) { return parse22 ( cpeString , lenient ) ; } else if ( cpeString . regionMatches ( 0 , "cpe:2.3:" , 0 , 8 ) ) { return parse23 ( cpeString , lenient ) ; } throw new CpeParsingException ( "The CPE string specified does not conform to the CPE 2.2 or 2.3 specification" ) ; }
Parses a CPE String into an object with the option of parsing CPE 2 . 2 URI strings in lenient mode - allowing for CPE values that do not adhere to the specification .