Java 8 InvalidNameException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InvalidNameException class.

This code example shows how to use the following methods:
	public static String checkAndFilterName(String name) throws InvalidNameException {
 
		String out = filterName(name);
 
		if (isBlacklistName(out))
			throw new InvalidNameException(out + " is an invalid name.");
 
		return out;
	} 
 
	/** 
	 * Check and perform regex on any Player names 
	 *  
	 * @param name 
	 * @return String of the valid name result. 
	 * @throws InvalidNameException 
	 */ 
	public static String checkAndFilterPlayerName(String name) throws InvalidNameException {
 
		String out = filterName(name);
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
This code example shows how to use the following methods:
    BlueprintName result = new BlueprintName(name);
    String urlScheme = result.getScheme();
    String schemePath = result.getSchemePath();
     
    if (!BLUEPRINT_SCHEME.equals(urlScheme) || !COMP_PATH.equals(schemePath)) {
      throw new InvalidNameException(name);
    } 
    return result;
  } 
 
  @Override 
  public boolean equals(Object other) 
  { 
    return other instanceof OsgiNameParser; 
  } 
   
  @Override 
  public int hashCode() 
  { 
    return 100004; 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
                           absoluteName );
               } 
               Name name = parser.parse(pathComponent.substring(1));
               return name.toString();
           } catch ( URISyntaxException e ) {
               throw new InvalidNameException(
                       "Search returned unparseable absolute name: " + 
                       absoluteName );
           } 
        } 
    } 
 
 
    // ------------------------------------------------------ Private Classes 
 
    /** 
     * A protected class representing a User 
     */ 
    protected static class User { 
 
2
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	 * @throws InvalidNameException if name is not absolute 
	 */ 
	public DirContext resolveSchema(Name name) throws NamingException
	{ 
		if (!(name instanceof URIName)) {
			throw new InvalidNameException("Name '" + name + " is not URIName.");
		} 
 
		URIName un = (URIName)name;
 
		if (un.isRelative()) {
			throw new InvalidNameException("Name '" + name
			    + " is not absolute."); 
		} 
 
		DirContext ctx = dirs.get(un.get(0));
 
		if (ctx == null) {
			throw new NamingException("DirContext for schema from '" + name
			    + "' is not loaded."); 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
               NameParser parser = context.getNameParser("");
               URI userNameUri = new URI(absoluteName);
               String pathComponent = userNameUri.getPath();
               // Should not ever have an empty path component, since that is /{DN} 
               if (pathComponent.length() < 1 ) {
                   throw new InvalidNameException(
                           "Search returned unparseable absolute name: " + 
                           absoluteName );
               } 
               Name name = parser.parse(pathComponent.substring(1));
               return name.toString();
           } catch ( URISyntaxException e ) {
               throw new InvalidNameException(
                       "Search returned unparseable absolute name: " + 
                       absoluteName );
           } 
        } 
    } 
 
 
1
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	 * @see javax.naming.Context#lookup(javax.naming.Name) 
	 */ 
	public Object lookup(Name name) throws NamingException
	{ 
		if (name == null) {
			throw new InvalidNameException("Name is null.");
		} 
 
		if (name.isEmpty()) {
			return this;
		} 
 
		return values.get(resolveName(name));
	} 
 
	/** 
	 * 
	 * @see javax.naming.Context#lookup(java.lang.String) 
	 */ 
	public Object lookup(String name) throws NamingException
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 InvalidNameException Methods: