Codota Logo
Schema$SchemaId
Code IndexAdd Codota to your IDE (free)

How to use
Schema$SchemaId
in
org.deephacks.confit.model

Best Java code snippets using org.deephacks.confit.model.Schema$SchemaId (Showing top 17 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.deephacks/confit-api-model

public String toString() {
  return Objects.toStringHelper(SchemaId.class).add("id", getName())
      .add("desc", getDesc()).toString();
}
origin: org.deephacks/confit

Config schemaConfig = config.getConfig(schemaName);
Bean bean;
if (schema.getId().isSingleton()) {
  bean = Bean.create(BeanId.createSingleton(schema.getName()));
  constructBean(schemaConfig, schema, bean, schemas);
origin: org.deephacks/confit-api-model

@Override
public int hashCode() {
  return Objects.hashCode(getName(), getDesc());
}
origin: org.deephacks/confit

public String toString() {
  return Objects.toStringHelper(SchemaId.class).add("id", getName())
      .add("desc", getDesc()).toString();
}
origin: org.deephacks/confit

@Override
public int hashCode() {
  return Objects.hashCode(getName(), getDesc());
}
origin: org.deephacks/confit

public static SchemaId create(final String name, final String desc,
    final boolean isSingleton) {
  return new SchemaId(name, desc, isSingleton);
}
origin: org.deephacks/confit-admin-jaxrs

public Schema toSchema() {
  SchemaId id = SchemaId.create(idName, idDesc, singleton);
  Schema schema = Schema.create(id, className, schemaName, desc);
  for (SchemaProperty schemaProperty : property) {
    schema.add(schemaProperty.toSchema());
  }
  for (SchemaPropertyList schemaPropertyList : propertyList) {
    schema.add(schemaPropertyList.toSchema());
  }
  for (SchemaPropertyRef schemaPropertyRef : propertyRef) {
    schema.add(schemaPropertyRef.toSchema());
  }
  for (SchemaPropertyRefList schemaPropertyRefList : propertyRefList) {
    schema.add(schemaPropertyRefList.toSchema());
  }
  for (SchemaPropertyRefMap schemaPropertyRefMap : propertyRefMap) {
    schema.add(schemaPropertyRefMap.toSchema());
  }
  return schema;
}
origin: org.deephacks/confit

private SchemaId getId(ClassIntrospector introspector) {
  List<FieldWrap> ids = introspector.getFieldList(Id.class);
  boolean isSingleton = false;
  if (ids == null || ids.size() == 0) {
    return null;
  } else {
    FieldWrap id = ids.get(0);
    Id anno = (Id) id.getAnnotation().get();
    if ((id.isStatic() && !id.isFinal()) || (id.isFinal() && !id.isStatic())) {
      throw CFG108_ILLEGAL_MODIFIERS(id.getField());
    }
    String name = anno.name();
    if (name == null || "".equals(name)) {
      name = id.getFieldName();
    }
    return SchemaId.create(name, anno.desc(), isSingleton);
  }
}
origin: org.deephacks/confit

public List<Bean> list(Schema schema, Map<String, Schema> schemas) {
  List<Bean> beans = new ArrayList<>();
  Config schemaConfig;
  try {
    String schemaName = schema.getName().replaceAll("\\$", "\\.");
    schemaConfig = config.getConfig(schemaName);
    if (schemaConfig == null) {
      return beans;
    }
  } catch (Exception e) {
    return beans;
  }
  if (schema.getId().isSingleton()) {
    final Bean bean = Bean.create(BeanId.createSingleton(schema.getName()));
    beans.add(bean);
    constructBean(schemaConfig, schema, bean, schemas);
  } else {
    for (Object instanceId : schemaConfig.root().keySet()) {
      Config instance = schemaConfig.getConfig(instanceId.toString());
      final Bean bean = Bean.create(BeanId.create(instanceId.toString(), schema.getName()));
      beans.add(bean);
      constructBean(instance, schema, bean, schemas);
    }
  }
  return beans;
}
origin: org.deephacks/confit

@Override
public Schema convert(Class<?> source, Class<? extends Schema> specificType) {
  ClassIntrospector introspector = new ClassIntrospector(source);
  Config config = introspector.getAnnotation(Config.class);
  if (config == null) {
    throw CFG102_NOT_CONFIGURABLE(source);
  }
  SchemaId schemaId = getId(introspector);
  if (schemaId == null) {
    // lookup instance does not have @Id annotations so we create
    // it from the @Config annotation
    schemaId = SchemaId.create(config.name(), config.desc(), true);
  }
  String schemaName = config.name();
  if (schemaName == null || "".equals(schemaName)) {
    schemaName = source.getName();
  }
  Schema schema = Schema.create(schemaId, introspector.getName(), schemaName, config.desc());
  Collection<Object> fields = new ArrayList<>();
  fields.addAll(introspector.getNonStaticFieldList());
  Collection<AbstractSchemaProperty> props = conversion.convert(fields,
      AbstractSchemaProperty.class);
  for (AbstractSchemaProperty abstractProp : props) {
    schema.add(abstractProp);
  }
  return schema;
}
origin: org.deephacks/confit-admin-jaxrs

public JaxrsSchema(Schema schema) {
  this.schemaName = schema.getName();
  this.className = schema.getType();
  this.desc = schema.getDesc();
  this.idName = schema.getId().getName();
  this.idDesc = schema.getId().getDesc();
  this.singleton = schema.getId().isSingleton();
  for (Schema.SchemaProperty prop : schema.get(Schema.SchemaProperty.class)) {
    property.add(new SchemaProperty(prop));
    propertyNames.add(prop.getName());
  }
  for (Schema.SchemaPropertyList prop : schema.get(Schema.SchemaPropertyList.class)) {
    propertyList.add(new SchemaPropertyList(prop));
    propertyNames.add(prop.getName());
  }
  for (Schema.SchemaPropertyRef prop : schema.get(Schema.SchemaPropertyRef.class)) {
    propertyRef.add(new SchemaPropertyRef(prop));
    propertyNames.add(prop.getName());
  }
  for (Schema.SchemaPropertyRefList prop : schema.get(Schema.SchemaPropertyRefList.class)) {
    propertyRefList.add(new SchemaPropertyRefList(prop));
    propertyNames.add(prop.getName());
  }
  for (Schema.SchemaPropertyRefMap prop : schema.get(Schema.SchemaPropertyRefMap.class)) {
    propertyRefMap.add(new SchemaPropertyRefMap(prop));
    propertyNames.add(prop.getName());
  }
}
origin: org.deephacks/confit-api-model

public static SchemaId create(final String name, final String desc,
    final boolean isSingleton) {
  return new SchemaId(name, desc, isSingleton);
}
origin: org.deephacks/confit

  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof SchemaId)) {
      return false;
    }
    SchemaId o = (SchemaId) obj;
    return equal(getName(), o.getName()) && equal(getDesc(), o.getDesc());
  }
}
origin: org.deephacks/confit-admin-jaxrs

public Bean toBean(Schema schema) {
  final BeanId id;
  if (schema.getId().isSingleton()) {
    id = BeanId.createSingleton(schema.getName());
  } else {
origin: org.deephacks/confit-api-model

  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof SchemaId)) {
      return false;
    }
    SchemaId o = (SchemaId) obj;
    return equal(getName(), o.getName()) && equal(getDesc(), o.getDesc());
  }
}
origin: org.deephacks/confit

  throw Events.CFG101_SCHEMA_NOT_EXIST(schemaName);
if (refSchema.getId().isSingleton()) {
  BeanId id = BeanId.createSingleton(refSchema.getName());
  Optional<Bean> optional = get(id, schemas);
origin: org.deephacks/confit

private Object convert(Bean source, Object instance, Map<String, Object> valuesToInject,
    Map<BeanId, Object> instanceCache) {
  instanceCache.put(source.getId(), instance);
  convertProperty(source, valuesToInject);
  convertPropertyList(source, valuesToInject);
  convertPropertyRef(source, valuesToInject, instanceCache);
  convertPropertyRefList(source, valuesToInject, instanceCache);
  convertPropertyRefMap(source, valuesToInject, instanceCache);
  Schema schema = source.getSchema();
  if (!schema.getId().isSingleton()) {
    // do not try to inject lookup id: the field is static final
    valuesToInject.put(getIdField(instance.getClass()), source.getId().getInstanceId());
  }
  inject(instance, valuesToInject);
  return instance;
}
org.deephacks.confit.modelSchema$SchemaId

Javadoc

Description of the identification of a a particular schema registered in the system.

Most used methods

  • getDesc
  • getName
  • <init>
  • create
  • isSingleton

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • getApplicationContext (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now