예제 #1
0
  @Override
  public SecuredPrefixMapping withDefaultMappings(final PrefixMapping map) {
    // mapping only updates if there are map entries to add.  Since this gets called
    // when we are doing deep triple checks while writing we need to attempt the
    // update only if there are new updates to add.

    PrefixMapping m = holder.getBaseItem();
    PrefixMappingImpl pm = new PrefixMappingImpl();
    for (Entry<String, String> e : map.getNsPrefixMap().entrySet()) {
      if (m.getNsPrefixURI(e.getKey()) == null && m.getNsURIPrefix(e.getValue()) == null) {
        pm.setNsPrefix(e.getKey(), e.getValue());
      }
    }
    if (!pm.getNsPrefixMap().isEmpty()) {
      checkUpdate();
      holder.getBaseItem().withDefaultMappings(pm);
    }
    return holder.getSecuredItem();
  }
예제 #2
0
 @Override
 public SecuredPrefixMapping setNsPrefix(final String prefix, final String uri) {
   checkUpdate();
   holder.getBaseItem().setNsPrefix(prefix, uri);
   return holder.getSecuredItem();
 }
예제 #3
0
 @Override
 public SecuredPrefixMapping removeNsPrefix(final String prefix) {
   checkUpdate();
   holder.getBaseItem().removeNsPrefix(prefix);
   return holder.getSecuredItem();
 }
예제 #4
0
 @Override
 public SecuredPrefixMapping lock() {
   checkUpdate();
   holder.getBaseItem().lock();
   return holder.getSecuredItem();
 }
예제 #5
0
 @Override
 public SecuredPrefixMapping setNsPrefixes(final PrefixMapping other) {
   checkUpdate();
   holder.getBaseItem().setNsPrefixes(other);
   return holder.getSecuredItem();
 }
예제 #6
0
 @Override
 public SecuredPrefixMapping setNsPrefixes(final Map<String, String> map) {
   checkUpdate();
   holder.getBaseItem().setNsPrefixes(map);
   return holder.getSecuredItem();
 }