/** * Retrieve the SPObject factory from the stringpool to allow for the creation * of new SPObjects. * * @return The factory to allow for creation of SPObjects */ public SPObjectFactory getSPObjectFactory() { return persistentStringPool.getSPObjectFactory(); }
protected long localize(Value node, int flags) throws LocalizeException { if (state != OBTAIN) { throw new LocalizeException(node, "Attempting to localize outside transaction (STATE = " + state + ") " + System.identityHashCode(this)); } if (node == null) { throw new IllegalArgumentException("Null 'node' parameter"); } if (node instanceof BNode) { return localizeBlankNode((BNode)node, flags); } SPObjectFactory spoFactory = persistentStringPool.getSPObjectFactory(); SPObject spObject; try { spObject = spoFactory.newSPObject(node); } catch (RuntimeException ex) { throw new LocalizeException(node, "Couldn't convert Node to SPObject", ex); } assert spObject != null; try { return localizeSPObject(spObject, flags); } catch (NodePoolException e) { throw new LocalizeException(node, "Couldn't localize node", e); } catch (StringPoolException e) { throw new LocalizeException(node, "Couldn't localize node", e); } }
SPObjectFactory spObjectFactory = persistentStringPool.getSPObjectFactory(); try { spObject = spObjectFactory.newSPURI(createURI(null, null, null, query, fragment)); SPObjectFactory spObjectFactory = persistentStringPool.getSPObjectFactory(); try { spObject = spObjectFactory.newSPURI(createURI(null, null, null, getQuery(uri), fragment));
private SPObject mapAbsolute(SPObject spObject) { if ( spObject != null && spObject.getTypeCategory() == SPObject.TypeCategory.URI ) { URI uri = ((SPURI)spObject).getURI(); if (!isAbsolute(uri)) { // Model URIs are stored as a relative URI containing only a fragment. // Relative URIs with both a query string and a fragment are also used // for views. SPObjectFactory spObjectFactory = persistentStringPool.getSPObjectFactory(); try { // Construct an absolute URI based on the database URI. String query = getQuery(uri); String ssp = getSchemeSpecificPart(databaseURI); if (query != null) ssp += '?' + query; spObject = spObjectFactory.newSPURI(createURI(getScheme(databaseURI), ssp, getFragment(uri))); } catch (Exception ex) { logger.warn( "Cannot create absolute URI with base:\"" + databaseURI + "\", query:\"" + getQuery(uri) + "\", fragment:\"" + getFragment(uri) + "\"", ex ); } } } return spObject; }