Examples of FieldIndexOutOfBoundsException


Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

      public Object resolveAsObject(String fieldName, int[] arrayPos)
          throws FieldIndexOutOfBoundsException {
        if (fieldName.equals("number")) {
          return 5;
        } else {
          throw new FieldIndexOutOfBoundsException(fieldName,
              arrayPos, 0);
        }
      }
    };
View Full Code Here

Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

      private int[] numberArray = { 0, 1, 2, 3, 4, 5 };

      public Object resolveAsObject(String fieldName, int[] arrayPos)
          throws FieldIndexOutOfBoundsException {
        if (arrayPos[0] == numberArray.length) {
          throw new FieldIndexOutOfBoundsException(fieldName,
              arrayPos, 0);
        }
        return numberArray[arrayPos[0]];
      }
    };
View Full Code Here

Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

      private int[] numberArray = { 0, 1, 2, 3, 4, 5 };

      public Object resolveAsObject(String fieldName, int[] arrayPos)
          throws FieldIndexOutOfBoundsException {
        if (arrayPos[0] == numberArray.length) {
          throw new FieldIndexOutOfBoundsException(fieldName,
              arrayPos, 0);
        }
        return numberArray[arrayPos[0]];
      }
    };
View Full Code Here

Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

      private int[] numberArray = { 4, 1, 5, 3, 0, 2 };

      public Object resolveAsObject(String fieldName, int[] arrayPos)
          throws FieldIndexOutOfBoundsException {
        if (arrayPos[0] == numberArray.length) {
          throw new FieldIndexOutOfBoundsException(fieldName,
              arrayPos, 0);
        }
        return numberArray[arrayPos[0]];
      }
    };
View Full Code Here

Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

      private int[] numberArray = { 4, 1, 5, 3, 0, 2 };

      public Object resolveAsObject(String fieldName, int[] arrayPos)
          throws FieldIndexOutOfBoundsException {
        if (arrayPos[0] == numberArray.length) {
          throw new FieldIndexOutOfBoundsException(fieldName,
              arrayPos, 0);
        }
        return numberArray[arrayPos[0]];
      }
    };
View Full Code Here

Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

      private int[] numberArray = { 4, 1, 10, 15 };

      public Object resolveAsObject(String fieldName, int[] arrayPos)
          throws FieldIndexOutOfBoundsException {
        if (arrayPos[0] == numberArray.length) {
          throw new FieldIndexOutOfBoundsException(fieldName,
              arrayPos, 0);
        }
        return numberArray[arrayPos[0]];
      }
    };
View Full Code Here

Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

      private Object[] numberArray = { value2, value1 };

      public Object resolveAsObject(String fieldName, int[] arrayPos)
          throws FieldIndexOutOfBoundsException {
        if (arrayPos[0] == numberArray.length) {
          throw new FieldIndexOutOfBoundsException(fieldName,
              arrayPos, 0);
        }
        return numberArray[arrayPos[0]];
      }
    };
View Full Code Here

Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

    return new DataFieldResolver() {
      public Object resolveAsObject(String fieldName, int[] arrayPos)
          throws FieldIndexOutOfBoundsException {
       
        if(arrayPos[0] == outer.length) {
          throw new FieldIndexOutOfBoundsException(fieldName, arrayPos, 0);         
        } else if(arrayPos.length == 2 && arrayPos[1] == inner.length) {
          throw new FieldIndexOutOfBoundsException(fieldName, arrayPos, 1);         
        }
       
        if(fieldName.equals("outer")) {
          return outer[arrayPos[0]];
        } else {
View Full Code Here

Examples of org.apache.clerezza.templating.seedsnipe.datastructure.FieldIndexOutOfBoundsException

          throw new RuntimeException("Attempt to access virtual " +
              "property 'contains' on non-list resource");
        }
        int pos = arrayPos[0];
        if (pos >= list.size()) {
          throw new FieldIndexOutOfBoundsException(pathSections[0],arrayPos, currentDimension);
        }
        ExpandedNode listNode = new ExpandedNode(list.get(pos));
        if (pathSections.length == 1) {
          return listNode;
        }
        return listNode.getChild(Arrays.copyOfRange(pathSections, 1, pathSections.length),
            Arrays.copyOfRange(arrayPos, 1, arrayPos.length), currentDimension);
      }
     
            String fieldName = pathSections[0];
            boolean inverseResolve;
            if (fieldName.charAt(0) == '-') {
                fieldName = fieldName.substring(1);
                inverseResolve = true;
            } else {
                inverseResolve = false;
            }
      String uriString = getUriFromCuri(fieldName);
      UriRef property = new UriRef(uriString);
      List<ExpandedNode> childList = getChildList(property, inverseResolve);
      if (arrayPos.length == 0) {
        arrayPos = new int[1];
        currentDimension = 0;
        arrayPos[0] = 0;
      }
      int pos = arrayPos[0];
      if (pos >= childList.size()) {
        throw new FieldIndexOutOfBoundsException(uriString, arrayPos, currentDimension);
      }
     
      currentDimension++;
      return childList.get(pos).getChild(
          Arrays.copyOfRange(pathSections, 1, pathSections.length),
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.