当前位置: 首页>>代码示例>>Java>>正文


Java DOMUtil.compareElement方法代码示例

本文整理汇总了Java中com.evolveum.midpoint.util.DOMUtil.compareElement方法的典型用法代码示例。如果您正苦于以下问题:Java DOMUtil.compareElement方法的具体用法?Java DOMUtil.compareElement怎么用?Java DOMUtil.compareElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.evolveum.midpoint.util.DOMUtil的用法示例。


在下文中一共展示了DOMUtil.compareElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: equalsInternal

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
@Override
	protected boolean equalsInternal(ObjectLocator leftLocator,
			ObjectLocator rightLocator, Object lhs, Object rhs) {
//		System.out.println("DomAwareEqualsStrategy: "+PrettyPrinter.prettyPrint(lhs)+"<=>"+PrettyPrinter.prettyPrint(rhs));
		if (lhs instanceof String && rhs instanceof String) {
			return DOMUtil.compareTextNodeValues((String)lhs, (String)rhs);
		} else if (lhs instanceof Element && rhs instanceof Element) {
			final Element left = (Element) lhs;
			final Element right = (Element) rhs;
			boolean result = DOMUtil.compareElement(left, right, false);
//			System.out.println("cmp: "+PrettyPrinter.prettyPrint(left)+"<=>"+PrettyPrinter.prettyPrint(right)+": "+result);
			return result;
		} else {
			return super.equalsInternal(leftLocator, rightLocator, lhs, rhs);
		}
	}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:17,代码来源:DomAwareEqualsStrategy.java

示例2: equals

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
public boolean equals(Object obj, boolean isLiteral) {
	if (this == obj)
		return true;
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	SchemaDefinitionType other = (SchemaDefinitionType) obj;
	if (schema == null) {
		if (other.schema != null)
			return false;
	} else if (!DOMUtil.compareElement(schema, other.schema, isLiteral))
		return false;
	return true;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:16,代码来源:SchemaDefinitionType.java

示例3: equalsInternal

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
@Override
	protected boolean equalsInternal(ObjectLocator leftLocator,
			ObjectLocator rightLocator, Object lhs, Object rhs) {
//		System.out.println("DomAwareEqualsStrategy: "+PrettyPrinter.prettyPrint(lhs)+"<=>"+PrettyPrinter.prettyPrint(rhs));
		if (lhs instanceof String && rhs instanceof String) {
            // this is questionable (but seems ok)
			return DOMUtil.compareTextNodeValues((String)lhs, (String)rhs);
		} else if (lhs instanceof Element && rhs instanceof Element) {
            // this is perhaps obsolete
			final Element left = (Element) lhs;
			final Element right = (Element) rhs;
			boolean result = DOMUtil.compareElement(left, right, true);
//			System.out.println("cmp: "+PrettyPrinter.prettyPrint(left)+"<=>"+PrettyPrinter.prettyPrint(right)+": "+result);
			return result;
		} else if (lhs instanceof QName && rhs instanceof QName) {
            QName l = (QName) lhs;
            QName r = (QName) rhs;
            if (!l.equals(r)) {
                return false;
            }
            return StringUtils.equals(l.getPrefix(), r.getPrefix());
        } else if (lhs instanceof ItemPathType && rhs instanceof ItemPathType) {
            // ItemPathType's equals is already working literally
            return ((ItemPathType) lhs).equals((ItemPathType) rhs);
        } else {
			return super.equalsInternal(leftLocator, rightLocator, lhs, rhs);
		}
	}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:29,代码来源:LiteralEqualsStrategy.java

示例4: equals

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
@Override
public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    SchemaXNode that = (SchemaXNode) o;

    if (schemaElement == null) {
        return that.schemaElement == null;
    }
    if (that.schemaElement == null) {
        return false;
    }
    return DOMUtil.compareElement(schemaElement, that.schemaElement, false);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:16,代码来源:SchemaXNode.java

示例5: matchComplex

import com.evolveum.midpoint.util.DOMUtil; //导入方法依赖的package包/类
private boolean matchComplex(PrismPropertyValue<?> otherValue, boolean ignoreMetadata, boolean isLiteral) {

		if (!super.equalsComplex(otherValue, ignoreMetadata, isLiteral)) {
			return false;
		}

        if (this.rawElement != null && otherValue.rawElement != null) {
        	return equalsRawElements((PrismPropertyValue<T>)otherValue);
        }

        PrismPropertyValue<T> otherProcessed = (PrismPropertyValue<T>) otherValue;
		PrismPropertyValue<T> thisProcessed = this;
		if (this.rawElement != null || otherValue.rawElement != null) {
			try {
				if (this.rawElement == null) {
					otherProcessed = parseRawElementToNewValue((PrismPropertyValue<T>) otherValue, this);
				} else if (otherValue.rawElement == null) {
					thisProcessed = parseRawElementToNewValue(this, (PrismPropertyValue<T>) otherValue);
				}
			} catch (SchemaException e) {
				// TODO: Maybe just return false?
				throw new IllegalArgumentException("Error parsing the value of property "+getParent()+" using the 'other' definition "+
						"during a compare: "+e.getMessage(),e);
			}
		}

        T otherRealValue = otherProcessed.getValue();
        T thisRealValue = thisProcessed.getValue();
        if (otherRealValue == null && thisRealValue == null) {
        	return true;
        }
        if (otherRealValue == null || thisRealValue == null) {
        	return false;
        }

		if (thisRealValue instanceof Element &&
				otherRealValue instanceof Element) {
			return DOMUtil.compareElement((Element)thisRealValue, (Element)otherRealValue, isLiteral);
		}

		if (otherRealValue instanceof Matchable && thisRealValue instanceof Matchable){
			Matchable thisMatchableValue = (Matchable) thisRealValue;
			Matchable otherMatchableValue = (Matchable) otherRealValue;
			return thisMatchableValue.match(otherMatchableValue);
		}

		return thisRealValue.equals(otherRealValue);

	}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:50,代码来源:PrismPropertyValue.java


注:本文中的com.evolveum.midpoint.util.DOMUtil.compareElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。