org.relaxng.datatype.Datatype.sameValue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中org.relaxng.datatype.Datatype.sameValue()方法的一些代码示例,展示了Datatype.sameValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Datatype.sameValue()方法的具体详情如下:
包路径:org.relaxng.datatype.Datatype
类名称:Datatype
方法名:sameValue

Datatype.sameValue介绍

[英]Tests the equality of two value objects which were originally created by the createValue method of this object. The behavior is undefined if objects not created by this type are passed. It is the caller's responsibility to ensure that value objects belong to this type.
[中]测试最初由该对象的createValue方法创建的两个值对象的相等性。如果传递的对象不是由该类型创建的,则该行为是未定义的。调用者负责确保值对象属于此类型。

代码示例

代码示例来源:origin: org.daisy.libs/jing

public boolean equals(Object obj) {
  if (!(obj instanceof DatatypeValue))
   return false;
  DatatypeValue other = (DatatypeValue)obj;
  if (other.dt != dt)
   return false;
  return dt.sameValue(value, other.value);
 }
}

代码示例来源:origin: com.thaiopensource/jing

public boolean equals(Object obj) {
  if (!(obj instanceof DatatypeValue))
   return false;
  DatatypeValue other = (DatatypeValue)obj;
  if (other.dt != dt)
   return false;
  return dt.sameValue(value, other.value);
 }
}

代码示例来源:origin: com.sun.xml.bind/jaxb-extra-osgi

public boolean equals( Object o ) {
  if (o == null) return false;
  // Note that equals method of this class *can* be sloppy, 
  // since this class does not have a pattern as its child.
  
  // Therefore datatype vocaburary does not necessarily provide
  // strict equals method.
  if(o.getClass()!=this.getClass())    return false;
  
  ValueExp rhs = (ValueExp)o;
  
  if(!rhs.dt.equals(dt))                return false;
  
  return dt.sameValue(value,rhs.value);
}

代码示例来源:origin: com.thaiopensource/jing

boolean samePattern(Pattern other) {
 if (getClass() != other.getClass())
  return false;
 if (!(other instanceof ValuePattern))
  return false;
 return (dt.equals(((ValuePattern)other).dt)
   && dt.sameValue(obj, ((ValuePattern)other).obj));
}

代码示例来源:origin: msv/msv

public boolean equals( Object o ) {
  // Note that equals method of this class *can* be sloppy, 
  // since this class does not have a pattern as its child.
  
  // Therefore datatype vocaburary does not necessarily provide
  // strict equals method.
  if(o.getClass()!=this.getClass())    return false;
  
  ValueExp rhs = (ValueExp)o;
  
  if(!rhs.dt.equals(dt))                return false;
  
  return dt.sameValue(value,rhs.value);
}

代码示例来源:origin: org.kohsuke.rngom/rngom

boolean samePattern(Pattern other) {
 if (getClass() != other.getClass())
  return false;
 if (!(other instanceof ValuePattern))
  return false;
 return (dt.equals(((ValuePattern)other).dt)
   && dt.sameValue(obj, ((ValuePattern)other).obj));
}

代码示例来源:origin: com.sun.xml.bind/jaxb1-impl

public boolean equals( Object o ) {
  // Note that equals method of this class *can* be sloppy, 
  // since this class does not have a pattern as its child.
  
  // Therefore datatype vocaburary does not necessarily provide
  // strict equals method.
  if(o.getClass()!=this.getClass())    return false;
  
  ValueExp rhs = (ValueExp)o;
  
  if(!rhs.dt.equals(dt))                return false;
  
  return dt.sameValue(value,rhs.value);
}

代码示例来源:origin: sun-jaxb/jaxb-xjc

boolean samePattern(Pattern other) {
 if (getClass() != other.getClass())
  return false;
 if (!(other instanceof ValuePattern))
  return false;
 return (dt.equals(((ValuePattern)other).dt)
   && dt.sameValue(obj, ((ValuePattern)other).obj));
}

代码示例来源:origin: kohsuke/msv

public boolean equals( Object o ) {
  if (o == null) return false;
  // Note that equals method of this class *can* be sloppy,
  // since this class does not have a pattern as its child.
  // Therefore datatype vocaburary does not necessarily provide
  // strict equals method.
  if(o.getClass()!=this.getClass())    return false;
  ValueExp rhs = (ValueExp)o;
  if(!rhs.dt.equals(dt))                return false;
  return dt.sameValue(value,rhs.value);
}

代码示例来源:origin: org.daisy.libs/jing

boolean samePattern(Pattern other) {
 if (getClass() != other.getClass())
  return false;
 if (!(other instanceof ValuePattern))
  return false;
 return (dt.equals(((ValuePattern)other).dt)
   && dt.sameValue(obj, ((ValuePattern)other).obj));
}

代码示例来源:origin: kohsuke/msv

public void onValue( ValueExp exp ) {
  String text;
  if( exp.dt instanceof XSDatatype ) {
    XSDatatype xsd = (XSDatatype)exp.dt;
    text = xsd.convertToLexicalValue(exp.value,getContext());
  } else {
    text = exp.value.toString();
    if(!exp.dt.sameValue( exp.value, exp.dt.createValue(text,getContext()) ) )
      throw new Error("unable to produce a value for the datatype:"+exp.name);
  }
  
  node.appendChild( domDoc.createTextNode(text) );
  return;
}
public void onData( DataExp exp ) {

代码示例来源:origin: com.sun.xml.bind/jaxb-extra-osgi

public boolean match(ValueExp exp) {
  Object thisValue = exp.dt.createValue(literal, context);
  if (!exp.dt.sameValue(thisValue, exp.value))
    return false;
  // this type accepts me.
  if (refType != null)
    assignType(exp.dt);
  // if the type has ID semantics, report it.
  if (exp.dt.getIdType() != Datatype.ID_TYPE_NULL && context != null)
    // context can be legally null when this datatype is not context dependent.
    context.onID(exp.dt, this);
  return true;
}

代码示例来源:origin: com.sun.xml.bind/jaxb1-impl

public boolean match(ValueExp exp) {
  Object thisValue = exp.dt.createValue(literal, context);
  if (!exp.dt.sameValue(thisValue, exp.value))
    return false;
  // this type accepts me.
  if (refType != null)
    assignType(exp.dt);
  // if the type has ID semantics, report it.
  if (exp.dt.getIdType() != Datatype.ID_TYPE_NULL && context != null)
    // context can be legally null when this datatype is not context dependent.
    context.onID(exp.dt, this);
  return true;
}

代码示例来源:origin: msv/msv

public boolean match(ValueExp exp) {
  Object thisValue = exp.dt.createValue(literal, context);
  if (!exp.dt.sameValue(thisValue, exp.value))
    return false;
  // this type accepts me.
  if (refType != null)
    assignType(exp.dt);
  // if the type has ID semantics, report it.
  if (exp.dt.getIdType() != Datatype.ID_TYPE_NULL && context != null)
    // context can be legally null when this datatype is not context dependent.
    context.onID(exp.dt, this);
  return true;
}

代码示例来源:origin: kohsuke/msv

public boolean match(ValueExp exp) {
  Object thisValue = exp.dt.createValue(literal, context);
  if (!exp.dt.sameValue(thisValue, exp.value))
    return false;
  // this type accepts me.
  if (refType != null)
    assignType(exp.dt);
  // if the type has ID semantics, report it.
  if (exp.dt.getIdType() != Datatype.ID_TYPE_NULL && context != null)
    // context can be legally null when this datatype is not context dependent.
    context.onID(exp.dt, this);
  return true;
}

代码示例来源:origin: com.sun.xml.bind/jaxb-extra-osgi

ValueExp vexp = (ValueExp)texp;
if(!vexp.dt.sameValue(vexp.value,
    vexp.dt.createValue(srt.literal,srt.context))) {

代码示例来源:origin: com.thaiopensource/jing

public Pattern caseValue(ValuePattern p) {
 Datatype dt = p.getDatatype();
 Object value = dt.createValue(str, vc);
 if (value != null && dt.sameValue(p.getValue(), value))
  return builder.makeEmpty();
 if (fail != null) {
  if (value == null) {
   try {
    dt.checkValid(str, vc);
   }
   catch (DatatypeException e) {
    fail.add(new DataDerivFailure(dt, p.getDatatypeName(), e));
   }
  }
  else
   fail.add(new DataDerivFailure(p));
 }
 return builder.makeNotAllowed();
}

代码示例来源:origin: msv/msv

ValueExp vexp = (ValueExp)texp;
if(!vexp.dt.sameValue(vexp.value,
    vexp.dt.createValue(srt.literal,srt.context))) {

代码示例来源:origin: com.sun.xml.bind/jaxb1-impl

ValueExp vexp = (ValueExp)texp;
if(!vexp.dt.sameValue(vexp.value,
    vexp.dt.createValue(srt.literal,srt.context))) {

代码示例来源:origin: org.daisy.libs/jing

public Pattern caseValue(ValuePattern p) {
 Datatype dt = p.getDatatype();
 Object value = dt.createValue(str, vc);
 if (value != null && dt.sameValue(p.getValue(), value))
  return builder.makeEmpty();
 if (fail != null) {
  if (value == null) {
   try {
    dt.checkValid(str, vc);
   }
   catch (DatatypeException e) {
    fail.add(new DataDerivFailure(dt, p.getDatatypeName(), e));
   }
  }
  else
   fail.add(new DataDerivFailure(p));
 }
 return builder.makeNotAllowed();
}

相关文章