public SimpleName(final Name name) { this(name.getAll()); }
protected ServiceName buildServiceName(final Name name) { final Enumeration<String> parts = name.getAll(); ServiceName current = serviceNameBase; while (parts.hasMoreElements()) { final String currentPart = parts.nextElement(); if (!currentPart.isEmpty()) { current = current.append(currentPart); } } return current; }
public Name getPrefix(int posn) { Enumeration comps = super.getPrefix(posn).getAll(); return new CNCompoundName(comps); }
public Name getSuffix(int posn) { Enumeration comps = super.getSuffix(posn).getAll(); return new CNCompoundName(comps); }
/** * Create a CompositeName where each name segment is equal to the name segment in the source name. * * @param name the source name * @return a {@link CompositeName} where each name segment is equal to the name segment in the source name * @throws InvalidNameException if an error occurs while converting the source name to a {@link CompositeName} */ public static CompositeName toDecomposedCompositeName(final Name name) throws InvalidNameException { if (name instanceof CompositeName) { return (CompositeName) name; } else { final CompositeName compositeName = new CompositeName(); final Enumeration<String> enumeration = name.getAll(); if (enumeration.hasMoreElements()) { int idx = 0; String item; do { item = enumeration.nextElement(); if (item == null) { throw Messages.log.invalidNullSegment(idx); } compositeName.add(item); idx ++; } while (enumeration.hasMoreElements()); } return compositeName; } }
protected ServiceName buildServiceName(final Name name) { final Enumeration<String> parts = name.getAll(); ServiceName current = serviceNameBase; while (parts.hasMoreElements()) { final String currentPart = parts.nextElement(); if (!currentPart.isEmpty()) { current = current.append(currentPart); } } return current; }
protected ServiceName buildServiceName(final Name name) { final Enumeration<String> parts = name.getAll(); ServiceName current = serviceNameBase; while (parts.hasMoreElements()) { final String currentPart = parts.nextElement(); if (!currentPart.isEmpty()) { current = current.append(currentPart); } } return current; }
protected ServiceName buildServiceName(final Name name) { final Enumeration<String> parts = name.getAll(); ServiceName current = serviceNameBase; while (parts.hasMoreElements()) { final String currentPart = parts.nextElement(); if (!currentPart.isEmpty()) { current = current.append(currentPart); } } return current; }
@Override public Name addAll(int posn, Name n) { int i = posn; for (Enumeration e = n.getAll(); e.hasMoreElements(); i++) { add(i, (String) e.nextElement()); } return this; }
@Override public Name addAll(Name n) { for (Enumeration e = n.getAll(); e.hasMoreElements(); ) { add((String) e.nextElement()); } return this; }
@Override public void bind(Name name, Object obj) throws NamingException { this.bind(StringUtils.join(Collections.list(name.getAll()), "/"), obj); }
@Override public Name addAll(Name n) { for (Enumeration e = n.getAll(); e.hasMoreElements(); ) { add((String) e.nextElement()); } return this; }
@Override public Name addAll(int posn, Name n) { int i = posn; for (Enumeration e = n.getAll(); e.hasMoreElements(); i++) { add(i, (String) e.nextElement()); } return this; }
@Override public void unbind(Name name) throws NamingException { this.unbind(StringUtils.join(Collections.list(name.getAll()), "/")); }
@Override public Object lookup(Name name) throws NamingException { return this.lookup(StringUtils.join(Collections.list(name.getAll()), "/")); }
@Override public void unbind(Name name) throws NamingException { this.unbind(StringUtils.join(Collections.list(name.getAll()), "/")); }
@Override public Object lookup(Name name) throws NamingException { return this.lookup(StringUtils.join(Collections.list(name.getAll()), "/")); }
@Override public void bind(Name name, Object obj) throws NamingException { this.bind(StringUtils.join(Collections.list(name.getAll()), "/"), obj); }
public Name getPrefix(int posn) { Enumeration comps = super.getPrefix(posn).getAll(); return new CNCompoundName(comps); }
public Name getSuffix(int posn) { Enumeration comps = super.getSuffix(posn).getAll(); return new CNCompoundName(comps); }