Skip to content

Commit

Permalink
reverted working schemamanager design, added .gitignores to empty dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophos-Elias-Vasylenko committed Jan 23, 2016
1 parent 46b613e commit 5083e92
Show file tree
Hide file tree
Showing 23 changed files with 1,095 additions and 586 deletions.
2 changes: 1 addition & 1 deletion cnf/build.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ runreq.felix.web=\
osgi.identity;filter:='(osgi.identity=org.apache.felix.webconsole.plugins.useradmin)'

runreq.eclipselink.jpa=\,\
osgi.identity;filter:='(osgi.identity=org.apache.aries.jpa.eclipselink.adapter)'
osgi.identity;filter:='(osgi.identity=org.apache.aries.jpa.eclipselink.adapter)',\
osgi.identity;filter:='(osgi.identity=javax.persistence)'

# Build path groups:
Expand Down
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion uk.co.strangeskies.modabi.core.api/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Export-Package: \
uk.co.strangeskies.modabi.processing,\
uk.co.strangeskies.modabi.processing.providers,\
uk.co.strangeskies.modabi.schema,\
uk.co.strangeskies.modabi.schema.building
uk.co.strangeskies.modabi.schema.building
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
*/
package uk.co.strangeskies.modabi;

import uk.co.strangeskies.modabi.io.structured.StructuredDataSource;
import uk.co.strangeskies.modabi.schema.Model;

public interface Binding<T> {
public Model<T> getModel();

public T getData();

public void updateData();
// public void updateData();

public StructuredDataSource getSource();
// public StructuredDataSource getSource();

public void updateSource();
// public void updateSource();
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface SchemaManager {
interface Binder<T> {
BindingFuture<T> from(StructuredDataSource input);

BindingFuture<T> from(RewritableStructuredData input);
// BindingFuture<T> from(RewritableStructuredData input);

default BindingFuture<T> from(File input) {
return from(input.toURI());
Expand All @@ -67,7 +67,7 @@ default BindingFuture<T> from(URI input) {

BindingFuture<T> from(String extension, InputStream input);

Binder<T> updatable();
// Binder<T> updatable();

/*
* Errors which are rethrown will be passed to the next error handler if
Expand All @@ -80,7 +80,7 @@ default BindingFuture<T> from(URI input) {
interface Unbinder<T> {
<U extends StructuredDataTarget> U to(U output);

BindingFuture<T> to(RewritableStructuredData output);
// BindingFuture<T> to(RewritableStructuredData output);

default BindingFuture<T> to(File output) {
return to(output.toURI());
Expand All @@ -100,12 +100,11 @@ default BindingFuture<T> to(URL output) {
if (lastDot > 0) {
extension = extension.substring(lastDot);
} else {
throw new IllegalArgumentException("No recognisable extension for file'"
+ output + "', data interface cannot be selected");
throw new IllegalArgumentException(
"No recognisable extension for file'" + output + "', data interface cannot be selected");
}

try (
OutputStream fileStream = output.openConnection().getOutputStream()) {
try (OutputStream fileStream = output.openConnection().getOutputStream()) {
BindingFuture<T> binding = to(extension, fileStream);
fileStream.flush();
return binding;
Expand All @@ -116,7 +115,7 @@ default BindingFuture<T> to(URL output) {

BindingFuture<T> to(String extension, OutputStream output);

Unbinder<T> updatable();
// Unbinder<T> updatable();

/*
* Errors which are rethrown will be passed to the next error handler if
Expand All @@ -140,31 +139,23 @@ default GeneratedSchema generateSchema(QualifiedName name) {
return generateSchema(name, Collections.emptySet());
}

default GeneratedSchema generateSchema(QualifiedName name,
Schema... dependencies) {
default GeneratedSchema generateSchema(QualifiedName name, Schema... dependencies) {
return generateSchema(name, Arrays.asList(dependencies));
}

GeneratedSchema generateSchema(QualifiedName name,
Collection<? extends Schema> dependencies);
GeneratedSchema generateSchema(QualifiedName name, Collection<? extends Schema> dependencies);

<T> void registerProvider(TypeToken<T> providedClass, Supplier<T> provider);

void registerProvider(Function<TypeToken<?>, ?> provider);

default <T> void registerProvider(Class<T> providedClass,
Supplier<T> provider) {
default <T> void registerProvider(Class<T> providedClass, Supplier<T> provider) {
registerProvider(TypeToken.over(providedClass), provider);
}

boolean registerSchema(Schema schema);

default <T> BindingFuture<T> registerBinding(Model<T> model, T data) {
BindingFuture<T> binding = unbind(model, data)
.to(new DiscardingStructuredDataTarget());
binding.resolve();
return binding;
}
<T> BindingFuture<T> registerBinding(Model<T> model, T data);

// Blocks until all possible processing is done other than waiting imports:
<T> Binder<T> bind(Model<T> model);
Expand Down
2 changes: 1 addition & 1 deletion uk.co.strangeskies.modabi.core.provider/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ Bundle-Description: \
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(&(osgi.identity=org.apache.felix.scr)(version>=1.8.2)(version<=1.8.2))'
-runee: JavaSE-1.8
-runfw: org.eclipse.osgi
-runfw: org.eclipse.osgi
Loading

0 comments on commit 5083e92

Please sign in to comment.