Class TypeIncubator

    • Constructor Detail

      • TypeIncubator

        public TypeIncubator​(XSDatatype baseType)
    • Method Detail

      • add

        public void add​(String name,
                        String strValue,
                        boolean fixed,
                        org.relaxng.datatype.ValidationContext context)
                 throws org.relaxng.datatype.DatatypeException
        Deprecated.
        please use the addFacet method, which is better named.
        adds a facet to the type.
        Throws:
        org.relaxng.datatype.DatatypeException
      • addFacet

        public void addFacet​(String name,
                             String strValue,
                             boolean fixed,
                             org.relaxng.datatype.ValidationContext context)
                      throws org.relaxng.datatype.DatatypeException
        adds a facet to the type.
        Throws:
        org.relaxng.datatype.DatatypeException - when given facet is already specified
      • derive

        public XSDatatypeImpl derive​(String newName)
                              throws org.relaxng.datatype.DatatypeException
        Deprecated.
        Throws:
        org.relaxng.datatype.DatatypeException
      • derive

        public XSDatatypeImpl derive​(String newNameUri,
                                     String newLocalName)
                              throws org.relaxng.datatype.DatatypeException
        derives a new datatype from a datatype by facets that were set. It is completely legal to use null as the newTypeName parameter, which means the derivation of an anonymous datatype.
        Throws:
        org.relaxng.datatype.DatatypeException - DatatypeException is thrown if derivation is somehow invalid. For example, not applicable facets are applied, or enumeration has invalid values, ... things like that.
      • isFixed

        public boolean isFixed​(String facetName)
        returns true if that facet is fixed. the behavior is undefined when the specified facetName doesn't exist in this map.
      • getFacet

        public Object getFacet​(String facetName)
        gets a value of non-repeatable facet the behavior is undefined when the specified facetName doesn't exist in this map.
      • getVector

        public Vector getVector​(String facetName)
        gets a value of repeatable facet the behavior is undefined when the specified facetName doesn't exist in this map.
      • getPositiveInteger

        public int getPositiveInteger​(String facetName)
                               throws org.relaxng.datatype.DatatypeException
        gets a value of non-repeatable facet as a positive integer the behavior is undefined when the specified facetName doesn't exist in this map.
        Throws:
        org.relaxng.datatype.DatatypeException - if the parameter cannot be parsed as a positive integer
      • getNonNegativeInteger

        public int getNonNegativeInteger​(String facetName)
                                  throws org.relaxng.datatype.DatatypeException
        gets a value of non-repeatable facet as a non-negative integer the behavior is undefined when the specified facetName doesn't exist in this map.
        Throws:
        org.relaxng.datatype.DatatypeException - if the parameter cannot be parsed as a non-negative integer
      • isEmpty

        public boolean isEmpty()
        returns true if no facet is added
      • dump

        public void dump​(PrintStream out)
        dumps the contents to the given object. this method is for debug use only.
      • getFacetNames

        public String getFacetNames()
        gets names of the facets in this object this method is used to produce error messages.