jInfer

cz.cuni.mff.ksi.jinfer.xsdimporter.utils
Class XSDOccurences

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.xsdimporter.utils.XSDOccurences

public final class XSDOccurences
extends Object

Helper class for creating intervals from string representation of occurrences.


Method Summary
static RegexpInterval createInterval(String minOccurence, String maxOccurence)
          Create interval from arguments.
static RegexpInterval createInterval(String minOccurence, String maxOccurence, boolean minHasPriority)
          Create interval from arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createInterval

public static RegexpInterval createInterval(String minOccurence,
                                            String maxOccurence)
Create interval from arguments. If any of the arguments is empty, or invalid, a default value is used. Default values of min and max occurrences are 1, as defined by XSD Schema specification. Hence, default interval is (RegexpInterval.getOnce()). In case the parsed value of lower limit exceeds the upper, both bounds of the interval are set to the upper limit value (that is the smaller of those two).

Parameters:
minOccurence - String containing the value of lower limit of occurrences, which will be parsed.
maxOccurence - String containing the value of upper limit of occurrences, which will be parsed.
Returns:
Valid interval determined by the parsed values.

createInterval

public static RegexpInterval createInterval(String minOccurence,
                                            String maxOccurence,
                                            boolean minHasPriority)
Create interval from arguments. If any of the arguments is empty, or invalid, a default value is used. Default values of min and max occurrences are 1, as defined by XSD Schema specification. This method should not throw any exceptions.

Parameters:
minOccurence - String containing the value of lower limit of occurrences, which will be parsed.
maxOccurence - String containing the value of upper limit of occurrences, which will be parsed.
minHasPriority - Set priority to either upper limit (if false) or lower limit (if true), in case the lower limit exceeds the upper.
Returns:
Valid interval determined by the parsed values.

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011