commit dcd5d96bb2d6c88b3a7636f5a2a3eab9fa1693b7
parent b92ca8a1aec86a440acc1f46c2d8e5c7517e083f
Author: Dan Callaghan <djc@djc.id.au>
Date: Sun, 2 May 2010 13:35:49 +1000
to make custom AdaptationFactories simpler
Diffstat:
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/main/java/au/com/miskinhill/rdftemplate/selector/AdaptationFactory.java b/src/main/java/au/com/miskinhill/rdftemplate/selector/AdaptationFactory.java
@@ -2,6 +2,8 @@ package au.com.miskinhill.rdftemplate.selector;
public interface AdaptationFactory {
+ boolean hasName(String name);
+
Adaptation<?> getByName(String name);
}
diff --git a/src/main/java/au/com/miskinhill/rdftemplate/selector/DefaultAdaptationFactory.java b/src/main/java/au/com/miskinhill/rdftemplate/selector/DefaultAdaptationFactory.java
@@ -19,6 +19,11 @@ public class DefaultAdaptationFactory implements AdaptationFactory {
}
@Override
+ public boolean hasName(String name) {
+ return ADAPTATIONS.containsKey(name);
+ }
+
+ @Override
public Adaptation<?> getByName(String name) {
Class<? extends Adaptation<?>> adaptationClass = ADAPTATIONS.get(name);
if (adaptationClass == null) {