public URI createSchema(String scheme, T bean) throws Exception { URISchema<T, P> schemaFactory = schemas.get(scheme); if (schemaFactory == null) { throw new NullPointerException("Schema " + scheme + " not found"); } return schemaFactory.newURI(bean); }
public T newObject(URI uri, P param) throws Exception { URISchema<T, P> schemaFactory = schemas.get(uri.getScheme()); if (schemaFactory == null) { throw new NullPointerException("Schema " + uri.getScheme() + " not found"); } return schemaFactory.newObject(uri, param); }
public void populateObject(URI uri, T bean) throws Exception { URISchema<T, P> schemaFactory = schemas.get(uri.getScheme()); if (schemaFactory == null) { throw new NullPointerException("Schema " + uri.getScheme() + " not found"); } schemaFactory.populateObject(uri, bean); }
public void registerSchema(URISchema<T, P> schemaFactory) { schemas.put(schemaFactory.getSchemaName(), schemaFactory); schemaFactory.setFactory(this); }