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

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

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

origin: org.opensingular/singular-form-core

/**
 * Retorna um campo no path indicado com sendo uma lista e cujo os elementos
 * da intancia são do tipo informando. Dispara uma exception se o path
 * indicado não existir na estrutura de dados ou se não for uma lista ou se
 * a lista não for da instância definida.
 *
 * @return Null se o campo no path indicado não tiver sido instanciado
 *         ainda.
 */
@SuppressWarnings("unchecked")
public default <T extends SInstance> SIList<T> getFieldList(String path, Class<T> typeOfInstanceElements) {
  SIList<?> list = getFieldList(path);
  if (list == null) {
    return null;
  } else if (typeOfInstanceElements.isAssignableFrom(list.getElementsType().getInstanceClass())) {
    return (SIList<T>) list;
  }
  throw new SingularFormException("'" + path + "' + retornou uma lista cujos as instancia do tipo " +
      list.getElementsType().getInstanceClass().getName() + ", que não é compatível com o tipo solicitado " +
      typeOfInstanceElements.getName(), (SInstance) this);
}
origin: org.opensingular/form-core

/**
 * Retorna um campo no path indicado com sendo uma lista e cujo os elementos
 * da intancia são do tipo informando. Dispara uma exception se o path
 * indicado não existir na estrutura de dados ou se não for uma lista ou se
 * a lista não for da instância definida.
 *
 * @return Null se o campo no path indicado não tiver sido instanciado
 *         ainda.
 */
@SuppressWarnings("unchecked")
public default <T extends SInstance> SIList<T> getFieldList(String path, Class<T> typeOfInstanceElements) {
  SIList<?> list = getFieldList(path);
  if (list == null) {
    return null;
  } else if (typeOfInstanceElements.isAssignableFrom(list.getElementsType().getInstanceClass())) {
    return (SIList<T>) list;
  }
  throw new SingularFormException("'" + path + "' + retornou uma lista cujos as instancia do tipo " +
      list.getElementsType().getInstanceClass().getName() + ", que não é compatível com o tipo solicitado " +
      typeOfInstanceElements.getName(), (SInstance) this);
}
origin: org.opensingular/singular-form-core

/**
 * Cria a nova instância de lista com o cast para o generic tipo de
 * instancia informado. Se o tipo do conteudo não for compatível dispara
 * exception.
 * <p>
 * <p>
 * <pre>
 * MTipoLista&lt;MTipoString> tipoLista = ...
 *
 * // metodo simples e não dispara exception se tipo errado
 * MILista&lt;MIString> lista1 = (MILista&lt;MIString>) tipoLista.newInstance();
 *
 * // já devolvendo lista no tipo certo e verificando se correto
 * MILista&lt;MIString> lista2 = tipoLista.newInstance(MIString.class);
 * </pre>
 */
@SuppressWarnings("unchecked")
public <T extends SInstance> SIList<T> newInstance(Class<T> classOfElements) {
  SIList<?> newList = newInstance();
  if (!classOfElements.isAssignableFrom(getElementsType().getInstanceClass())) {
    throw new SingularFormException("As instancias da lista são do tipo " + getElementsType().getInstanceClass().getName()
        + ", que não é compatível com o solicitado " + classOfElements.getName(), this);
  }
  return (SIList<T>) newList;
}
origin: org.opensingular/form-core

/**
 * Cria a nova instância de lista com o cast para o generic tipo de
 * instancia informado. Se o tipo do conteudo não for compatível dispara
 * exception.
 * <p>
 * <p>
 * <pre>
 * MTipoLista&lt;MTipoString> tipoLista = ...
 *
 * // metodo simples e não dispara exception se tipo errado
 * MILista&lt;MIString> lista1 = (MILista&lt;MIString>) tipoLista.newInstance();
 *
 * // já devolvendo lista no tipo certo e verificando se correto
 * MILista&lt;MIString> lista2 = tipoLista.newInstance(MIString.class);
 * </pre>
 */
@SuppressWarnings("unchecked")
public <T extends SInstance> SIList<T> newInstance(Class<T> classOfElements) {
  SIList<?> newList = newInstance();
  if (!classOfElements.isAssignableFrom(getElementsType().getInstanceClass())) {
    throw new SingularFormException("As instancias da lista são do tipo " + getElementsType().getInstanceClass().getName()
        + ", que não é compatível com o solicitado " + classOfElements.getName(), this);
  }
  return (SIList<T>) newList;
}
origin: org.opensingular/singular-form-wicket

@Override
@SuppressWarnings("unchecked")
public Class<T> getObjectClass() {
  SType<?> type = getTarget().getType();
  if (type instanceof STypeSimple<?, ?>) {
    return (Class<T>) ((STypeSimple<?, ?>) type).getValueClass();
  }
  return (Class<T>) type.getInstanceClass();
}
origin: org.opensingular/form-wicket

@Override
@SuppressWarnings("unchecked")
public Class<T> getObjectClass() {
  SType<?> mtipo = getTarget().getType();
  if (mtipo instanceof STypeSimple<?, ?>) {
    return (Class<T>) ((STypeSimple<?, ?>) mtipo).getValueClass();
  }
  return (Class<T>) mtipo.getInstanceClass();
}
org.opensingular.formSTypegetInstanceClass

Popular methods of SType

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Permission (java.security)
    Legacy security code; do not use.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Vim plugins
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