public class Generator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Generator.GeneratorOptions
Options for the generation of the Java classes.
|
Constructor and Description |
---|
Generator() |
Modifier and Type | Method and Description |
---|---|
protected static void |
debugAllTriples(org.openrdf.model.URI uri,
org.openrdf.repository.RepositoryConnection conn)
Useful little debug method that will print out all the triples for a
given URI from the given repository.
|
static void |
generate(InputStream is,
Generator.GeneratorOptions go)
Generate the classes for the RDF information that's read from the given
input stream.
|
protected static Map<org.openrdf.model.URI,String> |
generatePackageMappings(Collection<ClassDef> classes)
Creates a cache of mappings that map URIs to package names.
|
protected static String |
getPackageName(org.openrdf.model.URI uri)
From the given URI will attempt to create a java package name by
reversing all the elements and separating with dots.
|
protected static String |
getPackageName(org.openrdf.model.URI uri,
boolean removeWWW)
From the given URI will attempt to create a java package name by
reversing all the elements and separating with dots.
|
protected static String |
getTypeName(org.openrdf.model.URI s)
Returns the Java type name for a given URI
|
static void |
main(String[] args) |
static String |
replaceCodes(String groupId,
String artifactId,
String versionNumber,
String s)
Replaces GAV codes in the given string.
|
public Generator()
protected static void debugAllTriples(org.openrdf.model.URI uri, org.openrdf.repository.RepositoryConnection conn)
uri
- The URIconn
- The connectionprotected static Map<org.openrdf.model.URI,String> generatePackageMappings(Collection<ClassDef> classes)
classes
- The list of classes to generate the package names forprotected static String getPackageName(org.openrdf.model.URI uri)
uri
- The URI to get a package name for.protected static String getPackageName(org.openrdf.model.URI uri, boolean removeWWW)
uri
- The URI to get a package name for.removeWWW
- Whether to remove www. parts of URIspublic static String replaceCodes(String groupId, String artifactId, String versionNumber, String s)
groupId
- The group identifierartifactId
- The artifact identifierversionNumber
- The version numbers
- The string to replace them inprotected static String getTypeName(org.openrdf.model.URI s)
s
- The URIpublic static void generate(InputStream is, Generator.GeneratorOptions go) throws org.openrdf.repository.RepositoryException, org.openrdf.rio.RDFParseException, IOException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException
is
- The input stream to find the RDF descriptiongo
- The options for the generatororg.openrdf.repository.RepositoryException
- If the repository cannot be createdIOException
- If the InputStream cannot be readorg.openrdf.rio.RDFParseException
- If the RDF is malformedorg.openrdf.query.QueryEvaluationException
- If the query for classes failsorg.openrdf.query.MalformedQueryException
- If the query for classes fails