QualifierOr.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * CDDL HEADER START
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * The contents of this file are subject to the terms of the
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * Common Development and Distribution License, Version 1.0 only
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * (the "License"). You may not use this file except in compliance
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * with the License.
15a44745412679c30a6d022733925af70a38b715David Lawrence * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
15a44745412679c30a6d022733925af70a38b715David Lawrence * or http://www.opensolaris.org/os/licensing.
15a44745412679c30a6d022733925af70a38b715David Lawrence * See the License for the specific language governing permissions
15a44745412679c30a6d022733925af70a38b715David Lawrence * and limitations under the License.
15a44745412679c30a6d022733925af70a38b715David Lawrence * When distributing Covered Code, include this CDDL HEADER in each
15a44745412679c30a6d022733925af70a38b715David Lawrence * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * If applicable, add the following below this CDDL HEADER, with the
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * fields enclosed by brackets "[]" replaced with your own identifying
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * information: Portions Copyright [yyyy] [name of copyright owner]
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence * CDDL HEADER END
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * ident "%Z%%M% %I% %E% SMI"
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * Use is subject to license terms.
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * This qualifier type allows the logical or of two qualifier types. Care
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * must be taken that the two qualifier types are suitable. For instance
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * if 'or'ing a string and an integer may result in parseValue() returning
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff * either a String or an Integer.
f9fdb43a912a53c44627449ace57921b143eef60Michael Graffpublic class QualifierOr extends QualifierTypeImpl {
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff public QualifierOr(QualifierType typeA, QualifierType typeB) {
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff public void setQualifierTypeA(QualifierType typeA) {
ed019cabc1cc75d4412010c331876e4ae5080a4dDavid Lawrence public void setQualifierTypeB(QualifierType typeB) {
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff if (!typeA.getJavaType().equals(typeB.getJavaType())) {
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff return (objectA.equals(objectB)) ? objectA : null;
f9fdb43a912a53c44627449ace57921b143eef60Michael Graff if (!typeA.getJavaType().equals(typeB.getJavaType())) {