示例#1
0
  /**
   * Returns the ModeGroup of associated with the given name
   *
   * @return the ModelGroup of associated with the given name, or null if no ModelGroup with the
   *     given name was found.
   */
  public ModelGroup getModelGroup(String name) {

    String ns = null;
    if (name == null) {
      String err = NULL_ARGUMENT + "getModelGroup: ";
      err += " 'name' can not be null";
      throw new IllegalArgumentException(err);
    }

    int idx = name.indexOf(':');
    if (idx >= 0) {
      String nsPrefix = name.substring(0, idx);
      name = name.substring(idx + 1);
      ns = (String) namespaces.get(nsPrefix);
      if (ns == null) {
        String err = "getModelGroup: ";
        err += "Namespace prefix not recognized '" + nsPrefix + "'";
        throw new IllegalArgumentException(err);
      }
    }

    if ((ns == null) || (ns.equals(targetNS))) return (ModelGroup) _group.get(name);
    else {
      Schema schema = getImportedSchema(ns);
      if (schema != null) {
        String warning = "Warning : do not forget to generate the source ";
        warning += "for the schema with this targetNamespace" + schema.getTargetNamespace();
        System.out.println(warning);
        return schema.getModelGroup(name);
      }
    }

    return null;
  } // --getModelGroup
示例#2
0
     /**
     * Returns the ModeGroup of associated with the given name
     * @return the ModelGroup of associated with the given name, or
     *  null if no ModelGroup with the given name was found.
    **/
    public ModelGroup getModelGroup(String name) {

        String ns = null;
        if (name == null) {
            String err = NULL_ARGUMENT + "getModelGroup: ";
            err += " 'name' can not be null";
            throw new IllegalArgumentException(err);
        }

        int idx = name.indexOf(':');
        if (idx >= 0)
        {
            String nsPrefix = name.substring(0,idx);
            name = name.substring(idx + 1);
            ns = (String) _namespaces.getNamespaceURI(nsPrefix);
            if (ns == null)  {
                String err = "getModelGroup: ";
                err += "Namespace prefix not recognized '"+nsPrefix+"'";
                throw new IllegalArgumentException(err);
            }
        }

        if ((ns==null) || (ns.equals(_targetNamespace)) )
            return (ModelGroup)_groups.get(name);
        else {
            Schema schema = getImportedSchema(ns);
            if (schema!=null) {
                return schema.getModelGroup(name);
            }
        }

        return null;
    } //--getModelGroup
示例#3
0
 /**
  * Returns the reference if any
  *
  * @returns the reference if any
  */
 public ModelGroup getReference() {
   if (groupRef != null) return _schema.getModelGroup(groupRef);
   return null;
 } // -- getReference