public static Map<String,String> parse( String notation ) {
        Matcher matcher = NOTATION_PATTERN.matcher(notation);
        if ( matcher.find() ) {

            Map<String,String> notationMap = new HashMap<String,String>();

            int groupIdMatch = 1;
            notationMap.put( "groupId", matcher.group(groupIdMatch) );

            int artifactIdMatch = 2;
            notationMap.put( "artifactId", matcher.group(artifactIdMatch) );

            // if type is null
            int groupingMatch = 4;
            if ( matcher.group(groupingMatch) == null ) {
                int versionMatch = 3;
                notationMap.put( "version", matcher.group(versionMatch) );

            // if type exists
            } else {
                int typeMatch = 3;
                notationMap.put( "type", matcher.group(typeMatch) );

                int versionMatch = 5;
                notationMap.put( "version", matcher.group(versionMatch) );
            }

            return notationMap;
        } else {
            return null;
        }
    }
public static Map < String , String > parse ( String notation ) { Matcher matcher = NOTATION_PATTERN . matcher ( notation ) ; if ( matcher . find ( ) ) { Map < String , String > notationMap = new HashMap < String , String > ( ) ; int groupIdMatch = 1 ; notationMap . put ( "groupId" , matcher . group ( groupIdMatch ) ) ; int artifactIdMatch = 2 ; notationMap . put ( "artifactId" , matcher . group ( artifactIdMatch ) ) ; int groupingMatch = 4 ; if ( matcher . group ( groupingMatch ) == null ) { int versionMatch = 3 ; notationMap . put ( "version" , matcher . group ( versionMatch ) ) ; } else { int typeMatch = 3 ; notationMap . put ( "type" , matcher . group ( typeMatch ) ) ; int versionMatch = 5 ; notationMap . put ( "version" , matcher . group ( versionMatch ) ) ; } return notationMap ; } else { return null ; } }
Parsing the notation and returns a Map with keys
<ul>
<li>groupId</li>
<li>artifactId</li>
<li>type - may be null if not in the notation param</li>
<li>version</li>
</ul>

@param notation String
@return Map