use of org.qi4j.api.object.ObjectDescriptor in project qi4j-sdk by Qi4j.
the class ApplicationVisitor method visitEnter.
@Override
public boolean visitEnter(Object visited) throws RuntimeException {
if (visited instanceof ApplicationDescriptor) {
ApplicationDescriptor applicationDescriptor = (ApplicationDescriptor) visited;
appUri = context.createApplicationUri(applicationDescriptor.name());
context.setNameAndType(appUri, applicationDescriptor.name(), Qi4jRdf.TYPE_APPLICATION);
}
if (visited instanceof LayerDescriptor) {
LayerDescriptor layerDescriptor = (LayerDescriptor) visited;
layerUri = context.createLayerUri(appUri, layerDescriptor.name());
context.setNameAndType(layerUri, layerDescriptor.name(), Qi4jRdf.TYPE_LAYER);
context.addRelationship(appUri, Qi4jRdf.RELATIONSHIP_LAYER, layerUri);
}
if (visited instanceof ModuleDescriptor) {
ModuleDescriptor moduleDescriptor = (ModuleDescriptor) visited;
moduleUri = context.createModuleUri(layerUri, moduleDescriptor.name());
context.setNameAndType(layerUri, moduleDescriptor.name(), Qi4jRdf.TYPE_MODULE);
context.addRelationship(layerUri, Qi4jRdf.RELATIONSHIP_MODULE, moduleUri);
}
if (visited instanceof TransientDescriptor) {
TransientDescriptor transientDescriptor = (TransientDescriptor) visited;
compositeUri = context.createCompositeUri(moduleUri, first(transientDescriptor.types()));
context.addType(compositeUri, Qi4jRdf.TYPE_COMPOSITE);
context.addRelationship(moduleUri, Qi4jRdf.RELATIONSHIP_COMPOSITE, compositeUri);
}
if (visited instanceof EntityDescriptor) {
EntityDescriptor entityDescriptor = (EntityDescriptor) visited;
compositeUri = context.createCompositeUri(moduleUri, first(entityDescriptor.types()));
context.addType(compositeUri, Qi4jRdf.TYPE_ENTITY);
context.addRelationship(moduleUri, Qi4jRdf.RELATIONSHIP_ENTITY, compositeUri);
}
if (visited instanceof ObjectDescriptor) {
ObjectDescriptor objectDescriptor = (ObjectDescriptor) visited;
compositeUri = context.createCompositeUri(moduleUri, first(objectDescriptor.types()));
context.addType(compositeUri, Qi4jRdf.TYPE_OBJECT);
context.addRelationship(moduleUri, Qi4jRdf.RELATIONSHIP_OBJECT, compositeUri);
}
if (visited instanceof MethodDescriptor) {
MethodDescriptor compositeMethodDescriptor = (MethodDescriptor) visited;
String compositeMethodUri = context.createCompositeMethodUri(compositeUri, compositeMethodDescriptor.method());
context.addType(compositeMethodUri, Qi4jRdf.TYPE_METHOD);
context.addRelationship(compositeUri, Qi4jRdf.RELATIONSHIP_METHOD, compositeMethodUri);
}
return true;
}
use of org.qi4j.api.object.ObjectDescriptor in project qi4j-sdk by Qi4j.
the class PDFWriter method writeTypeGeneralPage.
private void writeTypeGeneralPage(Object objectDesciptor) {
setFont(header5Font, header5FontSize);
writeString("General: ", headerLineSpace);
setFont(normalFont, normalFontSize);
if (objectDesciptor instanceof ServiceDetailDescriptor) {
ServiceDescriptor descriptor = ((ServiceDetailDescriptor) objectDesciptor).descriptor();
writeString("- identity: " + descriptor.identity());
writeString("- class: " + descriptor.toString());
writeString("- visibility: " + descriptor.visibility().toString());
writeString("- startup: " + ((ServiceDetailDescriptor) objectDesciptor).descriptor().isInstantiateOnStartup());
} else if (objectDesciptor instanceof EntityDetailDescriptor) {
EntityDescriptor descriptor = ((EntityDetailDescriptor) objectDesciptor).descriptor();
writeString("- name: " + descriptor.toString());
writeString("- class: " + descriptor.toString());
writeString("- visibility: " + descriptor.visibility().toString());
} else if (objectDesciptor instanceof ValueDetailDescriptor) {
ValueDescriptor descriptor = ((ValueDetailDescriptor) objectDesciptor).descriptor();
writeString("- name: " + descriptor.toString());
writeString("- class: " + descriptor.toString());
writeString("- visibility: " + descriptor.visibility().toString());
} else if (objectDesciptor instanceof ObjectDetailDescriptor) {
ObjectDescriptor descriptor = ((ObjectDetailDescriptor) objectDesciptor).descriptor();
writeString("- name: " + descriptor.toString());
writeString("- class: " + descriptor.toString());
writeString("- visibility: " + descriptor.visibility().toString());
} else if (objectDesciptor instanceof CompositeDetailDescriptor) {
CompositeDescriptor descriptor = ((CompositeDetailDescriptor) objectDesciptor).descriptor();
writeString("- name: " + descriptor.toString());
writeString("- class: " + descriptor.toString());
writeString("- visibility: " + descriptor.visibility().toString());
}
}
Aggregations