default void setAttributeValue(SType<?> defAttribute, Object value) { defAttribute.checkIfIsAttribute(); setAttributeValue(defAttribute.getName(), null, value); }
default void setAttributeValue(SType<?> defAttribute, Object value) { defAttribute.checkIfIsAttribute(); setAttributeValue(defAttribute.getName(), null, value); }
private SType<?> getAttributeOptional(AtrRef<?, ?, ?> atr) { getDictionary().loadPackage(atr.getPackageClass()); if (atr.isNotBindDone()) { return null; } SType<?> type = getDictionary().getTypeOptional(atr.getNameFull()); if (type != null) { type.checkIfIsAttribute(); } return type; }
final void addAttribute(SType<?> attributeDef) { attributeDef.checkIfIsAttribute(); SType<?> owner = attributeDef.getAttributeDefinitionInfo().getOwner(); if (owner != null && owner != this) { throw new SingularFormException( "O Atributo '" + attributeDef.getName() + "' pertence excelusivamente ao tipo '" + owner.getName() + "'. Assim não pode ser reassociado a classe '" + getName(), this); } attributesDefined.add(attributeDef); }
/** Adiciona uma nova definição de atributo ao tipo. */ void add(@Nonnull SType<?> targetOwner, @Nonnull SType<?> attributeDef) { AttrInternalRef ref = attributeDef.checkIfIsAttribute(); SType<?> currentOwner = ref.getOwner(); if (currentOwner != null && currentOwner != targetOwner) { throw new SingularFormException( "O Atributo '" + attributeDef.getName() + "' pertence excelusivamente ao tipo '" + currentOwner.getName() + "'. Assim não pode ser reassociado a classe '" + targetOwner.getName(), targetOwner); } if (get(ref) != null) { throw new SingularFormException( "Já existe um atributo '" + ref.getName() + "' definido em " + targetOwner.getName()); } attributes = ArrUtil.arraySet(attributes, ref.getIndex(), attributeDef, SType.class, ref.getMax()); }
final SInstance newAttributeInstanceFor(SType<?> typeToBeAppliedAttribute) { checkIfIsAttribute(); SInstance attrInstance; if (attrInternalRef.isSelfReference()) { attrInstance = typeToBeAppliedAttribute.newInstance(getDictionary().getInternalDicionaryDocument()); } else { attrInstance = newInstance(getDictionary().getInternalDicionaryDocument()); } attrInstance.setAsAttribute(attrInternalRef, typeToBeAppliedAttribute); return attrInstance; }
final SInstance newAttributeInstanceFor(SType<?> typeToBeAppliedAttribute) { checkIfIsAttribute(); SInstance attrInstance; if (attributeDefinitionInfo.isSelfReference()) { attrInstance = typeToBeAppliedAttribute.newInstance(getDictionary().getInternalDicionaryDocument()); } else { attrInstance = newInstance(getDictionary().getInternalDicionaryDocument()); } attrInstance.setAsAttribute(getName(), this); return attrInstance; }