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

How to use
Schema$SchemaPropertyList
in
org.deephacks.tools4j.config.model

Best Java code snippets using org.deephacks.tools4j.config.model.Schema$SchemaPropertyList (Showing top 14 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.tools4j/tools4j-config-tck

_colDefault.add("simple1");
_colDefault.add("simple2");
SchemaPropertyList col = SchemaPropertyList.create(_name, _fieldName, _classType,
    _desc, true, new ArrayList<String>(), _colDefault, _colDefault.getClass()
        .getName(), false);
origin: org.deephacks.tools4j/tools4j-config-api-model

public String toString() {
  return Objects.toStringHelper(SchemaPropertyList.class)
      .add("type", getCollectionType()).add("collectionType", getCollectionType())
      .add("defaultValue", getDefaultValues()).toString();
}
origin: org.deephacks.tools4j/tools4j-config-api-model

  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof SchemaPropertyList)) {
      return false;
    }
    SchemaPropertyList o = (SchemaPropertyList) obj;
    return equals(o) && equal(getCollectionType(), o.getCollectionType())
        && equal(getType(), o.getType());
  }
}
origin: org.deephacks.tools4j/tools4j-config-api-model

/**
 * Not to be used by users.
 */
public static SchemaPropertyList create(final String name, final String fieldName,
    final String type, final String desc, boolean isImmutable,
    final List<String> enums, List<String> defaultValues, final String collectionType, final boolean indexed) {
  return new SchemaPropertyList(name, fieldName, type, desc, isImmutable, enums,
      collectionType, defaultValues, indexed);
}
origin: org.deephacks.tools4j/config-core

  public XmlSchemaCollection(SchemaPropertyList p) {
    this.name = p.getName();
    this.fieldName = p.getFieldName();
    this.parameterizedType = p.getType();
    this.collectionType = p.getCollectionType();
    this.desc = p.getDesc();
    this.isImmutable = p.isImmutable();
    this.isImmutable = p.isEnum();
    this.defaultValues = p.getDefaultValues();
  }
}
origin: org.deephacks.tools4j/tools4j-config-core

private Class<?> getType(final AbstractSchemaProperty property) {
  if (property instanceof SchemaProperty) {
    return ((SchemaProperty) property).getClassType();
  } else if (property instanceof SchemaPropertyList) {
    return  ((SchemaPropertyList) property).getClassCollectionType();
  } else if (property instanceof SchemaPropertyRef) {
    return String.class;
  } else if (property instanceof SchemaPropertyRefList ||
      property instanceof SchemaPropertyRefMap) {
    return ArrayList.class;
  } else {
    throw new IllegalArgumentException("Unrecognized property");
  }
}
origin: org.deephacks.tools4j/tools4j-config-core

private void convertPropertyList(Bean source, Map<String, Object> values) {
  for (SchemaPropertyList prop : source.getSchema().get(SchemaPropertyList.class)) {
    List<String> vals = source.getValues(prop.getName());
    String field = prop.getFieldName();
    if (vals == null) {
      continue;
    }
    Collection<Object> c = newCollection(loadClass(prop.getCollectionType()));
    for (String val : vals) {
      Object converted = conversion.convert(val, loadClass(prop.getType()));
      c.add(converted);
    }
    values.put(field, c);
  }
}
origin: org.deephacks.tools4j/config-core

private static void validatePropertyList(Bean bean) {
  Schema schema = bean.getSchema();
  ClassRepository repos = new ClassRepository();
  for (SchemaPropertyList prop : schema.get(SchemaPropertyList.class)) {
    List<String> values = bean.getValues(prop.getName());
    if (values == null) {
      continue;
    }
    for (String value : values) {
      try {
        conversion.convert(value, repos.loadClass(prop.getType()));
      } catch (Exception e) {
        throw Events.CFG105_WRONG_PROPERTY_TYPE(bean.getId(), prop.getName(),
            prop.getType(), value);
      }
    }
  }
}
origin: org.deephacks.tools4j/tools4j-config-core

private static void validatePropertyList(Bean bean) {
  Schema schema = bean.getSchema();
  for (SchemaPropertyList prop : schema.get(SchemaPropertyList.class)) {
    List<String> values = bean.getValues(prop.getName());
    if (values == null) {
      continue;
    }
    for (String value : values) {
      try {
        conversion.convert(value, forName(prop.getType()));
      } catch (Exception e) {
        throw Events.CFG105_WRONG_PROPERTY_TYPE(bean.getId(), prop.getName(),
            prop.getType(), value);
      }
    }
  }
}
origin: org.deephacks.tools4j/config-core

private AbstractSchemaProperty convertSimple(FieldWrap<Config> source) {
  String name = source.getAnnotation().name();
  String desc = source.getAnnotation().desc();
  String fieldName = source.getFieldName();
  if (name == null || "".equals(name)) {
    name = fieldName;
  }
  Class<?> type = source.getType();
  validateField(source);
  try {
    if (source.isCollection()) {
      Collection<String> converted = conversion.convert(source.getDefaultValues(),
          String.class);
      List<String> defaultValues = new ArrayList<String>(converted);
      return SchemaPropertyList.create(name, fieldName, type.getName(), desc, source
          .isFinal(), source.isEnum(), defaultValues, source.getCollRawType()
          .getName());
    } else {
      return SchemaProperty.create(name, fieldName, type.getName(), desc,
          source.isFinal(), source.isEnum(),
          conversion.convert(source.getDefaultValue(), String.class));
    }
  } catch (ConversionException e) {
    throw CFG104_UNSUPPORTED_PROPERTY(String.class, name, type);
  }
}
origin: org.deephacks.tools4j/tools4j-config-core

List<String> defaultValues = new ArrayList<>(converted);
return SchemaPropertyList.create(name, fieldName, type.getName(), desc, source
    .isFinal(), source.getEnums(), defaultValues, source.getCollRawType()
    .getName(), indexed);
origin: org.deephacks.tools4j/config-core

public Map<String, Schema> getSchemas() {
  Map<String, Schema> result = new HashMap<String, Schema>();
  for (XmlSchema b : schemas) {
    Schema schema = Schema.create(
        SchemaId.create(b.id.name, b.id.desc, b.id.singleton), b.type, b.name,
        b.desc);
    for (XmlSchemaProperty p : b.properties) {
      schema.add(SchemaProperty.create(p.name, p.fieldName, p.type, p.desc,
          p.isImmutable, p.isEnum, p.defaultValue));
    }
    for (XmlSchemaCollection p : b.collection) {
      schema.add(SchemaPropertyList.create(p.name, p.fieldName, p.parameterizedType,
          p.desc, p.isImmutable, p.isEnum, p.defaultValues, p.collectionType));
    }
    for (XmlSchemaRef p : b.ref) {
      schema.add(SchemaPropertyRef.create(p.name, p.fieldName, p.schemaName, p.desc,
          p.isImmutable, p.isSingleton));
    }
    for (XmlSchemaRefCollection p : b.refCollection) {
      schema.add(SchemaPropertyRefList.create(p.name, p.fieldName, p.schemaName,
          p.desc, p.isImmutable, p.collectionType));
    }
    for (XmlSchemaRefMap p : b.refMap) {
      schema.add(SchemaPropertyRefMap.create(p.name, p.fieldName, p.schemaName,
          p.desc, p.isImmutable, p.mapType));
    }
    result.put(schema.getName(), schema);
  }
  return result;
}
origin: org.deephacks.tools4j/tools4j-config-api-model

@Override
public int hashCode() {
  return Objects.hashCode(super.getHashCode(), getType(), getCollectionType());
}
origin: org.deephacks.tools4j/config-core

private void convertPropertyList(Bean source, Map<String, Object> values) {
  for (SchemaPropertyList prop : source.getSchema().get(SchemaPropertyList.class)) {
    List<String> vals = source.getValues(prop.getName());
    String field = prop.getFieldName();
    if (vals == null) {
      continue;
    }
    Collection<Object> c = newCollection(forName(prop.getCollectionType()));
    for (String val : vals) {
      Object converted = conversion.convert(val, forName(prop.getType()));
      c.add(converted);
    }
    values.put(field, c);
  }
}
org.deephacks.tools4j.config.modelSchema$SchemaPropertyList

Javadoc

Description of a collection (or any other subtype) of simple types.

Most used methods

  • create
  • getCollectionType
  • getType
  • getDefaultValues
  • getFieldName
  • getName
  • <init>
  • equals
  • getClassCollectionType
  • getClassType
  • getDesc
  • isEnum
  • getDesc,
  • isEnum,
  • isImmutable

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JButton (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
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