Modifier and Type | Field and Description |
---|---|
protected Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> |
allSuperclasses
List of the all the ancestral superclasses to each of the direct
superclasses
|
protected String |
comment
The description of the class from the RDF comment
|
protected Set<org.openrdf.model.URI> |
directSuperclasses
A list of the direct superclasses of this class
|
protected Set<PropertyDef> |
properties
List of the properties in this class
|
protected org.openrdf.model.URI |
uri
The URI of the class
|
Constructor and Description |
---|
ClassDef() |
Modifier and Type | Method and Description |
---|---|
void |
generateClass(File targetDir,
Map<org.openrdf.model.URI,String> pkgs,
Map<org.openrdf.model.URI,ClassDef> classes,
boolean flattenClassStructure,
boolean generateAnnotations,
boolean separateImplementations)
Generates a Java file in the target directory
|
void |
generateInterface(File targetDir,
Map<org.openrdf.model.URI,String> pkgs,
Map<org.openrdf.model.URI,ClassDef> classes)
Generates a Java interface file in the target directory
|
Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> |
getAllSuperclasses(org.openrdf.repository.RepositoryConnection conn)
Traverses up the tree from this class to find all ancestor
allSuperclasses.
|
static Map<org.openrdf.model.URI,ClassDef> |
loadClasses(Generator.GeneratorOptions go,
org.openrdf.repository.RepositoryConnection conn)
Loads all the class definitions from the given repository
|
String |
toString()
Outputs the Java class definition for this class def
|
protected org.openrdf.model.URI uri
protected Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> allSuperclasses
protected Set<org.openrdf.model.URI> directSuperclasses
protected Set<PropertyDef> properties
public ClassDef()
public String toString()
toString
in class Object
Object.toString()
public static Map<org.openrdf.model.URI,ClassDef> loadClasses(Generator.GeneratorOptions go, org.openrdf.repository.RepositoryConnection conn) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException
conn
- The repository connection from where to get the classesgo
- org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
public void generateClass(File targetDir, Map<org.openrdf.model.URI,String> pkgs, Map<org.openrdf.model.URI,ClassDef> classes, boolean flattenClassStructure, boolean generateAnnotations, boolean separateImplementations) throws FileNotFoundException
targetDir
- The target directorypkgs
- A map of package mappings to class URIsclasses
- A map of class URIs to ClassDefsflattenClassStructure
- Whether to flatten the class structuregenerateAnnotations
- Whether to generate OpenIMAJ RDF annotations for the
propertiesseparateImplementations
- FileNotFoundException
public void generateInterface(File targetDir, Map<org.openrdf.model.URI,String> pkgs, Map<org.openrdf.model.URI,ClassDef> classes) throws FileNotFoundException
targetDir
- The target directorypkgs
- A list of package mappings to class URIsclasses
- The URI to class definition map.FileNotFoundException
public Map<org.openrdf.model.URI,Set<org.openrdf.model.URI>> getAllSuperclasses(org.openrdf.repository.RepositoryConnection conn)
conn
- A connection to a triple-store repository