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

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

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

origin: org.opensingular/form-core

@Override
public List<SInstance> getChildren() {
  return getFields();
}
origin: org.opensingular/form-core

@Override
public Object getValue() {
  return getFields();
}
origin: org.opensingular/singular-form-core

@Override
public Object getValue() {
  return getFields();
}
origin: org.opensingular/singular-form-core

@Override
public List<SInstance> getChildren() {
  return getFields();
}
origin: org.opensingular/singular-form-core

@Override
public void clearInstance() {
  getFields().forEach(SInstance::clearInstance);
}
origin: org.opensingular/form-core

@Override
public void clearInstance() {
  getFields().forEach(SInstance::clearInstance);
}
origin: org.opensingular/singular-form-core

/**
 * Retorna todos os campos do tipo, instanciando os que ainda não foram.
 *
 * @return instancias dos campos
 */
@Nonnull
public List<SInstance> getAllFields() {
  for (SType<?> field : getType().getFields())
    getField(field.getNameSimple());
  return getFields();
}
origin: org.opensingular/singular-form-core

@Override
public List<RelationalSQLCommmand> toSQLScript() {
  List<RelationalSQLCommmand> lines = new ArrayList<>();
  for (SType<?> tableContext : targetTables) {
    String tableName = table(tableContext);
    List<Object> params = new ArrayList<>();
    Map<String, Object> containerKeyColumns = new HashMap<>();
    List<RelationalColumn> inserted = insertedColumns(tableName, containerKeyColumns);
    SIComposite tableInstance = instance;
    if (tableContext != tableContext(instance.getType())) {
      Optional<SInstance> found = instance.getFields().stream()
          .filter(field -> tableContext == tableContext(field.getType())).findFirst();
      if (found.isPresent()) {
        tableInstance = (SIComposite) found.get();
      }
    }
    lines.add(new RelationalSQLCommmand(
        "insert into " + tableName + " (" + concatenateColumnNames(inserted, ", ") + ") values ("
            + concatenateColumnValues(inserted, ", ", containerKeyColumns, params) + ")",
        params, tableInstance, inserted));
  }
  return lines;
}
origin: org.opensingular/form-core

/**
 * Retorna todos os campos do tipo, instanciando os que ainda não foram.
 *
 * @return instancias dos campos
 */
public List<SInstance> getAllFields() {
  for (SType<?> field : getType().getFields())
    getField(field.getNameSimple());
  return getFields();
}
origin: org.opensingular/server-commons

private void copyIdValues(SInstance source, SInstance target) {
  target.setId(source.getId());
  if (source instanceof SIComposite) {
    SIComposite sourceComposite = (SIComposite) source;
    SIComposite targetComposite = (SIComposite) target;
    if (sourceComposite.getFields() != null) {
      for (int i = 0; i < sourceComposite.getFields().size() ; i++) {
        copyIdValues(sourceComposite.getField(i), targetComposite.getField(i));
      }
    }
  } else if (source instanceof SIList) {
    SIList sourceList = (SIList) source;
    SIList targetList = (SIList) target;
    if (sourceList.getChildren() != null) {
      for (int i = 0; i < sourceList.getChildren().size() ; i++) {
        SInstance sourceItem = (SInstance) sourceList.getChildren().get(i);
        SInstance targetItem = (SInstance) targetList.getChildren().get(i);
        copyIdValues(sourceItem, targetItem);
      }
    }
  }
}
origin: org.opensingular/singular-server-commons

private static void copyIdValues(SInstance source, SInstance target) {
  target.setId(source.getId());
  if (source instanceof SIComposite) {
    SIComposite sourceComposite = (SIComposite) source;
    SIComposite targetComposite = (SIComposite) target;
    for (int i = 0; i < sourceComposite.getFields().size() ; i++) {
      copyIdValues(sourceComposite.getField(i), targetComposite.getField(i));
    }
  } else if (source instanceof SIList) {
    SIList sourceList = (SIList) source;
    SIList targetList = (SIList) target;
    if (sourceList.getChildren() != null) {
      for (int i = 0; i < sourceList.getChildren().size() ; i++) {
        SInstance sourceItem = (SInstance) sourceList.getChildren().get(i);
        SInstance targetItem = (SInstance) targetList.getChildren().get(i);
        copyIdValues(sourceItem, targetItem);
      }
    }
  }
}
origin: org.opensingular/singular-requirement-module

private static void copyIdValues(SInstance source, SInstance target) {
  target.setId(source.getId());
  if (source instanceof SIComposite) {
    SIComposite sourceComposite = (SIComposite) source;
    SIComposite targetComposite = (SIComposite) target;
    for (int i = 0; i < sourceComposite.getFields().size() ; i++) {
      copyIdValues(sourceComposite.getField(i), targetComposite.getField(i));
    }
  } else if (source instanceof SIList) {
    SIList sourceList = (SIList) source;
    SIList targetList = (SIList) target;
    if (sourceList.getChildren() != null) {
      for (int i = 0; i < sourceList.getChildren().size() ; i++) {
        SInstance sourceItem = (SInstance) sourceList.getChildren().get(i);
        SInstance targetItem = (SInstance) targetList.getChildren().get(i);
        copyIdValues(sourceItem, targetItem);
      }
    }
  }
}
origin: org.opensingular/singular-requirement-commons

private static void copyIdValues(SInstance source, SInstance target) {
  target.setId(source.getId());
  if (source instanceof SIComposite) {
    SIComposite sourceComposite = (SIComposite) source;
    SIComposite targetComposite = (SIComposite) target;
    for (int i = 0; i < sourceComposite.getFields().size() ; i++) {
      copyIdValues(sourceComposite.getField(i), targetComposite.getField(i));
    }
  } else if (source instanceof SIList) {
    SIList sourceList = (SIList) source;
    SIList targetList = (SIList) target;
    if (sourceList.getChildren() != null) {
      for (int i = 0; i < sourceList.getChildren().size() ; i++) {
        SInstance sourceItem = (SInstance) sourceList.getChildren().get(i);
        SInstance targetItem = (SInstance) targetList.getChildren().get(i);
        copyIdValues(sourceItem, targetItem);
      }
    }
  }
}
origin: org.opensingular/form-core

/** Gera o xml para instance e para seus dados interno. */
private static MElement toXML(ConfXMLGeneration conf, SInstance instance) {
  MElement newElement = null;
  if (instance instanceof SISimple<?>) {
    SISimple<?> iSimples = (SISimple<?>) instance;
    String sPersistence = iSimples.toStringPersistence();
    if (sPersistence != null) {
      newElement = conf.createMElementComValor(instance, sPersistence);
    } else if (conf.isPersistirNull()) {
      newElement = conf.createMElement(instance);
    }
  } else if (instance instanceof SIComposite) {
    newElement = toXMLChildren(conf, instance, newElement, ((SIComposite) instance).getFields());
  } else if (instance instanceof SIList) {
    newElement = toXMLChildren(conf, instance, newElement, ((SIList<?>) instance).getValues());
  } else {
    throw new SingularFormException("Instancia da classe " + instance.getClass().getName() + " não suportada",
        instance);
  }
  //Verifica se há alguma informação lida anteriormente que deva ser grava novamente
  newElement = toXMLOldElementWithoutType(conf, instance, newElement);
  return newElement;
}
origin: org.opensingular/singular-form-service

/**
 * Cria um mapa onde a chave é o nome do campo e o valor é a informação contida no campo.
 * Se a instancia for do tipo attachment ela é ignorada automaticamente.
 * Listas de valores são processadas de forma recursiva e devem informar o código de agrupamento dos valores
 * @param mapFields
 * @param instance
 * @param formVersion
 */
private void loadMapFromInstance(Map<FormCacheFieldEntity, FormCacheValueEntity> mapFields, SInstance instance, FormVersionEntity formVersion, FormCacheValueEntity parent) {
  List<SInstance> fieldsInInstance = ((SIComposite) instance).getFields();
  for (SInstance field : fieldsInInstance) {
    if (! field.asAtrIndex().isIndexed() || field instanceof SIAttachment){
      continue;
    }
    if (field instanceof SIList && !(field.getType() instanceof STypeAttachmentList)) {
      LoadMapWithItensFromList(mapFields, (SIList) field, formVersion, parent);
    }
    if (field instanceof SIComposite) {
      SIComposite compositeField = (SIComposite) field;
      FormCacheValueEntity parentFormValue = addItemToMap(mapFields, field, formVersion, parent);
      loadMapFromInstance(mapFields, compositeField, formVersion, parentFormValue);
    }
    if (!(field instanceof SIComposite) && !(field instanceof SIList) && field.getValue() != null) {
      addItemToMap(mapFields, field, formVersion, parent);
    }
  }
}
origin: org.opensingular/singular-form-core

@Override
public T toObject(SInstance ins) {
  if (!(ins instanceof SIComposite)) {
    throw new SingularFormException("AutoSICompositeConverter somente funciona com instancias compostas.", ins);
  }
  if (ins.isEmptyOfData()) {
    return null;
  }
  final SIComposite   cins          = (SIComposite) ins;
  final T             newInstance   = new Mirror().on(resultClass).invoke().constructor().withoutArgs();
  final SetterHandler setterHandler = new Mirror().on(newInstance).set();
  cins.getFields().forEach(f -> {
    final FieldSetter setter = setterHandler.field(f.getName());
    if (setter != null) {
      setter.withValue(f.getValue());
    }
  });
  return newInstance;
}
origin: org.opensingular/form-core

@Override
public T toObject(SInstance ins) {
  if (!(ins instanceof SIComposite)) {
    throw new SingularFormException("AutoSICompositeConverter somente funciona com instancias compostas.");
  }
  if (ins.isEmptyOfData()) {
    return null;
  }
  final SIComposite   cins          = (SIComposite) ins;
  final T             newInstance   = new Mirror().on(resultClass).invoke().constructor().withoutArgs();
  final SetterHandler setterHandler = new Mirror().on(newInstance).set();
  cins.getFields().forEach(f -> {
    final FieldSetter setter = setterHandler.field(f.getName());
    if (setter != null) {
      setter.withValue(f.getValue());
    }
  });
  return newInstance;
}
org.opensingular.formSICompositegetFields

Javadoc

List only those fields already instantiated. OBS: field instantiation occurs automatically when its value is set for the first time.

Popular methods of SIComposite

  • getField
  • getType
  • findNearest
  • getDocument
  • setValue
  • asAtr
  • findDescendant
  • getFieldList
  • asAtrAnnotation
  • asAtrBootstrap
  • clearInstance
  • createField
  • clearInstance,
  • createField,
  • findFieldIndex,
  • findFieldIndexOpt,
  • getAllChildren,
  • getAllFields,
  • getDictionary,
  • getFieldLocalWithoutCreating,
  • getFieldOpt

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Path (java.nio.file)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • JComboBox (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
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