congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CollectionDescriptor.getName
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.intermine.metadata.CollectionDescriptor.getName (Showing top 20 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: intermine/intermine

/**
 * Takes a Class, and generates a Map of all the collections that are in the Class or any of its
 * parents. The Class may be a dynamic class - ie not in the model, although at least one of its
 * parents are in the model.
 *
 * @param c a Class
 * @return a Map from String collection name to Class element type
 */
public Map<String, Class<?>> getCollectionsForClass(Class<?> c) {
  synchronized (classToCollectionsMap) {
    Map<String, Class<?>> retval = classToCollectionsMap.get(c);
    if (retval == null) {
      retval = new LinkedHashMap<String, Class<?>>();
      for (FieldDescriptor fd : getFieldDescriptorsForClass(c).values()) {
        if (fd instanceof CollectionDescriptor) {
          CollectionDescriptor cd = (CollectionDescriptor) fd;
          retval.put(cd.getName(), cd.getReferencedClassDescriptor().getType());
        }
      }
      classToCollectionsMap.put(c, retval);
    }
    return retval;
  }
}
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: org.intermine/intermine-model

/**
 * Takes a Class, and generates a Map of all the collections that are in the Class or any of its
 * parents. The Class may be a dynamic class - ie not in the model, although at least one of its
 * parents are in the model.
 *
 * @param c a Class
 * @return a Map from String collection name to Class element type
 */
public Map<String, Class<?>> getCollectionsForClass(Class<?> c) {
  synchronized (classToCollectionsMap) {
    Map<String, Class<?>> retval = classToCollectionsMap.get(c);
    if (retval == null) {
      retval = new LinkedHashMap<String, Class<?>>();
      for (FieldDescriptor fd : getFieldDescriptorsForClass(c).values()) {
        if (fd instanceof CollectionDescriptor) {
          CollectionDescriptor cd = (CollectionDescriptor) fd;
          retval.put(cd.getName(), cd.getReferencedClassDescriptor().getType());
        }
      }
      classToCollectionsMap.put(c, retval);
    }
    return retval;
  }
}
origin: org.intermine/intermine-objectstore

private static CollectionDescriptor cloneCollectionDescriptor(CollectionDescriptor ref) {
  return new CollectionDescriptor(ref.getName(), ref.getReferencedClassName(),
      ref.getReverseReferenceFieldName());
}
origin: intermine/intermine

private static CollectionDescriptor cloneCollectionDescriptor(CollectionDescriptor ref) {
  return new CollectionDescriptor(ref.getName(), ref.getReferencedClassName(),
      ref.getReverseReferenceFieldName());
}
origin: org.intermine/intermine-model

colls.put(c.getName(), col);
col.put("name", c.getName());
String type = c.getReferencedClassName();
col.put("referencedType", type.substring(type.lastIndexOf(".") + 1));
origin: intermine/intermine

colls.put(c.getName(), col);
col.put("name", c.getName());
String type = c.getReferencedClassName();
col.put("referencedType", type.substring(type.lastIndexOf(".") + 1));
origin: org.intermine/intermine-objectstore

  CollectionDescriptor cd = (CollectionDescriptor) fd;
  @SuppressWarnings("unchecked") Collection lazyColl = new ProxyCollection(os,
      (InterMineObject) retval, cd.getName(), cd.getReferencedClassDescriptor()
        .getType());
  retval.setFieldValue(cd.getName(), lazyColl);
} else if (fd instanceof ReferenceDescriptor) {
  ReferenceDescriptor rd = (ReferenceDescriptor) fd;
origin: org.intermine/intermine-objectstore

for (CollectionDescriptor merg : merge.getCollectionDescriptors()) {
  CollectionDescriptor orig = original.getCollectionDescriptorByName(merg.getName());
      && orig.getReverseReferenceFieldName() == null) {
      removeFieldDescriptor(newSet, orig.getName());
      newSet.add(cloneCollectionDescriptor(merg));
      continue;
      String fldName = original.getName() + "." + orig.getName();
      throw new ModelMergerException("mismatch between reverse reference field name: "
          + fldName + "<-" + merg.getReverseReferenceFieldName() + " != "
      String fldName = original.getName() + "." + orig.getName();
      throw new ModelMergerException("type mismatch between collection types: "
          + fldName + ":" + merg.getReferencedClassName() + " != "
origin: intermine/intermine

for (CollectionDescriptor merg : merge.getCollectionDescriptors()) {
  CollectionDescriptor orig = original.getCollectionDescriptorByName(merg.getName());
      && orig.getReverseReferenceFieldName() == null) {
      removeFieldDescriptor(newSet, orig.getName());
      newSet.add(cloneCollectionDescriptor(merg));
      continue;
      String fldName = original.getName() + "." + orig.getName();
      throw new ModelMergerException("mismatch between reverse reference field name: "
          + fldName + "<-" + merg.getReverseReferenceFieldName() + " != "
      String fldName = original.getName() + "." + orig.getName();
      throw new ModelMergerException("type mismatch between collection types: "
          + fldName + ":" + merg.getReferencedClassName() + " != "
origin: org.intermine/intermine-objectstore

CollectionDescriptor cold = citer.next();
CollectionDescriptor scdDescriptor =
  scd.getCollectionDescriptorByName(cold.getName());
if (scd.getCollectionDescriptorByName(cold.getName()) != null) {
  LOG.info("removing collection " + cold.getName()
      + " redefinition in " + cd.getName() + " (is now defined in "
      + scd.getName() + ")");
    citer.remove();
  } else {
    String message = "replacing the \"" + sup + "." + cold.getName()
      + "\" collection with " + cd.getName() + "."
      + cold.getName() + " failed because the reverse references differ";
    throw new ModelMergerException(message);
origin: org.intermine/intermine-objectstore

@SuppressWarnings("unchecked") Collection<InterMineObject> coll
  = (Collection<InterMineObject>) ((InterMineObject) o)
  .getFieldValue(collection.getName());
boolean needToStoreCollection = true;
origin: intermine/intermine

@SuppressWarnings("unchecked") Collection<InterMineObject> coll
  = (Collection<InterMineObject>) ((InterMineObject) o)
  .getFieldValue(collection.getName());
boolean needToStoreCollection = true;
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 "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 "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

/**
 * 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

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

for (CollectionDescriptor desc : getAllCollectionDescriptors()) {
  ClassDescriptor cld = desc.getClassDescriptor();
  table.addRow(new String[] {desc.getName(), "collection of "
      + terseClass(desc.getReferencedClassName()),
    (cld == this ? "" : "from " + terseClass(cld.getName()))});
org.intermine.metadataCollectionDescriptorgetName

Popular methods of CollectionDescriptor

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

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now