Skip to content

Commit

Permalink
fixed method getObjectTypeListByClassType in schemaRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
domko17 committed Dec 18, 2023
1 parent d4f0020 commit a5ff1f6
Showing 1 changed file with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1793,25 +1793,10 @@ public void registerStaticNamespace(String ns, String prefix, boolean declaredBy
public List<String> getObjectTypeListByClassType(@NotNull Class<?> typeClass) {
List<String> objectTypes = new ArrayList<>();

var typeDefinition = findTypeDefinitionByCompileTimeClass(typeClass, TypeDefinition.class);
System.out.println(typeClass + " TESTING... " + typeDefinition.getStaticSubTypes());

// for (SchemaDescription schemaDescription : this.getSchemaDescriptions()) {
// if (schemaDescription.getSchema().getNamespace().equals(defaultNamespace)) {
//
// PrismSchemaImpl schema = (PrismSchemaImpl) schemaDescription.getSchema();
//
// if (typeClass.getSuperclass() == schemaDescription.getSchema().findObjectDefinitionByType(new QName(PrismConstants.T_OBJECT_TYPE.getLocalPart())).getCompileTimeClass()) {
// typeClass = schemaDescription.getSchema().findObjectDefinitionByType(new QName(PrismConstants.T_OBJECT_TYPE.getLocalPart())).getCompileTimeClass();
// }
//
// for (ComplexTypeDefinition definition : schemaDescription.getSchema().getComplexTypeDefinitions()) {
// if(definition.getCompileTimeClass() != null && typeClass == definition.getCompileTimeClass().getSuperclass()) {
// objectTypes.add(definition.getTypeName().getLocalPart());
// }
// }
// }
// }
for (TypeDefinition typeDefinition : findTypeDefinitionByCompileTimeClass(typeClass, TypeDefinition.class).getStaticSubTypes()) {
objectTypes.add(typeDefinition.getDisplayName());
getObjectTypeListByClassType(typeDefinition.getClass());
}

return objectTypes;
}
Expand Down

0 comments on commit a5ff1f6

Please sign in to comment.