Tabnine Logo
SInstance.getAttributeValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getAttributeValue
method
in
org.opensingular.form.SInstance

Best Java code snippets using org.opensingular.form.SInstance.getAttributeValue (Showing top 20 results out of 315)

origin: org.opensingular/form-core

public static <V> V attributeValue(SInstance instance, AtrRef<?, ?, V> attribute, V defaultValue) {
  V value = instance.getAttributeValue(attribute);
  return (value != null) ? value : defaultValue;
}
public static <V> boolean hasAttributeValue(SInstance instance, AtrRef<?, ?, V> attribute) {
origin: org.opensingular/singular-form-core

private Integer getDecimalMaximo(SInstance instance) {
  Optional<Integer> decimalMaximo = Optional.ofNullable(
      instance.getAttributeValue(SPackageBasic.ATR_FRACTIONAL_MAX_LENGTH));
  return decimalMaximo.orElse(DEFAULT_DIGITS);
}
origin: org.opensingular/form-wicket

@Override
protected Set<String> update(Set<String> oldClasses) {
  final Boolean required    = model.getObject().getAttributeValue(SPackageBasic.ATR_REQUIRED);
  final Integer minimumSize = model.getObject().getAttributeValue(SPackageBasic.ATR_MINIMUM_SIZE);
  if ((required != null && required) || (minimumSize != null && minimumSize > 0)) {
    oldClasses.add("singular-form-required");
  } else {
    oldClasses.remove("singular-form-required");
  }
  return oldClasses;
}
origin: org.opensingular/singular-form-wicket

  @Override
  protected Set<String> update(Set<String> oldClasses) {
    if (model.getObject().getAttributeValue(SPackageBasic.ATR_DEPENDS_ON_FUNCTION) != null) {
      oldClasses.add("dependant-input-group");
    }
    return oldClasses;
  }
};
origin: org.opensingular/singular-form-wicket

private Integer getDecimalMaximo(IModel<? extends SInstance> model) {
  Optional<Integer> decimalMaximo = Optional.ofNullable(
      model.getObject().getAttributeValue(SPackageBasic.ATR_FRACTIONAL_MAX_LENGTH));
  return decimalMaximo.orElse(DEFAULT_DIGITS);
}
origin: org.opensingular/form-wicket

private Integer getDecimalMaximo(IModel<? extends SInstance> model) {
  Optional<Integer> decimalMaximo = Optional.ofNullable(
      model.getObject().getAttributeValue(SPackageBasic.ATR_FRACTIONAL_MAX_LENGTH));
  return decimalMaximo.orElse(DEFAULT_DIGITS);
}
origin: org.opensingular/form-wicket

private Integer getInteiroMaximo(IModel<? extends SInstance> model) {
  Optional<Integer> inteiroMaximo = Optional.ofNullable(
      model.getObject().getAttributeValue(SPackageBasic.ATR_INTEGER_MAX_LENGTH));
  return inteiroMaximo.orElse(DEFAULT_INTEGER_DIGITS);
}
origin: org.opensingular/singular-form-wicket

private Integer getDecimalMaximo(IModel<? extends SInstance> model) {
  Optional<Integer> decimalMaximo = Optional.ofNullable(
    model.getObject().getAttributeValue(SPackageBasic.ATR_FRACTIONAL_MAX_LENGTH));
  return (Integer) decimalMaximo.orElse(DEFAULT_DIGITS);
}
origin: org.opensingular/singular-form-core

/**
 * Returns the persistence {@link FormKey} assigned to a given SInstance.
 * The key is assigned by the persistence mechanism after loading/saving an instance.
 */
@Nonnull
public static Optional<FormKey> fromInstanceOpt(@Nonnull SInstance instance) {
  Objects.requireNonNull(instance);
  return Optional.ofNullable(instance.getAttributeValue(SPackageFormPersistence.ATR_FORM_KEY));
}
origin: org.opensingular/singular-form-wicket

private String configureMaxDate(IModel<? extends SInstance> model) {
  Date date = model.getObject().getAttributeValue(ATR_MAX_DATE);
  if (date == null) {
    return DATEPICKER_DEFAULT_END_DATE;
  }
  return defaultDateFormat().format(date);
}
origin: org.opensingular/form-wicket

@Override
public T getObject() {
  if (model instanceof ISInstanceAwareModel<?>)
    return ((ISInstanceAwareModel<?>) model).getMInstancia().getAttributeValue(nomeCompletoAtributo, classeValorAtributo);
  return null;
}
origin: org.opensingular/singular-form-wicket

private String configureMinDate(IModel<? extends SInstance> model) {
  Date date = model.getObject().getAttributeValue(ATR_MIN_DATE);
  if (date == null) {
    return DATEPICKER_DEFAULT_START_DATE;
  }
  return defaultDateFormat().format(date);
}
origin: org.opensingular/form-core

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));
}
origin: org.opensingular/singular-form-wicket

@Override
public T getObject() {
  if (model instanceof ISInstanceAwareModel<?>)
    return ((ISInstanceAwareModel<?>) model).getSInstance().getAttributeValue(fullNameAttribute,
        attributeValueClass);
  return null;
}
origin: org.opensingular/singular-form-core

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));
}
origin: org.opensingular/singular-form-wicket

private Map<String, Object> withOptionsOf(IModel<? extends SInstance> model) {
  Optional<Integer> inteiroMaximo = Optional.ofNullable(
    model.getObject().getAttributeValue(SPackageBasic.ATR_INTEGER_MAX_LENGTH));
  Integer decimal = getDecimalMaximo(model);
  Map<String, Object> options = defaultOptions();
  options.put("integerDigits", inteiroMaximo.orElse(DEFAULT_INTEGER_DIGITS));
  options.put("digits", decimal);
  return options;
}
origin: org.opensingular/form-wicket

private Map<String, Object> withOptionsOf(IModel<? extends SInstance> model) {
  Optional<Integer> inteiroMaximo = Optional.ofNullable(
    model.getObject().getAttributeValue(SPackageBasic.ATR_INTEGER_MAX_LENGTH));
  Integer decimal = getDecimalMaximo(model);
  Map<String, Object> options = defaultOptions();
  options.put("integerDigits", inteiroMaximo.orElse(DEFAULT_INTEGER_DIGITS));
  options.put("digits", decimal);
  return options;
}
origin: org.opensingular/singular-form-core

@Nullable
@Override
public final <T> T getAttributeValue(@Nonnull AtrRef<?, ?, ?> atr, @Nullable Class<T> resultClass) {
  return getAttributeValue(getDictionary().getAttributeReferenceOrException(atr), resultClass);
}
origin: org.opensingular/form-core

/**
 * Lê o {@link FormKey} de uma instância e verifica se é da classe esperada. Se for diferente de null e não for da
 * classe espera, então dispara uma Exception.
 */
protected KEY readKeyAttribute(INSTANCE instance, String msgRequired) {
  if (instance == null) {
    throw addInfo(new SingularFormPersistenceException("O parâmetro instance está null"));
  }
  FormKey key = instance.getAttributeValue(SPackageFormPersistence.ATR_FORM_KEY);
  return checkKey(key, instance, msgRequired);
}
origin: org.opensingular/form-service

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;
}
org.opensingular.formSInstancegetAttributeValue

Popular methods of SInstance

  • getDocument
    Retorna o documento ao qual pertence a instância atual.
  • getType
  • toStringDisplay
  • getId
    Retorna um ID único dentre as instâncias do mesmo documento. Um ID nunca é reutilizado, mesmo se a i
  • findNearest
    Returns the nearest SInstance for the given type in the form SInstance tree. The search is performed
  • setId
    Apenas para uso nas soluções de persistencia. Não deve ser usado fora dessa situação.
  • clearInstance
    Apaga os valores associados a instância. Se for uma lista ou composto, apaga os valores em profundid
  • getName
  • getParent
  • getValue
  • isEmptyOfData
    Retorna true se a instancia não conter nenhuma informação diferente de null. A pesquisa é feita em
  • asAtr
  • isEmptyOfData,
  • asAtr,
  • asAtrAnnotation,
  • asAtrProvider,
  • attachEventCollector,
  • detachEventCollector,
  • getDictionary,
  • getField,
  • getPathFromRoot

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • runOnUiThread (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now