Examples of UnresolvableException


Examples of edu.mit.simile.fresnel.selection.UnresolvableException

    public static Style parse(Value style) throws UnresolvableException {
        Style out = new Style();
        if (style instanceof Literal) {
            out.setStyleString(((Literal) style).getLabel());
        } else {
            throw new UnresolvableException("Cannot determine what to do with style value: " + style);
        }
        return out;
    }
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.UnresolvableException

            } else if (styleRes.equals(FresnelCore.image)) {
                out.setIsImage(true);
            } else if (styleRes.equals(FresnelCore.externalLink)) {
                out.setIsLink(true);
            } else {
                throw new UnresolvableException("Cannot resolve value of fresnel:property: " + styleRes);               
            }
        } else {
            throw new UnresolvableException("Cannot resolve value of fresnel:property: " + style);
        }
        return out;
    }
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.UnresolvableException

      cssLinkI.close();

      RepositoryResult<Statement> groupPrimaries = conn.getStatements(selected, FresnelCore.primaryClasses, (Value) null, false);
      if (groupPrimaries.hasNext()) {
        Statement primaryStmt = groupPrimaries.next();
        if (groupPrimaries.hasNext()) throw new UnresolvableException("Too many fresnel:primaryClass predicates used, only one expected.");
        Value primaryObj = primaryStmt.getObject();
        if (primaryObj instanceof Resource && RDFList.isRDFList(in, (Resource) primaryObj)) {
          List primaries = new RDFList(in, (Resource) primaryObj).asJavaList();
          Iterator primaryDomains = primaries.iterator();
          while (primaryDomains.hasNext()) {
            Value domainNode = (Value) primaryDomains.next();
            ISelector domain = null;
            if (domainNode instanceof Resource) {
              // This is a type selector
              domain = new TypeSelector((Resource) domainNode);
            } else if (domainNode instanceof Literal) {
              Literal domainL = (Literal) domainNode;
              // TODO: catch bad expressions?  throw exceptions?
              if (domainL.getDatatype().equals(FresnelCoreTypes.fslSelector)) {
                domain = new FSESelector(domainL.getLabel(), _fslContext, conf.getNamespaceMap());
              } else if (domainL.getDatatype().equals(FresnelCoreTypes.sparqlSelector)) {
                domain = new SPARQLSelector(domainL.getLabel(), conf.getNamespaces());
              }                       
            } else {
              throw new ParsingException("Could not read member fresnel:primaryClass rdf:List.");                       
            }
            out.addPrimary(domain);
          }
        } else {
          throw new ParsingException("Could not read object of fresnel:primaryClass predicate, expecting an rdf:List.");
        }
      }
      groupPrimaries.close();
      conn.close();
    } catch (RepositoryException e) {
      throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
    }

    return out;
  }
View Full Code Here

Examples of org.jaxen.UnresolvableException

                                            } catch (UnsupportedEncodingException e) {
                                                String msg = "Couldn't decode the URL parameter " +
                                                        "value " + temp[1] +
                                                        " with name " + localName;
                                                log.error(msg, e);
                                                throw new UnresolvableException(
                                                        msg + e.getMessage());
                                            }
                                        }
                                    }
                                }
View Full Code Here

Examples of org.jaxen.UnresolvableException

                                            } catch (UnsupportedEncodingException e) {
                                                String msg = "Couldn't decode the URL parameter " +
                                                        "value " + temp[1] +
                                                        " with name " + localName;
                                                log.error(msg, e);
                                                throw new UnresolvableException(
                                                        msg + e.getMessage());
                                            }
                                        }
                                    }
                                }
View Full Code Here

Examples of org.jaxen.UnresolvableException

        (HttpServletRequest) pageContext.getRequest();
    Cookie[] c = hsr.getCookies();
    for (int i = 0; i < c.length; i++)
        if (c[i].getName().equals(localName))
      return c[i].getValue();
    throw new UnresolvableException("$" + prefix + ":" + localName);
      } else
    throw new UnresolvableException("$" + prefix + ":" + localName);
        }
View Full Code Here

Examples of org.jaxen.UnresolvableException

        }

  private Object notNull(Object o, String prefix, String localName)
          throws UnresolvableException {
            if (o == null) {
                throw new UnresolvableException("$" + (prefix==null?"":prefix+":") + localName);
            }
      return o;
  }
View Full Code Here

Examples of org.jaxen.UnresolvableException

                // get the iterator over the nodes and check it
                String uri = null;
                if (hasPrefix) {
                    uri = support.translateNamespacePrefixToUri(prefix);
                    if (uri == null) {
                        throw new UnresolvableException("XPath expression uses unbound namespace prefix " + prefix);
                    }
                }
                Iterator axisNodeIter = iterableAxis.namedAccessIterator(
                                contextNode, support, localName, prefix, uri);
                if (axisNodeIter == null || axisNodeIter.hasNext() == false) {
                    return Collections.EMPTY_LIST;
                }

                // convert iterator to list for predicate test
                // no need to filter as named access guarantees this
                List newNodeSet = new ArrayList();
                while (axisNodeIter.hasNext()) {
                    newNodeSet.add(axisNodeIter.next());
                }
               
                // evaluate the predicates
                return getPredicateSet().evaluatePredicates(newNodeSet, support);
               
            }
            else {
                // get the iterator over the nodes and check it
                Iterator axisNodeIter = iterableAxis.iterator(contextNode, support);
                if (axisNodeIter == null || axisNodeIter.hasNext() == false) {
                    return Collections.EMPTY_LIST;
                }

                // run through iterator, filtering using matches()
                // adding to list for predicate test
                List newNodeSet = new ArrayList(contextSize);
                while (axisNodeIter.hasNext()) {
                    Object eachAxisNode = axisNodeIter.next();
                    if (matches(eachAxisNode, support)) {
                        newNodeSet.add(eachAxisNode);
                    }
                }
               
                // evaluate the predicates
                return getPredicateSet().evaluatePredicates(newNodeSet, support);
            }
        }

        // full case
        IdentitySet unique = new IdentitySet();
        List interimSet = new ArrayList(contextSize);
        List newNodeSet = new ArrayList(contextSize);
       
        if (namedAccess) {
            String uri = null;
            if (hasPrefix) {
                uri = support.translateNamespacePrefixToUri(prefix);
                if (uri == null) {
                    throw new UnresolvableException("XPath expression uses unbound namespace prefix " + prefix);
                }
            }
            for (int i = 0; i < contextSize; ++i) {
                Object eachContextNode = contextNodeSet.get(i);
View Full Code Here

Examples of org.jaxen.UnresolvableException

        }

        if (hasPrefix) {
            myUri = contextSupport.translateNamespacePrefixToUri(this.prefix);
            if (myUri == null) {
              throw new UnresolvableException("Cannot resolve namespace prefix '"+this.prefix+"'");
            }
        }
        else if (matchesAnyName) {
            return true;
        }
View Full Code Here

Examples of org.jaxen.UnresolvableException

                // get the iterator over the nodes and check it
                String uri = null;
                if (hasPrefix) {
                    uri = support.translateNamespacePrefixToUri(prefix);
                    if (uri == null) {
                        throw new UnresolvableException("XPath expression uses unbound namespace prefix " + prefix);
                    }
                }
                Iterator axisNodeIter = iterableAxis.namedAccessIterator(
                                contextNode, support, localName, prefix, uri);
                if (axisNodeIter == null || !axisNodeIter.hasNext()) {
                    return Collections.EMPTY_LIST;
                }

                // convert iterator to list for predicate test
                // no need to filter as named access guarantees this
                List newNodeSet = new ArrayList();
                while (axisNodeIter.hasNext()) {
                    newNodeSet.add(axisNodeIter.next());
                }
               
                // evaluate the predicates
                return getPredicateSet().evaluatePredicates(newNodeSet, support);
               
            }
            else {
                // get the iterator over the nodes and check it
                Iterator axisNodeIter = iterableAxis.iterator(contextNode, support);
                if (axisNodeIter == null || !axisNodeIter.hasNext()) {
                    return Collections.EMPTY_LIST;
                }

                // run through iterator, filtering using matches()
                // adding to list for predicate test
                List newNodeSet = new ArrayList(contextSize);
                while (axisNodeIter.hasNext()) {
                    Object eachAxisNode = axisNodeIter.next();
                    if (matches(eachAxisNode, support)) {
                        newNodeSet.add(eachAxisNode);
                    }
                }
               
                // evaluate the predicates
                return getPredicateSet().evaluatePredicates(newNodeSet, support);
            }
        }

        // full case
        IdentitySet unique = new IdentitySet();
        List interimSet = new ArrayList(contextSize);
        List newNodeSet = new ArrayList(contextSize);
       
        if (namedAccess) {
            String uri = null;
            if (hasPrefix) {
                uri = support.translateNamespacePrefixToUri(prefix);
                if (uri == null) {
                    throw new UnresolvableException("XPath expression uses unbound namespace prefix " + prefix);
                }
            }
            for (int i = 0; i < contextSize; ++i) {
                Object eachContextNode = contextNodeSet.get(i);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.