congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SInstance.getId
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.opensingular/singular-form-core

/**
 * Encontra a posição de um elemento dentro da lista com o ID informado. Retorna -1 senão encontrar.
 */
private static int findById(Integer instanceId, List<? extends SInstance> list) {
  for (int i = 0; i < list.size(); i++) {
    if (instanceId.equals(list.get(i).getId())) {
      return i;
    }
  }
  return -1;
}
origin: org.opensingular/form-core

private IValidationError errorInternal(ValidationErrorLevel level, String msg) {
  ValidationError error = new ValidationError(instance.getId(), level, msg);
  onError.accept(error);
  errorFound = true;
  return error;
}
origin: org.opensingular/singular-form-core

/** Localiza a anotação com o classificado solicitado na instancia informatada. Ou retorna null. */
private SIAnnotation getAnnotation(SInstance instance, String classifier) {
  if (annotationsMap != null) {
    for (SIAnnotation a : annotationsMap.get(instance.getId())) {
      if (classifier.equals(a.getClassifier())) {
        return a;
      }
    }
  }
  return null;
}
origin: org.opensingular/singular-form-core

private List<SIAnnotation> getAnnotations(SInstance instance) {
  if (annotationsMap != null && ! annotationsMap.isEmpty()) {
    return annotationsMap.get(instance.getId());
  }
  return Collections.emptyList();
}
origin: org.opensingular/form-core

private List<SIAnnotation> getAnnotations(SInstance instance) {
  if (annotationsMap != null && ! annotationsMap.isEmpty()) {
    return annotationsMap.get(instance.getId());
  }
  return Collections.emptyList();
}
origin: org.opensingular/singular-form-core

private ValidationError errorInternal(ValidationErrorLevel level, String msg) {
  ValidationError error = new ValidationErrorImpl(instance.getId(), level, msg);
  onError.accept(error);
  errorFound = true;
  return error;
}
origin: org.opensingular/singular-form-core

/** Retorna a informação de diff para a instância informada, que deve ser da instância original. */
public DiffInfo getByOriginal(SInstance instance) {
  return getByOriginal(instance.getId());
}
origin: org.opensingular/form-core

/** Localiza a anotação com o classificado solicitado na instancia informatada. Ou retorna null. */
private SIAnnotation getAnnotation(SInstance instance, String classifier) {
  if (annotationsMap != null) {
    for (SIAnnotation a : annotationsMap.get(instance.getId())) {
      if (classifier.equals(a.getClassifier())) {
        return a;
      }
    }
  }
  return null;
}
origin: org.opensingular/form-core

protected void updateDocumentErrors(SInstance rootInstance) {
  SInstances.streamDescendants(rootInstance, true)
      .forEach(instance -> rootInstance.getDocument()
          .setValidationErrors(instance.getId(), contextErrors.get(instance.getId())));
}
origin: org.opensingular/singular-form-core

public Optional<SInstance> findInstanceById(Integer instanceId) {
  //TODO (by Daniel) otimizar esse método. Faz pesquisa em profundidade e poderia ser indexado.
  return SInstances.streamDescendants(getRoot(), true)
      .filter(it -> instanceId.equals(it.getId()))
      .findAny();
}
origin: org.opensingular/singular-form-wicket

public static Stream<Component> streamChildrenByInstance(Component root, SInstance instance) {
  Predicate<? super Component> sameInstanceFilter = c -> getInstanceIfAware(c.getDefaultModel())
    .filter(it -> Objects.equal(it.getName(), instance.getName()))
    .filter(it -> Objects.equal(it.getId(), instance.getId()))
    .isPresent();
  return streamDescendants(root)
      .filter(sameInstanceFilter);
}
private static Optional<SInstance> getInstanceIfAware(IModel<?> model) {
origin: org.opensingular/singular-form-core

@Override
public List<Option> load(ProviderContext<SIFieldRef<SI>> context) {
  List<? extends SI> list = getOptionsFunction().apply(context.getInstance());
  Stream<? extends SI> stream = (list != null) ? list.stream() : Stream.empty();
  return stream
    .map(it -> new SIFieldRef.Option(it.getId(), getDescriptionFunction().apply(it)))
    .collect(toList());
}
origin: org.opensingular/singular-form-core

private void updateDocumentErrorsSingle(SInstance instance) {
  final SDocument document = instance.getDocument();
  final Integer id = instance.getId();
  final List<ValidationError> errors = contextErrors.get(id);
  document.setValidationErrors(id, errors);
}
origin: org.opensingular/form-core

/**
 * Associa a anotação a instância informada de forma a anotação aponte para o ID e XPath do mesmo.
 */
final void setTarget(SInstance target) {
  setTargetId(target.getId());
  setTargetPath(buildXPath(target, new StringBuilder()).toString());
}
origin: org.opensingular/form-core

/**
 * @return True if this SIinstance is an annotated type and if the anotation has any value.
 */
public boolean hasAnnotation(SInstance instance) {
  if (annotationsMap != null && ! annotationsMap.isEmpty()) {
    for( SIAnnotation si : annotationsMap.get(instance.getId())) {
      if (StringUtils.isNotBlank(si.getText()) || si.getApproved() != null) {
        return true;
      }
    }
  }
  return false;
}
origin: org.opensingular/singular-form-core

private static void initSubFieldsIfNeeded(@Nonnull SInstance instance) {
  if (hasKeepNodePredicatedInAnyChildren(instance.getType())) {
    //Forces all sub fields in all sub composites to be created just by walking through then
    SInstances.streamDescendants(instance, true).forEach(si -> si.getId());
  }
}
origin: org.opensingular/singular-form-core

/**
 * Associa a anotação a instância informada de forma a anotação aponte para o ID e XPath do mesmo.
 */
final void setTarget(SInstance target) {
  setTargetId(target.getId());
  setTargetPath(buildXPath(target, new StringBuilder()).toString());
}
origin: org.opensingular/singular-form-core

private void assertUniqueIDs(SInstance target, HashMap<Integer, SInstance> usedIds) {
  Integer id = target.getId();
  SInstance old = usedIds.putIfAbsent(id, target);
  if (old != null) {
    throw new AssertionError(
        "Incossitência Interna: Duas instância do mesmo documento estão usando o mesmo ID '" + id + "': '" +
            target.getPathFull() + "' e '" + old.getPathFull() + "'");
  }
  target.forEachChild(child -> assertUniqueIDs(child, usedIds));
}
origin: org.opensingular/form-wicket

@Override
public void onComponentTag(Component component, ComponentTag tag) {
  if (!isInstanceEnabled(component))
    tag.put("disabled", "disabled");
  SInstance instance = resolveInstance(component);
  if (instance != null) {
    tag.put("snglr", "");//identifica como sendo o singular
    tag.put("data-instance-id", instance.getId());
    tag.put("data-instance-path", instance.getPathFull());
  }
}
origin: org.opensingular/singular-form-wicket

@Override
public void onComponentTag(Component component, ComponentTag tag) {
  if (!isInstanceEnabled(component))
    tag.put("disabled", "disabled");
  SInstance instance = resolveInstance(component);
  if (instance != null) {
    tag.put("snglr", "");//identifica como sendo o singular
    tag.put("data-instance-id", instance.getId());
    tag.put("data-instance-path", instance.getPathFull());
  }
}
org.opensingular.formSInstancegetId

Javadoc

Retorna um ID único dentre as instâncias do mesmo documento. Um ID nunca é reutilizado, mesmo se a instancia for removida de dentro do documento. Funcionamento semelhante a uma sequence de banco de dados.

Popular methods of SInstance

  • getDocument
    Retorna o documento ao qual pertence a instância atual.
  • getType
  • toStringDisplay
  • 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
  • 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
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • putExtra (Intent)
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • BoxLayout (javax.swing)
  • JFrame (javax.swing)
  • JLabel (javax.swing)
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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