String getNamespaceUriForAliasHandlingUnknown ( boolean errorOnUnknown , String alias ) { String result = getUriForAlias ( alias ) ; if ( result == null ) { Preconditions . checkArgument ( ! errorOnUnknown , "unrecognized alias: %s" , alias . length ( ) == 0 ? "(default)" : alias ) ; return "http://unknown/" + alias ; } return result ; }
Returns the namespace URI to use for serialization for a given namespace alias possibly using a predictable made - up namespace URI if the alias is not recognized .