/** * {@inheritDoc} * * @see org.modeshape.graph.property.Path#relativeToRoot() */ public Path relativeToRoot() { return new BasicPath(getSegmentsList(), false); }
/** * Refresh the namespaces from the persistent store, and update the embedded cache. This operation is done atomically. */ public void refresh() { SimpleNamespaceRegistry newCache = new SimpleNamespaceRegistry(); initializeCacheFromStore(newCache); this.cache = newCache; }
/** * {@inheritDoc} * * @see org.modeshape.graph.property.basic.AbstractPath#relativeToRoot() */ @Override public Path relativeToRoot() { return new BasicPath(getSegmentsList(), false); }
@Before public void beforeEach() { this.registry = new SimpleNamespaceRegistry(); this.registry.register("dna", "http://www.modeshape.org/namespace"); this.stringValueFactory = new StringValueFactory(registry, Path.DEFAULT_DECODER, Path.DEFAULT_ENCODER); this.nameFactory = new NameValueFactory(registry, Path.DEFAULT_DECODER, stringValueFactory); this.factory = new PathValueFactory(Path.DEFAULT_DECODER, stringValueFactory, nameFactory); }
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { stringFactory = new StringValueFactory(new SimpleNamespaceRegistry(), Path.URL_DECODER, Path.URL_ENCODER); factory = new LongValueFactory(Path.URL_DECODER, stringFactory); }
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { registry = new SimpleNamespaceRegistry(); stringFactory = new StringValueFactory(registry, Path.URL_DECODER, Path.DEFAULT_ENCODER); factory = new BooleanValueFactory(Path.URL_DECODER, stringFactory); }
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { registry = new SimpleNamespaceRegistry(); stringFactory = new StringValueFactory(registry, Path.URL_DECODER, Path.DEFAULT_ENCODER); factory = new DecimalValueFactory(Path.URL_DECODER, stringFactory); }
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { registry = new SimpleNamespaceRegistry(); stringFactory = new StringValueFactory(registry, Path.URL_DECODER, Path.URL_ENCODER); factory = new DoubleValueFactory(Path.URL_DECODER, stringFactory); }
/** * {@inheritDoc} */ public Path create( Name value ) { if (value == null) return null; try { return new ChildPath(RootPath.INSTANCE, new BasicPathSegment(value)); } catch (IllegalArgumentException e) { throw new ValueFormatException(value, getPropertyType(), e); } }
@Before @Override public void beforeEach() { super.beforeEach(); // parent = mock(Path.class); parent = path("/a/b/c"); childSegment = segment("d"); path = new ChildPath(parent, childSegment); root = RootPath.INSTANCE; }
/** * {@inheritDoc} * * @see org.modeshape.graph.property.basic.AbstractNamespaceRegistryTest#createNamespaceRegistry() */ @Override protected ThreadSafeNamespaceRegistry createNamespaceRegistry() { return new ThreadSafeNamespaceRegistry(new SimpleNamespaceRegistry()); }
protected Path.Segment segment( String segment ) { Name name = new BasicName("", segment); return new BasicPathSegment(name); }
/** * {@inheritDoc} */ public T[] create( Object[] values ) { if (values == null) return null; final int length = values.length; T[] result = createEmptyArray(length); for (int i = 0; i != length; ++i) { result[i] = create(values[i]); } return result; }
/** * {@inheritDoc} */ public Property create( Name name, Iterable<?> values ) { return create(name, PropertyType.OBJECT, values); }
/** * {@inheritDoc} */ public String getString() { return getString(Path.DEFAULT_ENCODER); }
/** * {@inheritDoc} * * @see org.modeshape.graph.property.Path#getParent() */ public Path getParent() { return getAncestor(1); }
/** * {@inheritDoc} */ public T[] create( URI[] values ) { if (values == null) return null; final int length = values.length; T[] result = createEmptyArray(length); for (int i = 0; i != length; ++i) { result[i] = create(values[i]); } return result; }
/** * {@inheritDoc} */ public Property create( Name name, Iterator<?> values ) { return create(name, PropertyType.OBJECT, values); }
/** * {@inheritDoc} */ public String getString( NamespaceRegistry namespaceRegistry ) { return getString(namespaceRegistry, Path.DEFAULT_ENCODER); }