-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from kbss-cvut/development
[2.0.3] Release
- Loading branch information
Showing
47 changed files
with
387 additions
and
246 deletions.
There are no files selected for viewing
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
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
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
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
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
31 changes: 31 additions & 0 deletions
31
jopa-impl/src/main/java/cz/cvut/kbss/jopa/oom/converter/ToURIConverter.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,31 @@ | ||
package cz.cvut.kbss.jopa.oom.converter; | ||
|
||
import cz.cvut.kbss.jopa.exception.UnsupportedTypeTransformationException; | ||
|
||
import java.net.URI; | ||
|
||
/** | ||
* Converter to {@link java.net.URI}. | ||
* <p> | ||
* Only {@code String} values are supported. | ||
*/ | ||
public class ToURIConverter implements ConverterWrapper<URI, Object> { | ||
@Override | ||
public boolean supportsAxiomValueType(Class<?> type) { | ||
return String.class.equals(type); | ||
} | ||
|
||
@Override | ||
public Object convertToAxiomValue(URI value) { | ||
return value.toString(); | ||
} | ||
|
||
@Override | ||
public URI convertToAttribute(Object value) { | ||
try { | ||
return URI.create(value.toString()); | ||
} catch (IllegalArgumentException e) { | ||
throw new UnsupportedTypeTransformationException("Unable to convert value " + value + " to URI.", e); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
jopa-impl/src/main/java/cz/cvut/kbss/jopa/oom/converter/ToURLConverter.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,33 @@ | ||
package cz.cvut.kbss.jopa.oom.converter; | ||
|
||
import cz.cvut.kbss.jopa.exception.UnsupportedTypeTransformationException; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
|
||
/** | ||
* Converter to {@link java.net.URL}. | ||
* <p> | ||
* Only {@code String} values are supported. | ||
*/ | ||
public class ToURLConverter implements ConverterWrapper<URL, Object> { | ||
|
||
@Override | ||
public boolean supportsAxiomValueType(Class<?> type) { | ||
return String.class.equals(type); | ||
} | ||
|
||
@Override | ||
public Object convertToAxiomValue(URL value) { | ||
return value.toString(); | ||
} | ||
|
||
@Override | ||
public URL convertToAttribute(Object value) { | ||
try { | ||
return new URL(value.toString()); | ||
} catch (MalformedURLException e) { | ||
throw new UnsupportedTypeTransformationException("Unable to convert value " + value + " to URL.", e); | ||
} | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.