Tabnine Logo
SType.newInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
newInstance
method
in
org.opensingular.form.SType

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

origin: org.opensingular/form-core

/**
 * Criar uma nova instância do tipo atual e executa os códigos de inicialização dos tipos
 * se existirem (ver {@link #withInitListener(IConsumer)}}).
 */
public final I newInstance() {
  return newInstance(true);
}
origin: org.opensingular/singular-form-core

/**
 * Cria uma nova instância pertencente ao documento informado.
 */
I newInstance(SDocument owner) {
  return newInstance(this, owner);
}
origin: org.opensingular/form-core

/**
 * Cria uma nova instância pertencente ao documento informado.
 */
I newInstance(SDocument owner) {
  return newInstance(this, owner);
}
origin: org.opensingular/singular-form-core

/** @see {@link SType#newInstance(boolean, SDocument)}  */
public SInstance newInstance(@Nonnull SType target, boolean executeInstanceInitListeners,@Nonnull SDocument owner) {
  return target.newInstance(executeInstanceInitListeners, owner);
}
origin: org.opensingular/singular-form-core

/**
 * Criar uma nova instância do tipo atual e executa os códigos de inicialização dos tipos
 * se existirem (ver {@link #withInitListener(IConsumer)}}).
 */
public final I newInstance() {
  return newInstance(true, new SDocument());
}
origin: org.opensingular/form-core

/**
 * Cria uma instância não passível de serialização para do tipo com o
 * conteúdo persistido no XML informado.
 */
public static <T extends SInstance> T fromXML(SType<T> tipo, MElement xml) {
  return fromXMLInterno(tipo.newInstance(), xml);
}
origin: org.opensingular/singular-form-core

/**
 * Cria uma instância não passível de serialização para do tipo com o
 * conteúdo persistido no XML informado.
 */
@Nonnull
public static <T extends SInstance> T fromXML(@Nonnull SType<T> type, @Nullable MElement xml) {
  return fromXMLInterno(type.newInstance(), xml);
}
origin: org.opensingular/singular-form-core

/**
 * Cria uma instância não passível de serialização para do tipo com o
 * conteúdo persistido no XML informado.
 */
@Nonnull
public static <T extends SInstance> T fromXML(@Nonnull SType<T> type, @Nullable String xmlString) {
  return fromXMLInterno(type.newInstance(), parseXml(xmlString));
}
origin: org.opensingular/form-core

/**
 * Cria uma instância não passível de serialização para do tipo com o
 * conteúdo persistido no XML informado.
 */
public static <T extends SInstance> T fromXML(SType<T> tipo, String xmlString) {
  return fromXMLInterno(tipo.newInstance(), parseXml(xmlString));
}
origin: org.opensingular/singular-form-wicket

@SuppressWarnings("unchecked")
public <ST extends SType<?>> List<SInstance> getChoices(IFunction<T, ST> typeFinder) {
  SInstance          subInstance = resolveTypeFinderInstance(typeFinder);
  ST                 subtype     = (ST) subInstance.getType();
  Component          component   = getComponentForSType(subtype);
  SInstanceConverter converter   = subInstance.asAtrProvider().getConverter();
  return (List<SInstance>) ((AbstractChoice) component).getChoices().stream().map(serializable -> {
    SInstance choiceInstance = subtype.newInstance();
    converter.fillInstance(choiceInstance, (Serializable) serializable);
    return choiceInstance;
  }).collect(Collectors.toList());
}
origin: org.opensingular/singular-form-core

@Nonnull
private E addNewInternal(boolean atEnd, int index) {
  E instance = getElementsType().newInstance(getDocument());
  addInternal(instance, atEnd, index);
  instance.init();
  return instance;
}
origin: org.opensingular/form-core

public E addNewAt(int index) {
  E instance = getElementsType().newInstance(getDocument());
  return addInternal(instance, false, index);
}
origin: org.opensingular/form-core

public E addNew() {
  E instance = getElementsType().newInstance(getDocument());
  return addInternal(instance, true, -1);
}
origin: org.opensingular/singular-form-core

final SInstance newAttributeInstanceFor(SType<?> typeToBeAppliedAttribute) {
  checkIfIsAttribute();
  SInstance attrInstance;
  if (attrInternalRef.isSelfReference()) {
    attrInstance = typeToBeAppliedAttribute.newInstance(getDictionary().getInternalDicionaryDocument());
  } else {
    attrInstance = newInstance(getDictionary().getInternalDicionaryDocument());
  }
  attrInstance.setAsAttribute(attrInternalRef, typeToBeAppliedAttribute);
  return attrInstance;
}
origin: org.opensingular/form-core

final SInstance newAttributeInstanceFor(SType<?> typeToBeAppliedAttribute) {
  checkIfIsAttribute();
  SInstance attrInstance;
  if (attributeDefinitionInfo.isSelfReference()) {
    attrInstance = typeToBeAppliedAttribute.newInstance(getDictionary().getInternalDicionaryDocument());
  } else {
    attrInstance = newInstance(getDictionary().getInternalDicionaryDocument());
  }
  attrInstance.setAsAttribute(getName(), this);
  return attrInstance;
}
origin: org.opensingular/singular-form-core

@Override
@Nonnull
protected SInstance createNewAttribute(@Nonnull AttrInternalRef ref) {
  SType<?> attributeType = AttributeValuesManagerForSType.getAttributeDefinedHierarchy(getOwner().getType(), ref);
  SInstance instanceAtr = attributeType.newInstance(getOwner().getDocument());
  instanceAtr.setAsAttribute(ref, getOwner());
  return instanceAtr;
}
origin: org.opensingular/singular-form-core

@Nonnull
private E addElementInternal(@Nonnull E instance, boolean atEnd, int index) {
  if (instance.getDocument() == getDocument()) {
    return addInternal(instance, atEnd, index);
  } else {
    E copy = getElementsType().newInstance(getDocument());
    Value.copyValues(instance, copy);
    return addInternal(copy, atEnd, index);
  }
}
origin: org.opensingular/singular-form-core

/**
 * Cria um atributo temporariamente sem a sua definição de tipo definitiva. Em quanto isso, será considerado como
 * String. Provavelmente utilizado para guardar valores em quanto o real registro do atributo não é feito no
 * dicionário.
 */
@Nonnull
protected final SInstance createTemporaryAttribute() {
  SType<?> attrType = getOwner().getDictionary().getType(STypeString.class);
  SInstance attr = attrType.newInstance(getOwner().getDictionary().getInternalDicionaryDocument());
  attr.setAttributeShouldMigrate();
  return attr;
}
origin: org.opensingular/singular-form-core

private SInstance createField(int fieldIndex) {
  SType<?> fieldType = getType().getField(fieldIndex);
  SInstance instance = fieldType.newInstance(getDocument());
  if (fields == null) {
    fields = new FieldMapOfRecordInstance(getType().size());
  }
  fields.set(fieldIndex, instance);
  instance.setParent(this);
  return instance;
}
origin: org.opensingular/form-core

private SInstance createField(int fieldIndex) {
  SType<?> fieldType = getType().getField(fieldIndex);
  SInstance instance = fieldType.newInstance(getDocument());
  if (fields == null) {
    fields = new FieldMapOfRecordInstance(getType().size());
  }
  fields.set(fieldIndex, instance);
  instance.setParent(this);
  return instance;
}
org.opensingular.formSTypenewInstance

Javadoc

Criar uma nova instância do tipo atual e executa os códigos de inicialização dos tipos se existirem (ver #withInitListener(IConsumer)}).

Popular methods of SType

  • asAtr
  • getNameSimple
  • getName
  • asAtrProvider
  • getAttributeValue
  • isList
    Verificar se o tipo é um tipo lista ( STypeList).
  • getValidators
  • withView
  • asAtrBootstrap
  • getInstanceClass
  • isComposite
    Verificar se o tipo é um tipo composto ( STypeComposite).
  • getDependentTypes
  • isComposite,
  • getDependentTypes,
  • getDictionary,
  • hasAttributeDefinedInHierarchy,
  • isDependentType,
  • isTypeOf,
  • addAttribute,
  • addDependentType,
  • addInstanceValidator

Popular in Java

  • Reactive rest calls using spring rest template
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • 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