private void debugAttributes(Appendable appendable) { try { Collection<SInstance> attrs = getAttributes(); if (!attrs.isEmpty()) { appendable.append(" {"); attrs.forEach(attr -> debugAttribute(appendable, attr)); appendable.append("}"); } } catch (IOException ex) { LOGGER.log(Level.SEVERE, ex.getMessage(), ex); } }
private void debugAttributes(Appendable appendable) { try { Collection<SInstance> attrs = getAttributes(); if (! attrs.isEmpty()) { appendable.append(" {"); attrs.stream().forEach(attr -> { try { appendable.append(suppressPackage(attr.getAttributeInstanceInfo().getName(), true)).append("=") .append(attr.toStringDisplay()).append("; "); } catch (IOException ex) { LOGGER.log(Level.SEVERE, ex.getMessage(), ex); } }); appendable.append("}"); } } catch (IOException ex) { LOGGER.log(Level.SEVERE, ex.getMessage(), ex); } }
private static void writeType(ContextArchive ctx, SIPersistenceType pType, SType<?> type) { SType<?> superType = type.getSuperType(); pType.setSuperType(ctx.translateImport(superType)); ensureType(ctx, superType); for (SInstance attrInstance : type.getAttributes()) { SIPersistenceAttribute pAttribute = pType.newAttribute(); writeAttr(ctx, pAttribute, attrInstance); } if (type.isComposite()) { //TODO (por Daniel Bordin) O código abaixo ainda precisa resolver a questão de field que foram extendido // e tiveram apenas uma atributo alterado for (SType<?> localField : ((STypeComposite<?>) type).getFieldsLocal()) { SIPersistenceType pMember = pType.addMember(localField.getNameSimple()); writeType(ctx, pMember, localField); } } }