Package javax.xml.xquery

Examples of javax.xml.xquery.XQItemType


    public boolean equals(Object obj) {
        if(!(obj instanceof XQItemType)) {
            return false;
        }
        // getItemKind() is equal
        XQItemType objtype = (XQItemType) obj;
        int kind = getItemKind(), thatkind = objtype.getItemKind();
        if(kind != thatkind) {
            return false;
        }
        // if getBaseType() is supported for the item kind, it must be equal
        try {
            final int basetype = getBaseType(), thatBaseType = objtype.getBaseType();
            if(basetype != thatBaseType) {
                return false;
            }
        } catch (XQException e) {
        }
        // if getNodeName() is supported for the item kind, it must be equal
        try {
            final QName nodeName = getNodeName(), thatNodeName = objtype.getNodeName();
            if(nodeName == null) {
                if(thatNodeName != null) {
                    return false;
                }
            } else if(!nodeName.equals(thatNodeName)) {
                return false;
            }
        } catch (XQException e) {
        }
        // getSchemaURI() is equal
        final URI uri = getSchemaURI(), thatUri = objtype.getSchemaURI();
        if(uri == null) {
            if(thatUri != null) {
                return false;
            }
        } else if(!uri.equals(thatUri)) {
            return false;
        }
        // if getTypeName() is supported for the item kind, it must be equal
        try {
            final QName typeName = getTypeName(), thatTypeName = objtype.getTypeName();
            if(typeName == null) {
                if(thatTypeName != null) {
                    return false;
                }
            } else if(!typeName.equals(thatTypeName)) {
                return false;
            }
        } catch (XQException e) {
        }
        // isAnonymousType() is equal
        final boolean isAnon = isAnonymousType(), thatIsAnon = objtype.isAnonymousType();
        if(isAnon != thatIsAnon) {
            return false;
        }
        // isElementNillable() is equal
        final boolean isNillable = isElementNillable(), thatIsNillable = objtype.isElementNillable();
        if(isNillable != thatIsNillable) {
            return false;
        }
        // if getPIName() is supported for the item kind, it must be equal  
        try {
            final String pi = getPIName(), thatPi = objtype.getPIName();
            if(pi == null) {
                if(thatPi != null) {
                    return false;
                }
            } else if(!pi.equals(thatPi)) {
View Full Code Here


     * @return type
     *
     * @throws XQException XQException
     */
    private Object getItemValue(XQItem item) throws XQException {
        XQItemType itemType = item.getItemType();
        Object itemValue = null;

        switch (itemType.getBaseType()) {
        case XQItemType.XQBASETYPE_BOOLEAN:
            itemValue = item.getBoolean();

            break;

View Full Code Here

        } else if (value instanceof String) {
            xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_STRING);
        } else if (value instanceof Node) {
          xqType = xqconn.createNodeType();
        } else if (value instanceof NodeList || value instanceof XQSequence) {
            XQItemType xqItemType = xqconn.createNodeType();
            xqType = xqconn.createSequenceType(xqItemType, XQSequenceType.OCC_ZERO_OR_MORE);
        }
        return xqType;
    }
View Full Code Here

     * @return type
     *
     * @throws XQException XQException
     */
    private Object getItemValue(XQItem item) throws XQException {
        XQItemType itemType = item.getItemType();
        Object itemValue = null;

        switch (itemType.getBaseType()) {
        case XQItemType.XQBASETYPE_BOOLEAN:
            itemValue = item.getBoolean();

            break;

View Full Code Here

        } else if (value instanceof Byte) {
            xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BYTE);
        } else if (value instanceof Node) {
            xqType = xqconn.createNodeType();
        } else if (value instanceof NodeList || value instanceof XQSequence) {
            XQItemType xqItemType = xqconn.createNodeType();
            xqType = xqconn.createSequenceType(xqItemType, XQSequenceType.OCC_ZERO_OR_MORE);
        }
        return xqType;
    }
View Full Code Here

     * @return type
     *
     * @throws XQException XQException
     */
    private Object getItemValue(XQItem item) throws XQException {
        XQItemType itemType = item.getItemType();
        Object itemValue = null;

        switch (itemType.getBaseType()) {
        case XQItemType.XQBASETYPE_BOOLEAN:
            itemValue = item.getBoolean();

            break;

View Full Code Here

        } else if (value instanceof Byte) {
          xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BYTE);
        } else if (value instanceof Node) {
          xqType = xqconn.createNodeType();
        } else if (value instanceof NodeList || value instanceof XQSequence) {
            XQItemType xqItemType = xqconn.createNodeType();
            xqType = xqconn.createSequenceType(xqItemType, XQSequenceType.OCC_ZERO_OR_MORE);
        }
        return xqType;
    }
View Full Code Here

     * @return type
     *
     * @throws XQException XQException
     */
    private Object getItemValue(XQItem item) throws XQException {
        XQItemType itemType = item.getItemType();
        Object itemValue = null;

        switch (itemType.getBaseType()) {
        case XQItemType.XQBASETYPE_BOOLEAN:
            itemValue = item.getBoolean();

            break;

View Full Code Here

        } else if (value instanceof Byte) {
          xqType = xqconn.createAtomicType(XQItemType.XQBASETYPE_BYTE);
        } else if (value instanceof Node) {
          xqType = xqconn.createNodeType();
        } else if (value instanceof NodeList || value instanceof XQSequence) {
            XQItemType xqItemType = xqconn.createNodeType();
            xqType = xqconn.createSequenceType(xqItemType, XQSequenceType.OCC_ZERO_OR_MORE);
        }
        return xqType;
    }
View Full Code Here

  public List<String> mapResults(XQResultSequence result) {
    List<String> results = new ArrayList<String>();
    try {
      while(result.next()) {
        XQItemType type = result.getItemType();
        String value = convertToString(type, result);
        if(value == null) {
          Number number = convertToNumber(type, result);
          if(number == null) {
            Boolean boolValue = convertToBoolean(type, result);
View Full Code Here

TOP

Related Classes of javax.xml.xquery.XQItemType

Copyright © 2018 www.massapicom. 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.