Tabnine Logo
SIComposite.getFieldOpt
Code IndexAdd Tabnine to your IDE (free)

How to use
getFieldOpt
method
in
org.opensingular.form.SIComposite

Best Java code snippets using org.opensingular.form.SIComposite.getFieldOpt (Showing top 8 results out of 315)

origin: org.opensingular/form-core

@Override
public Optional<SInstance> getFieldOpt(String path) {
  return getFieldOpt(new PathReader(path));
}
origin: org.opensingular/form-core

private TemplateModel getTemplateFromField(String key) {
  return getInstance().getFieldOpt(key).map(instance -> toTemplateModel(instance)).orElse(null);
}
origin: org.opensingular/form-core

public static <T extends Serializable> Optional<T> ofOpt(SInstance instanciaComposta, String...path) {
  if (instanciaComposta instanceof SIComposite) {
    Optional<SInstance> campoOpt = ((SIComposite) instanciaComposta).getFieldOpt(Arrays.stream(path).collect(Collectors.joining(".")));
    if (campoOpt.isPresent()) {
      SInstance campo = campoOpt.get();
      if (campo instanceof SISimple) {
        return Optional.ofNullable(Value.of((SISimple<T>) campo));
      } else if (campo instanceof SIList) {
        return Optional.ofNullable((T) ofList((SIList) campo));
      }
    }
  }
  return Optional.empty();
}
origin: org.opensingular/singular-form-core

private TemplateModel getTemplateFromField(String key) {
  return getInstance().getFieldOpt(key).map(instance -> formObjectWrapper.newTemplateModel(instance, escapeContentHtml)).orElse(null);
}
origin: org.opensingular/singular-form-core

private static void fromXMLSIComposite(@Nonnull SIComposite instc, @Nullable MElement xml) {
  if (xml == null) {
    return;
  }
  for (MElement xmlChild = xml.getPrimeiroFilho(); xmlChild != null; xmlChild = xmlChild.getProximoIrmao()) {
    Optional<SInstance> instcField = instc.getFieldOpt(xmlChild.getTagName());
    if (instcField.isPresent()) {
      fromXML(instcField.get(), xmlChild);
    } else {
      InternalAccess.INTERNAL.addUnreadInfo(instc, xmlChild);
    }
  }
}
origin: org.opensingular/singular-form-core

/**
 * Calcula o Diff para uma instância do tipo {@link STypeComposite}. Faz chamada de diff recursiva para os
 * cada campo da lista.
 */
private static void calculateDiffComposite(DiffInfo info, SIComposite original, SIComposite newer) {
  Set<String> names = new HashSet<>();
  if (newer != null) {
    for (SType<?> newerTypeField : newer.getType().getFields()) {
      SInstance newerField = newer.getField(newerTypeField);
      SInstance originalField = null;
      if (original != null) {
        originalField = original.getFieldOpt(newerTypeField.getNameSimple()).orElse(null);
      }
      calculateDiff(info, originalField, newerField);
      names.add(newerTypeField.getNameSimple());
    }
  }
  if (original != null) {
    //noinspection Convert2streamapi
    for (SType<?> originalTypeField : original.getType().getFields()) {
      if (!names.contains(originalTypeField.getNameSimple())) {
        calculateDiff(info, original.getField(originalTypeField), null);
      }
    }
  }
}
origin: org.opensingular/form-core

/**
 * Calcula o Diff para uma instância do tipo {@link STypeComposite}. Faz chamada de diff recursiva para os
 * cada campo da lista.
 */
private static void calculateDiffComposite(DiffInfo info, SIComposite original, SIComposite newer) {
  Set<String> names = new HashSet<>();
  if (newer != null) {
    for (SType<?> newerTypeField : newer.getType().getFields()) {
      SInstance newerField = newer.getField(newerTypeField);
      SInstance originalField = null;
      if (original != null) {
        originalField = original.getFieldOpt(newerTypeField.getNameSimple()).orElse(null);
      }
      calculateDiff(info, originalField, newerField);
      names.add(newerTypeField.getNameSimple());
    }
  }
  if (original != null) {
    //noinspection Convert2streamapi
    for (SType<?> originalTypeField : original.getType().getFields()) {
      if (!names.contains(originalTypeField.getNameSimple())) {
        calculateDiff(info, original.getField(originalTypeField), null);
      }
    }
  }
}
origin: org.opensingular/form-core

SIComposite instc = (SIComposite) instance;
for(MElement xmlChild = xml.getPrimeiroFilho(); xmlChild != null; xmlChild = xmlChild.getProximoIrmao()) {
  Optional<SInstance> instcField = instc.getFieldOpt(xmlChild.getTagName());
  if (instcField.isPresent()) {
    fromXML(instcField.get(), xmlChild);
org.opensingular.formSICompositegetFieldOpt

Popular methods of SIComposite

  • getField
  • getFields
    List only those fields already instantiated. OBS: field instantiation occurs automatically when its
  • getType
  • findNearest
  • getDocument
  • setValue
  • asAtr
  • findDescendant
  • getFieldList
  • asAtrAnnotation
  • asAtrBootstrap
  • clearInstance
  • asAtrBootstrap,
  • clearInstance,
  • createField,
  • findFieldIndex,
  • findFieldIndexOpt,
  • getAllChildren,
  • getAllFields,
  • getDictionary,
  • getFieldLocalWithoutCreating

Popular in Java

  • Making http post requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Permission (java.security)
    Legacy security code; do not use.
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Reference (javax.naming)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • 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