/** * Implements {@link URI#getNamespace()}. */ @Override public String getNamespace() { return uri.getNamespace(); }
/** * Implements {@link URI#getNamespace()}. */ @Override public String getNamespace() { return uri.getNamespace(); }
public String getPackageName(URI uri) { if (packages.containsKey(uri.getNamespace())) return packages.get(uri.getNamespace()); Class javaClass = findJavaClass(uri); if (javaClass == null || javaClass.getPackage() == null) return null; return javaClass.getPackage().getName(); }
public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof URI) { URI other = (URI)o; return _localName.equals(other.getLocalName()) && _namespace.equals(other.getNamespace()); } return false; }
private QueryModelNode createNode(URI uri) { assert uri.getNamespace().equals(SeRQO.NAMESPACE_URL); String pkg = QueryModelNode.class.getPackage().getName(); String name = pkg + '.' + uri.getLocalName(); try { Class type = Class.forName(name); return (QueryModelNode) type.newInstance(); } catch (Exception e) { throw new UndeclaredThrowableException(e); } }
public QName createQName(Resource res) { if (res instanceof URI) { URI uri = (URI) res; String prefix = getPrefix(uri.getNamespace()); return new QName(uri.getNamespace(), uri.getLocalName(), prefix); } return null; }
@Override public String shortURIasString(URI uri) { if (namespaces2namespacePrefixes.containsKey(uri.getNamespace())) { return namespaces2namespacePrefixes.get(uri.getNamespace()) + ":" + uri.getLocalName(); } else { return uri.stringValue(); } }
private Resource getContainerURI(Resource subj) { if (subj instanceof URI) { URI uri = (URI) subj; String ns = uri.getNamespace(); if (ns.charAt(ns.length() - 1) == '#') return vf.createURI(ns.substring(0, ns.length() - 1)); } return subj; }
@Override public String toAvroFullName(URI rdfName) { StringBuilder builder = new StringBuilder(); appendAvroNamespace(builder, rdfName.getNamespace()); builder.append('.'); builder.append(rdfName.getLocalName()); return builder.toString(); }
@Override public UID getUID(URI uri) { UID uid = uidCache.get(uri); if (uid == null) { uid = new UID(uri.getNamespace(), uri.getLocalName()); uidCache.put(uri, uid); } return uid; }
@Override public UID getUID(URI uri) { UID uid = uidCache.get(uri); if (uid == null) { uid = new UID(uri.getNamespace(), uri.getLocalName()); uidCache.put(uri, uid); } return uid; }
public String toExternal(final URI uri) { if (prefixDecls != null) { final String prefix = namespaces.get(uri.getNamespace()); if (prefix != null) { return prefix + ":" + uri.getLocalName(); } } return "<" + uri.stringValue() + ">"; }
/** * Implements {@link URI#getNamespace()}. */ public String getNamespace() { if (!isURI()) throw new ClassCastException(); return ((URI) getValue()).getNamespace(); }
static Namespace fromURI(URI uri) { for(Namespace namespace:values()) { if(namespace.getId().equals(uri.getNamespace())) { return namespace; } } return UNKNOWN; }
public String getClassName(URI name) throws ObjectStoreConfigException { if (JAVA_NS.equals(name.getNamespace())) return name.getLocalName(); return resolver.getClassName(name); }
@Nullable private String shorten(@Nullable final URI uri) { if (uri == null) { return null; } final String prefix = this.namespaces.prefixFor(uri.getNamespace()); if (prefix != null) { return prefix + ':' + uri.getLocalName(); } return "<../" + uri.getLocalName() + ">"; }
private void emitURI(final URI uri) throws IOException { final String prefix = this.prefixes.get(uri.getNamespace()); this.writer.append('\"'); if (prefix != null) { emitString(prefix); this.writer.append(':'); emitString(uri.getLocalName()); } else { emitString(uri.stringValue()); } this.writer.append('\"'); }
public String getMethodName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); if (prefixes.containsKey(ns)) return word(getMemberPrefix(ns) + initcap(localPart)); return word(localPart); }
public String getPluralParameterName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); String plural = plural(localPart); if (model.contains(new URIImpl(ns + plural), null, null)) { plural = localPart; } return word(plural); }
public String getPluralPropertyName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); String plural = plural(localPart); if (model.contains(new URIImpl(ns + plural), null, null)) { plural = localPart; } if (prefixes.containsKey(ns)) return getMemberPrefix(ns) + initcap(plural); return enc(plural); }