IdentifierBuilder { public String capitalizedIdentifier(ResourceObject resource, OntGenerationConfig config) throws RepositoryException { StringBuilder identifier = new StringBuilder(lowercaseIdentifier(resource, config)); identifier.setCharAt(0, Character.toUpperCase(identifier.charAt(0))); return identifier.toString(); } IdentifierBuilder(ObjectConnection connection); static IdentifierBuilder forObjectRepository(ObjectRepository repository); static IdentifierBuilder forObjectRepository(ObjectConnection connection); String packageName(ResourceObject object, OntGenerationConfig config); String lowercaseIdentifier(ResourceObject resource, OntGenerationConfig config); String capitalizedIdentifier(ResourceObject resource, OntGenerationConfig config); String lowercasePluralIdentifier(ResourceObject resource, OntGenerationConfig config); String capitalizedPluralIdentifier(ResourceObject resource, OntGenerationConfig config);  }
@Test public void testCapitalizedIdentifier() throws Exception { IdentifierBuilder builder = IdentifierBuilder.forObjectRepository(anno4j.getObjectRepository()); assertEquals("MboxSha1sum", builder.capitalizedIdentifier(anno4j.createObject(RDFSClazz.class, (Resource) new URIImpl(FOAF.MBOX_SHA1SUM)), config)); assertEquals("Person", builder.capitalizedIdentifier(anno4j.createObject(RDFSClazz.class, (Resource) new URIImpl(FOAF.PERSON)), config)); RDFSClazz person = anno4j.createObject(RDFSClazz.class, (Resource) new URIImpl(FOAF.PERSON)); person.setLabels(Sets.<CharSequence>newHashSet(new LangString("A living person", "de"))); assertEquals("ALivingPerson", builder.capitalizedIdentifier(person, config)); assertEquals("SomeClazz", builder.capitalizedIdentifier(anno4j.createObject(RDFSClazz.class, (Resource) new URIImpl("urn:test:some_clazz")), config)); }