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

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

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

origin: org.opensingular/form-wicket

@Override
public String getReadOnlyFormattedText(WicketBuildContext ctx, IModel<? extends SInstance> model) {
  final SimpleDateFormat format = new SimpleDateFormat(STypeTime.FORMAT);
  if (model.getObject().getValue() instanceof Date) {
    return format.format(model.getObject().getValue());
  }
  return StringUtils.EMPTY;
}
origin: org.opensingular/form-wicket

  @Override
  public String getReadOnlyFormattedText(WicketBuildContext ctx, IModel<? extends SInstance> model) {
    final SimpleDateFormat format = new SimpleDateFormat(STypeDateTime.FORMAT);
    if (model.getObject().getValue() instanceof Date) {
      return format.format(model.getObject().getValue());
    }
    return StringUtils.EMPTY;
  }
}
origin: org.opensingular/singular-form-core

public Object toRelationalColumn(SInstance fromInstance) {
  Object value = fromInstance.getValue();
  if (value == null) {
    return null;
  }
  return Integer.valueOf(value.toString());
}
origin: org.opensingular/singular-form-service

private boolean setStringValue(SInstance instance) {
  String value = instance.getValue().toString();
  if (value.length() >= 2048) {
    value = instance.getValue().toString().substring(0, 2047);
  }
  stringValue = value;
  return true;
}
origin: org.opensingular/singular-form-wicket

@Override
public String getReadOnlyFormattedText(WicketBuildContext ctx, IModel<? extends SInstance> model) {
  final SInstance mi = model.getObject();
  if ((mi != null) && (mi.getValue() != null)) {
    final BigDecimal value = (BigDecimal) mi.getValue();
    return formatDecimal(value, true);
  }
  return StringUtils.EMPTY;
}
origin: org.opensingular/singular-form-wicket

@Override
public String getReadOnlyFormattedText(WicketBuildContext ctx, IModel<? extends SInstance> model) {
  if ((model != null) && (model.getObject() != null)) {
    SInstance instance = model.getObject();
    if (instance.getValue() instanceof Date) {
      Date dt = (Date) instance.getValue();
      final SimpleDateFormat formatter = defaultDateFormat();
      return formatter.format(dt);
    }
  }
  return StringUtils.EMPTY;
}
origin: org.opensingular/form-wicket

public String getReadOnlyFormattedText(WicketBuildContext ctx, IModel<? extends SInstance> model) {
  if ((model != null) && (model.getObject() != null)) {
    SInstance instancia = model.getObject();
    if (instancia.getValue() instanceof Date) {
      Date                   dt         = (Date) instancia.getValue();
      final SimpleDateFormat formattter = defaultDateFormat();
      return formattter.format(dt);
    }
  }
  return StringUtils.EMPTY;
}
origin: org.opensingular/form-wicket

  @Override
  public String getReadOnlyFormattedText(WicketBuildContext ctx, IModel<? extends SInstance> model) {
    if ((model != null) && (model.getObject() != null)) {
      SInstance instancia = model.getObject();
      if (instancia.getValue() instanceof YearMonth) {
        YearMonth ym = (YearMonth) instancia.getValue();
        return String.format("%02d/%04d", ym.getMonthValue(), ym.getYear());
      }
    }
    return StringUtils.EMPTY;
  }
}
origin: org.opensingular/singular-form-core

public Object toRelationalColumn(SInstance fromInstance) {
  Object value = fromInstance.getValue();
  if (value == null) {
    return null;
  }
  return ((SIAttachment) fromInstance).getAttachmentRef();
}
origin: org.opensingular/form-core

@SuppressWarnings("unchecked")
public default <V> List<V> listDescendantValues(SType<?> descendantType, Class<V> valueType) {
  return SInstances.listDescendants((SInstance) this, descendantType, node -> (V) node.getValue());
}
public default Stream<SInstance> streamDescendants(boolean includeRoot) {
origin: org.opensingular/singular-form-wicket

@Override
@SuppressWarnings("unchecked")
public T getObject() {
  return (T) getTarget().getValue();
}
origin: org.opensingular/form-wicket

@Override
@SuppressWarnings("unchecked")
public T getObject() {
  return (T) getTarget().getValue();
}
origin: org.opensingular/singular-form-core

/**
 * Cria uma nova assertiva para o valor da instância, se a instância contiver um valor Date. Senão o valor for
 * diferente de null e não for Date, então dispara exception.
 */
public AbstractDateAssert<?> assertDateValue() {
  Object value = getTarget().getValue();
  if (value instanceof Date || value == null) {
    return assertThat((Date) value);
  }
  throw new AssertionError(errorMsg("O Objeto da instancia atual não é do tipo Date"));
}
origin: org.opensingular/singular-form-core

public AbstractCharSequenceAssert<?, String> assertStringValue() {
  Object value = getTarget().getValue();
  if (value instanceof String || value == null) {
    return assertThat((String) value);
  }
  throw new AssertionError(errorMsg("O Objeto da instancia atual não é do tipo String"));
}
origin: org.opensingular/singular-form-core

  @Override
  public void validate(InstanceValidatable<SIComposite> v) {
    Set<Boolean> nullValues = v.getInstance().streamDescendants(false)
      .filter(it -> it.getType() instanceof STypeSimple<?, ?>)
      .map(it -> it.getValue() == null)
      .collect(toSet());
    
    // os campos devem ser todos nulos ou todos preenchidos
    if (nullValues.size() != 1)
      v.error("Endereço incompleto");
  }
}
origin: org.opensingular/form-core

/**
 * Devolve o valor que deve ser repassadado para engine de javascript. As vezes, o valor não é o próprio wrapper.
 */
public Object getValueForEngine() {
  if (isSimpleType()) {
    return getInstance().getValue();
  }
  return this;
}
origin: org.opensingular/singular-form-wicket

  @Override
  public Serializable getObject() {
    SViewListByForm view = (SViewListByForm) ctx.getView();
    if (view.getHeaderPath() != null) {
      return Optional.ofNullable(item.getModelObject().getValue(view.getHeaderPath())).orElse("").toString();
    } else {
      return item.getModelObject().toStringDisplay();
    }
  }
};
origin: org.opensingular/singular-form-core

  @Override
  public void onAction(SInstanceAction action, ISupplier<SInstance> actionInstanceSupplier, Delegate delegate) {
    final SInstance formInstance = formDelegate.getFormInstance();
    final SInstance fieldInstance = delegate.getInstanceRef().get();
    final SIAnnotation annotationInstance = fieldInstance.asAtrAnnotation().annotation();
    annotationInstance.setApproved(formInstance.getValue(EditAnotacaoRefType.APPROVED));
    annotationInstance.setText(formInstance.getValue(EditAnotacaoRefType.JUSTIFICATION));
    delegate.refreshFieldForInstance(fieldInstance);
    formDelegate.close();
  }
}
origin: org.opensingular/singular-form-core

private Object getValue(String fieldPath) {
  if (fieldPath == null) {
    return getTarget().getValue();
  } else if (getTarget() instanceof ICompositeInstance) {
    return ((ICompositeInstance) getTarget()).getValue(fieldPath);
  }
  throw new AssertionError(errorMsg("O tipo da instância não aceita leitura de path '" + fieldPath + "'"));
}
origin: org.opensingular/singular-form-core

  private static void writeAttr(ContextArchive ctx, SIPersistenceAttribute attributeArchive, SInstance attribute) {
    attributeArchive.setAttrType(attribute.getType().getName());
    attributeArchive.setAttrValue(attribute.getValue());
  }
//
org.opensingular.formSInstancegetValue

Javadoc

Resolves a field instance and returns its value, or null if empty.

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
  • getAttributeValue
  • 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
  • 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

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for WebStorm
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