Changeset 7163 for FCSSimpleEndpoint


Ignore:
Timestamp:
01/17/18 15:45:23 (6 years ago)
Author:
Oliver Schonefeld
Message:
  • get rid of Contants class and move constant to QueryNode?
Location:
FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryGroup.java

    r7159 r7163  
    8383        if (minOccurs != 1) {
    8484            sb.append("@min=");
    85             if (minOccurs == Constants.OCCURS_UNBOUNDED) {
     85            if (minOccurs == QueryNode.OCCURS_UNBOUNDED) {
    8686                sb.append("*");
    8787            } else {
     
    9292        if (maxOccurs != 1) {
    9393            sb.append("@max=");
    94             if (maxOccurs == Constants.OCCURS_UNBOUNDED) {
     94            if (maxOccurs == QueryNode.OCCURS_UNBOUNDED) {
    9595                sb.append("*");
    9696            } else {
  • FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryNode.java

    r7162 r7163  
    2626 */
    2727public abstract class QueryNode {
     28    /**
     29     * Atom occurrence it not bound.
     30     */
     31    public static final int OCCURS_UNBOUNDED = -1;
    2832    protected final QueryNodeType nodeType;
    2933    protected final List<QueryNode> children;
  • FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QueryParser.java

    r7091 r7163  
    7070public class QueryParser {
    7171    private static final int[] REP_ZERO_OR_MORE =
    72             new int[] { 0, Constants.OCCURS_UNBOUNDED };
     72            new int[] { 0, QueryNode.OCCURS_UNBOUNDED };
    7373    private static final int[] REP_ONE_OR_MORE =
    74             new int[] { 1, Constants.OCCURS_UNBOUNDED };
     74            new int[] { 1, QueryNode.OCCURS_UNBOUNDED };
    7575    private static final int[] REP_ZERO_OR_ONE =
    7676            new int[] { 0, 1 };
     
    728728        int int2Idx = getChildIndex(ctx, FCSParser.INTEGER, int1Idx + 1);
    729729        int min = 0;
    730         int max = Constants.OCCURS_UNBOUNDED;
     730        int max = QueryNode.OCCURS_UNBOUNDED;
    731731        if (commaIdx != -1) {
    732732            if (int1Idx < commaIdx) {
     
    745745            max = min;
    746746        }
    747         if ((max != Constants.OCCURS_UNBOUNDED) && (min > max)) {
     747        if ((max != QueryNode.OCCURS_UNBOUNDED) && (min > max)) {
    748748            throw new ExpressionTreeBuilderException(
    749749                    "bad qualifier: min > max (" + min + " > " + max + ")");
  • FCSSimpleEndpoint/trunk/src/main/java/eu/clarin/sru/server/fcs/parser/QuerySegment.java

    r7159 r7163  
    8383        if (minOccurs != 1) {
    8484            sb.append("@min=");
    85             if (minOccurs == Constants.OCCURS_UNBOUNDED) {
     85            if (minOccurs == QueryNode.OCCURS_UNBOUNDED) {
    8686                sb.append("*");
    8787            } else {
     
    9292        if (maxOccurs != 1) {
    9393            sb.append("@max=");
    94             if (maxOccurs == Constants.OCCURS_UNBOUNDED) {
     94            if (maxOccurs == QueryNode.OCCURS_UNBOUNDED) {
    9595                sb.append("*");
    9696            } else {
Note: See TracChangeset for help on using the changeset viewer.