public void setRequired(Boolean value) { setAttributeValue(SPackageBasic.ATR_REQUIRED, value); }
public void setExists(Boolean value) { setAttributeValue(SPackageBasic.ATR_EXISTS, value); }
public void setExists(Boolean value) { setAttributeValue(SPackageBasic.ATR_EXISTS, value); }
public void setRequired(Boolean value) { setAttributeValue(SPackageBasic.ATR_REQUIRED, value); }
/** * Assigns a persistence key to a given SInstance. Advised caution in calling * this method as the persistence mechanism will be affected accordingly. */ static void setOnInstance(@Nonnull SInstance instance, @Nullable FormKey formKey) { Objects.requireNonNull(instance); instance.setAttributeValue(SPackageFormPersistence.ATR_FORM_KEY, formKey); }
@Override public SInstance newTransientSInstance(FormKey key, RefType refType, SDocumentFactory documentFactory) { final SInstance instance = loadSInstance(key, refType, documentFactory); instance.setAttributeValue(SPackageFormPersistence.ATR_FORM_KEY, null); return instance; }
@Override public SInstance newTransientSInstance(FormKey key, RefType refType, SDocumentFactory documentFactory, Long versionId) { final SInstance instance = loadSInstance(key, refType, documentFactory, versionId); instance.setAttributeValue(SPackageFormPersistence.ATR_FORM_KEY, null); return instance; }
public static void updateBooleanAttribute( SInstance instance, AtrRef<STypeBoolean, SIBoolean, Boolean> valueAttribute, AtrRef<STypePredicate, SIPredicate, Predicate<SInstance>> predicateAttribute) { Predicate<SInstance> pred = instance.getAttributeValue(predicateAttribute); if (pred != null) instance.setAttributeValue(valueAttribute, pred.test(instance)); }
public static void updateBooleanAttribute( SInstance instance, AtrRef<STypeBoolean, SIBoolean, Boolean> valueAttribute, AtrRef<STypePredicate, SIPredicate, Predicate<SInstance>> predicateAttribute) { Predicate<SInstance> pred = instance.getAttributeValue(predicateAttribute); if (pred != null) instance.setAttributeValue(valueAttribute, pred.test(instance)); }
private void copyFormKey(SInstance a, SInstance b) { final FormKey key = a.getAttributeValue(SPackageFormPersistence.ATR_FORM_KEY); if (key != null) { b.setAttributeValue(SPackageFormPersistence.ATR_FORM_KEY, key); } }
private static void lerAtributos(SInstance instancia, MElement xml) { NamedNodeMap atributos = xml.getAttributes(); if (atributos != null) { for (int i = 0; i < atributos.getLength(); i++) { Attr at = (Attr) atributos.item(i); if (at.getName().equals(ATRIBUTO_ID)) { instancia.setId(Integer.parseInt(at.getValue())); } else if (!at.getName().equals(ATRIBUTO_LAST_ID)) { instancia.setAttributeValue(at.getName(), at.getValue()); } } } }
private KEY insertImpl(INSTANCE instance, Integer inclusionActor) { KEY key = insertInternal(instance, inclusionActor); checkKey(key, instance, " o insert interno gerasse uma FormKey, mas retornou null"); instance.setAttributeValue(SPackageFormPersistence.ATR_FORM_KEY, key); return key; }
private SInstance internalLoadSInstance(FormKey key, RefType refType, SDocumentFactory documentFactory, FormVersionEntity formVersionEntity) { final SInstance instance = MformPersistenciaXML.fromXML(refType, formVersionEntity.getXml(), documentFactory); final IConsumer loadListener = instance.getAttributeValue(SPackageBasic.ATR_LOAD_LISTENER); loadCurrentXmlAnnotationOrEmpty(instance.getDocument(), formVersionEntity); instance.setAttributeValue(SPackageFormPersistence.ATR_FORM_KEY, key); if (loadListener != null) { loadListener.accept(instance); } return instance; }