-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix #286] Add CharacterHandler and ModeHandler and register them in …
…HandlerRegistry
- Loading branch information
Showing
6 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
s-pipes-core/src/main/java/cz/cvut/spipes/modules/handlers/CharacterHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package cz.cvut.spipes.modules.handlers; | ||
|
||
import cz.cvut.spipes.engine.ExecutionContext; | ||
import org.apache.jena.rdf.model.RDFNode; | ||
import org.apache.jena.rdf.model.Resource; | ||
|
||
public class CharacterHandler extends BaseRDFNodeHandler<Character> { | ||
|
||
public CharacterHandler(Resource resource, ExecutionContext executionContext, Setter<? super Character> setter) { | ||
super(resource, executionContext, setter); | ||
} | ||
|
||
@Override | ||
Character getRDFNodeValue(RDFNode node) throws Exception { | ||
return node.asLiteral().getChar(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
s-pipes-modules/module-tabular/src/main/java/cz/cvut/spipes/modules/ModuleRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package cz.cvut.spipes.modules; | ||
|
||
import cz.cvut.spipes.modules.handlers.HandlerRegistry; | ||
import cz.cvut.spipes.modules.handlers.ModeHandler; | ||
|
||
public class ModuleRegistration { | ||
|
||
public static void register(){ | ||
HandlerRegistry.getInstance().registerHandler(Mode.class, ModeHandler.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...pes-modules/module-tabular/src/main/java/cz/cvut/spipes/modules/handlers/ModeHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package cz.cvut.spipes.modules.handlers; | ||
import cz.cvut.spipes.engine.ExecutionContext; | ||
import cz.cvut.spipes.modules.Mode; | ||
import org.apache.jena.rdf.model.RDFNode; | ||
import org.apache.jena.rdf.model.Resource; | ||
|
||
public class ModeHandler extends BaseRDFNodeHandler<Mode> { | ||
|
||
public ModeHandler(Resource resource, ExecutionContext executionContext, Setter<? super Mode> setter) { | ||
super(resource, executionContext, setter); | ||
|
||
} | ||
|
||
@Override | ||
Mode getRDFNodeValue(RDFNode node) throws Exception { | ||
return Mode.fromResource(node.asResource()); | ||
} | ||
} |