Tabnine Logo
CollectionDescriptor.getClassDescriptor
Code IndexAdd Tabnine to your IDE (free)

How to use
getClassDescriptor
method
in
org.intermine.metadata.CollectionDescriptor

Best Java code snippets using org.intermine.metadata.CollectionDescriptor.getClassDescriptor (Showing top 8 results out of 315)

origin: intermine/intermine

/**
 * Generates code for a single collection.
 *
 * @param col the CollectionDescriptor
 * @param field true if the class should have the associated field, or false if the field is in
 * the superclass
 * @return java code
 */
protected String generate(CollectionDescriptor col, boolean field) {
  String type = "java.util.Set<" + col.getReferencedClassName() + ">";
  String impl = "java.util.HashSet<" + col.getReferencedClassName() + ">";
  StringBuffer sb = new StringBuffer();
  if (field) {
    sb.append(INDENT + "// Col: " + col.getClassDescriptor().getName() + "."
        + col.getName() + ENDL)
      .append(INDENT)
      .append("protected ")
      .append(type)
      .append(" ")
      .append(col.getName())
      .append(" = new ")
      .append(impl)
      .append("();" + ENDL);
  }
  sb.append(generateGetSet(col, field))
    .append(ENDL);
  return sb.toString();
}
origin: org.intermine/intermine-model

/**
 * Generates code for a single collection.
 *
 * @param col the CollectionDescriptor
 * @param field true if the class should have the associated field, or false if the field is in
 * the superclass
 * @return java code
 */
protected String generate(CollectionDescriptor col, boolean field) {
  String type = "java.util.Set<" + col.getReferencedClassName() + ">";
  String impl = "java.util.HashSet<" + col.getReferencedClassName() + ">";
  StringBuffer sb = new StringBuffer();
  if (field) {
    sb.append(INDENT + "// Col: " + col.getClassDescriptor().getName() + "."
        + col.getName() + ENDL)
      .append(INDENT)
      .append("protected ")
      .append(type)
      .append(" ")
      .append(col.getName())
      .append(" = new ")
      .append(impl)
      .append("();" + ENDL);
  }
  sb.append(generateGetSet(col, field))
    .append(ENDL);
  return sb.toString();
}
origin: intermine/intermine

/**
 * Creates a column name for the "outward" key of a many-to-many collection descriptor.
 *
 * @param col CollectionDescriptor
 * @param version the database version number
 * @return a valid column name
 */
public static String getOutwardIndirectionColumnName(CollectionDescriptor col, int version) {
  if (FieldDescriptor.M_N_RELATION != col.relationType()) {
    throw new IllegalArgumentException("Argument must be a CollectionDescriptor for a "
                      + "many-to-many relation");
  }
  if (version == 0) {
    ReferenceDescriptor rd = col.getReverseReferenceDescriptor();
    String colName = (rd == null
      ? TypeUtil.unqualifiedName(col.getClassDescriptor().getName())
      : rd.getName());
    return StringUtil.capitalise(generateSqlCompatibleName(colName));
  } else if (version == 1) {
    return StringUtil.capitalise(generateSqlCompatibleName(col.getName()));
  } else {
    throw new IllegalArgumentException("Database version number " + version
        + " not recognised");
  }
}
origin: org.intermine/intermine-objectstore

/**
 * Creates a column name for the "outward" key of a many-to-many collection descriptor.
 *
 * @param col CollectionDescriptor
 * @param version the database version number
 * @return a valid column name
 */
public static String getOutwardIndirectionColumnName(CollectionDescriptor col, int version) {
  if (FieldDescriptor.M_N_RELATION != col.relationType()) {
    throw new IllegalArgumentException("Argument must be a CollectionDescriptor for a "
                      + "many-to-many relation");
  }
  if (version == 0) {
    ReferenceDescriptor rd = col.getReverseReferenceDescriptor();
    String colName = (rd == null
      ? TypeUtil.unqualifiedName(col.getClassDescriptor().getName())
      : rd.getName());
    return StringUtil.capitalise(generateSqlCompatibleName(colName));
  } else if (version == 1) {
    return StringUtil.capitalise(generateSqlCompatibleName(col.getName()));
  } else {
    throw new IllegalArgumentException("Database version number " + version
        + " not recognised");
  }
}
origin: intermine/intermine

/**
 * Creates a column name for the "inward" key of a many-to-many collection descriptor.
 *
 * @param col CollectionDescriptor
 * @param version the database version number
 * @return a valid column name
 */
public static String getInwardIndirectionColumnName(CollectionDescriptor col, int version) {
  if (FieldDescriptor.M_N_RELATION != col.relationType()) {
    throw new IllegalArgumentException("Argument must be a CollectionDescriptor for a "
                      + "many-to-many relation");
  }
  if (version == 0) {
    return StringUtil.capitalise(generateSqlCompatibleName(col.getName()));
  } else if (version == 1) {
    ReferenceDescriptor rd = col.getReverseReferenceDescriptor();
    String colName = (rd == null
      ? TypeUtil.unqualifiedName(col.getClassDescriptor().getName())
      : rd.getName());
    return StringUtil.capitalise(generateSqlCompatibleName(colName));
  } else {
    throw new IllegalArgumentException("Database version number " + version
        + " not recognised");
  }
}
origin: org.intermine/intermine-objectstore

/**
 * Creates a column name for the "inward" key of a many-to-many collection descriptor.
 *
 * @param col CollectionDescriptor
 * @param version the database version number
 * @return a valid column name
 */
public static String getInwardIndirectionColumnName(CollectionDescriptor col, int version) {
  if (FieldDescriptor.M_N_RELATION != col.relationType()) {
    throw new IllegalArgumentException("Argument must be a CollectionDescriptor for a "
                      + "many-to-many relation");
  }
  if (version == 0) {
    return StringUtil.capitalise(generateSqlCompatibleName(col.getName()));
  } else if (version == 1) {
    ReferenceDescriptor rd = col.getReverseReferenceDescriptor();
    String colName = (rd == null
      ? TypeUtil.unqualifiedName(col.getClassDescriptor().getName())
      : rd.getName());
    return StringUtil.capitalise(generateSqlCompatibleName(colName));
  } else {
    throw new IllegalArgumentException("Database version number " + version
        + " not recognised");
  }
}
origin: intermine/intermine

ClassDescriptor cld = desc.getClassDescriptor();
table.addRow(new String[] {desc.getName(), "collection of "
    + terseClass(desc.getReferencedClassName()),
origin: org.intermine/intermine-model

ClassDescriptor cld = desc.getClassDescriptor();
table.addRow(new String[] {desc.getName(), "collection of "
    + terseClass(desc.getReferencedClassName()),
org.intermine.metadataCollectionDescriptorgetClassDescriptor

Popular methods of CollectionDescriptor

  • <init>
    Construct a CollectionDescriptor. name and referencedType may not be null.
  • getReferencedClassDescriptor
  • getReverseReferenceDescriptor
  • getName
  • getReferencedClassName
  • getReverseReferenceFieldName
  • relationType
  • findReferencedDescriptor
  • equals
  • hashCode
  • setClassDescriptor
  • toString
  • setClassDescriptor,
  • toString

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • From CI to AI: The AI layer in your organization
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