protected static boolean checkValidNamePart(String s) { if ( s.length() == 0 ) return true; CharacterIterator cIter = new StringCharacterIterator(s) ; char ch = cIter.first() ; if ( ! checkNameStartChar(ch) ) return false ; return checkNameTail(cIter) ; }
protected static boolean checkValidPrefixedName(String ns, String local) { return checkValidPrefixPart(ns) && checkValidNamePart(local) ; }
private static boolean checkNameTail(CharacterIterator cIter) { // Assumes cIter.first already called but nothing else. // Skip first char. char ch = cIter.next() ; for ( ; ch != java.text.CharacterIterator.DONE ; ch = cIter.next() ) { if ( ! checkNameChar(ch) ) return false ; } return true ; }
private static boolean checkValidPrefixName(String prefixedName) { // Split it to get the parts. int i = prefixedName.indexOf(':') ; if ( i < 0 ) throw new RiotException("Broken short form -- "+prefixedName) ; String p = prefixedName.substring(0,i) ; String x = prefixedName.substring(i+1) ; // Check legality if ( checkValidPrefixedName(p, x) ) return true ; return false ; }
private static boolean checkNameTail(CharacterIterator cIter) { // Assumes cIter.first already called but nothing else. // Skip first char. char ch = cIter.next() ; for ( ; ch != java.text.CharacterIterator.DONE ; ch = cIter.next() ) { if ( ! checkNameChar(ch) ) return false ; } return true ; }
private static boolean checkValidPrefixName(String prefixedName) { // Split it to get the parts. int i = prefixedName.indexOf(':') ; if ( i < 0 ) throw new RiotException("Broken short form -- "+prefixedName) ; String p = prefixedName.substring(0,i) ; String x = prefixedName.substring(i+1) ; // Check legality if ( checkValidPrefixedName(p, x) ) return true ; return false ; }
protected static boolean checkValidPrefixPart(String s) { if ( s.length() == 0 ) return true; CharacterIterator cIter = new StringCharacterIterator(s) ; char ch = cIter.first() ; if ( ! checkNameStartChar(ch) ) return false ; if ( ch == '_' ) // Can't start with _ (bnodes labels handled separately) return false ; return checkNameTail(cIter) ; }
protected static boolean checkValidPrefixedName(String ns, String local) { return checkValidPrefixPart(ns) && checkValidNamePart(local) ; }
protected static boolean checkValidPrefixPart(String s) { if ( s.length() == 0 ) return true; CharacterIterator cIter = new StringCharacterIterator(s) ; char ch = cIter.first() ; if ( ! checkNameStartChar(ch) ) return false ; if ( ch == '_' ) // Can't start with _ (bnodes labels handled separately) return false ; return checkNameTail(cIter) ; }
protected static boolean checkValidNamePart(String s) { if ( s.length() == 0 ) return true; CharacterIterator cIter = new StringCharacterIterator(s) ; char ch = cIter.first() ; if ( ! checkNameStartChar(ch) ) return false ; return checkNameTail(cIter) ; }