private void registerAnnotatedSlots() { for (DomainClass domClass : classes.values()) { for (Slot slot : domClass.getSlotsList()) { for (Annotation ann : slot.getAnnotations()) { List<AnnotatedSlot> annotatedSlotsList = this.annotatedSlots.get(ann.getName()); if (annotatedSlotsList == null) { annotatedSlotsList = new ArrayList<AnnotatedSlot>(); this.annotatedSlots.put(ann.getName(), annotatedSlotsList); } annotatedSlotsList.add(new AnnotatedSlot(domClass, slot)); } } } }
protected void checkForRepeatedSlots() { for (DomainClass domClass : classes.values()) { DomainEntity superDomClass = domClass.getSuperclass(); if (superDomClass != null) { for (Slot slot : domClass.getSlotsList()) { if (superDomClass.findSlot(slot.getName()) != null) { System.err.printf( "WARNING: Slot named '%s' in class '%s' already exists in a superclass\n", slot.getName(), domClass.getName()); } if (superDomClass.findRoleSlot(slot.getName()) != null) { System.err.printf( "WARNING: Slot named '%s' in class '%s' already exists in a superclass as role slot\n", slot.getName(), domClass.getName()); } } for (Role role : domClass.getRoleSlotsList()) { if (superDomClass.findSlot(role.getName()) != null) { System.err.printf( "WARNING: Role slot named '%s' in class '%s' already exists in a superclass as a slot\n", role.getName(), domClass.getName()); } if (superDomClass.findRoleSlot(role.getName()) != null) { System.err.printf( "WARNING: Role slot named '%s' in class '%s' already exists in a superclass as role slot\n", role.getName(), domClass.getName()); } } } } }
public void addClass(DomainClass domClass) { checkNotFinalized(); checkNameUnique(domClass.getFullName()); classes.put(domClass.getFullName(), domClass); }