Package edu.mit.simile.fresnel.format

Examples of edu.mit.simile.fresnel.format.Format


              Group objGroup = conf.groupLookupOrAdd(objRes);
              out.setGroupUse(objGroup);
            } catch (ResourceNotFoundException e) {
              // if not a group, try a format
              try {
                Format objFormat = conf.formatLookup(objRes);
                out.setFormatUse(objFormat);
              } catch (ResourceNotFoundException re) {
                // if not a style, there's nothing to fall back to
                throw new ParsingException("Failed to find useful description of fresnel:use object: " + ((URI) objRes).toString());
              }
View Full Code Here


      it = conn.getStatements((Resource) null, FresnelCore.propertyFormatDomain, (Value) null, false);
      while (it.hasNext()) {
        try {
          Statement formatResourceStatement = (Statement) it.next();
          Format format = Format.parse(this._source, formatResourceStatement.getSubject(), this);
          if (!this._all.containsKey(format.getIdentifier())) addPropertyFormat(format);
        } catch (ParsingException e) {
          gather(e);
        } catch (UnresolvableException u) {
          gather(u);
        }
      }
      it.close();

      it = conn.getStatements((Resource) null, FresnelCore.instanceFormatDomain, (Value) null, false);
      while (it.hasNext()) {
        try {
          Statement formatResourceStatement = (Statement) it.next();
          InstanceFormat format = (InstanceFormat) InstanceFormat.parse(this._source, formatResourceStatement.getSubject(), this);
          if (!this._all.containsKey(format.getIdentifier())) addInstanceFormat(format);
        } catch (ParsingException e) {
          gather(e);
        } catch (UnresolvableException u) {
          gather(u);
        }
      }
      it.close();

      it = conn.getStatements((Resource) null, FresnelCore.classFormatDomain, (Value) null, false);
      while (it.hasNext()) {
        try {
          Statement formatResourceStatement = (Statement) it.next();
          ClassFormat format = (ClassFormat) ClassFormat.parse(this._source, formatResourceStatement.getSubject(), this);
          if (!this._all.containsKey(format.getIdentifier())) addClassFormat(format);
        } catch (ParsingException e) {
          gather(e);
        } catch (UnresolvableException u) {
          gather(u);
        }
View Full Code Here

    // RESOURCES
    // execute every format for pre-selection, make a formatMatch for every resource
    // that gets selected.  keep adding to the lensMatch per resource until all
    // matches are found (all formats are executed).
    Iterator<Format> fi = grouping.getFormats().iterator();
    Format defaultFormat = new Format(DEFAULT_FORMAT);
    while (fi.hasNext()) {
      Format format = fi.next();
     
      Iterator<ISelector> di = format.getDomainSet().iterator();
      while (di.hasNext()) {
        ISelector selects = di.next();
        if (selects.canSelectResources()) {
          /*
           * Only ClassFormat and InstanceFormat select resources,
View Full Code Here

   * @return A <code>Format</code>
   * @throws ParsingException If there are parsing errors in making a new format
   * @throws UnresolvableException If there are unresolvable errors in making a new format
   */
  public Format formatLookup(Resource identifier) throws ParsingException, UnresolvableException, ResourceNotFoundException {
    Format out = null;
    if (this._all.containsKey(identifier) && this._formats.contains(this._all.get(identifier)))
      out = (Format) this._all.get(identifier);
    else {
      try {
        RepositoryConnection conn = this._source.getConnection();
View Full Code Here

   * Returns the top ranked match for the resource amongst all applicable formats
   *
   * @return A matching <code>Format</code>
   */
  public Format topMatch() {
    Format out = null;
    if (this._properties.size() > 0) out = (Format) this._properties.get(0);
    return out;
  }
View Full Code Here

            if (pd.isGroupUse()) {
              // pick which format to use...
              Group groupFormats = (Group) pd.getUse();
              Iterator<Format> fi = groupFormats.getFormats().iterator();
              while (fi.hasNext()) {
                Format potential = fi.next();
                for (Iterator<ISelector> di = potential.getDomainSet().iterator(); di.hasNext(); ) {
                  ISelector potentialCheck = di.next();
                  if (potentialCheck.canSelect(getModel(), r.getParent().getOrigin(), r.getOrigin())) {
                    format = potential;
                    break;
                  }
View Full Code Here

   * Returns the top ranked match for the resource amongst all applicable formats
   *
   * @return A matching <code>Format</code>
   */
  public Format topMatch() {
    Format out = null;
    if (this._instances.size() > 0) out = (Format) this._instances.get(0);
    else if (this._types.size() > 0) out = (Format) this._types.get(0);     
    return out;
  }
View Full Code Here

TOP

Related Classes of edu.mit.simile.fresnel.format.Format

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.