gpt4 book ai didi

org.codehaus.stax2.validation.XMLValidator.validateAttribute()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 06:33:05 28 4
gpt4 key购买 nike

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

XMLValidator.validateAttribute介绍

[英]Callback method called on validator to give it a chance to validate the value of an attribute, as well as to normalize its value if appropriate (remove leading/trailing/intervening white space for certain token types etc.).
[中]回调方法调用validator,使其有机会验证属性的值,并在适当的情况下规范化其值(删除某些令牌类型的前导/尾随/中间空白等)。

代码示例

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

protected void validateAttribute(int index, XMLValidator vld)
  throws XMLStreamException
{
  Attribute attr = mAttributes[index];
  String normValue = vld.validateAttribute
    (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix,
     mValueBuilder.getCharBuffer(),
     getValueStartOffset(index),
     getValueStartOffset(index+1));
  if (normValue != null) {
    attr.setValue(normValue);
  }
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

mValidator.validateAttribute(localName, XmlConsts.ATTR_NO_NS_URI, XmlConsts.ATTR_NO_PREFIX, value);

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

protected final void doWriteAttr(String localName, String nsURI, String prefix,
                 char[] buf, int start, int len)
  throws XMLStreamException
{
  if (mCheckAttrs) { // still need to ensure no duplicate attrs?
    mCurrElem.checkAttrWrite(nsURI, localName);
  }
  if (mValidator != null) {
    /* No need to get it normalized... even if validator does normalize
     * it, we don't use that for anything
     */
    mValidator.validateAttribute(localName, nsURI, prefix, buf, start, len);
  }
  try {
    if (prefix != null && prefix.length() > 0) {
      mWriter.writeAttribute(prefix, localName, buf, start, len);
    } else {
      mWriter.writeAttribute(localName, buf, start, len);
    }
  } catch (IOException ioe) {
    throw new WstxIOException(ioe);
  }
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

mValidator.validateAttribute(localName, nsURI, prefix, value);

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

validator.validateAttribute(localName, nsURI, prefix, mOutputBuffer, start, mOutputPtr);
  return;
validator.validateAttribute(localName, nsURI, prefix, valueStr);

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-asl

writeRawAscii(copyBuffer, 0, last);
if (enc.isCompleted()) {
  validator.validateAttribute(localName, nsURI, prefix, copyBuffer, 0, last);
  return;
validator.validateAttribute(localName, nsURI, prefix, valueStr);

代码示例来源:origin: woodstox/wstx-asl

public String validateAttribute(String localName, String uri,
                String prefix, String value)
  throws XMLValidationException
{
  String retVal =  mFirst.validateAttribute(localName, uri, prefix,
                       value);
  if (retVal != null) {
    value = retVal;
  }
  return mSecond.validateAttribute(localName, uri, prefix, value);
}

代码示例来源:origin: Nextdoor/bender

public String validateAttribute(String localName, String uri,
                String prefix, String value)
  throws XMLStreamException
{
  String retVal =  mFirst.validateAttribute(localName, uri, prefix,
                       value);
  if (retVal != null) {
    value = retVal;
  }
  return mSecond.validateAttribute(localName, uri, prefix, value);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox

public String validateAttribute(String localName, String uri,
                String prefix, String value)
  throws XMLValidationException
{
  String retVal =  mFirst.validateAttribute(localName, uri, prefix,
                       value);
  if (retVal != null) {
    value = retVal;
  }
  return mSecond.validateAttribute(localName, uri, prefix, value);
}

代码示例来源:origin: woodstox/wstx-lgpl

public String validateAttribute(String localName, String uri,
                String prefix, String value)
  throws XMLValidationException
{
  String retVal =  mFirst.validateAttribute(localName, uri, prefix,
                       value);
  if (retVal != null) {
    value = retVal;
  }
  return mSecond.validateAttribute(localName, uri, prefix, value);
}

代码示例来源:origin: woodstox/wstx-asl

public String validateAttribute(String localName, String uri,
                String prefix,
                char[] valueChars, int valueStart,
                int valueEnd)
  throws XMLValidationException
{
  String retVal =  mFirst.validateAttribute(localName, uri, prefix,
                       valueChars, valueStart, valueEnd);
  /* If it got normalized, let's pass normalized value to the second
   * validator
   */
  if (retVal != null) {
    return mSecond.validateAttribute(localName, uri, prefix, retVal);
  }
  // Otherwise the original
  return mSecond.validateAttribute(localName, uri, prefix,
                   valueChars, valueStart, valueEnd);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox

public String validateAttribute(String localName, String uri,
                String prefix,
                char[] valueChars, int valueStart,
                int valueEnd)
  throws XMLValidationException
{
  String retVal =  mFirst.validateAttribute(localName, uri, prefix,
                       valueChars, valueStart, valueEnd);
  /* If it got normalized, let's pass normalized value to the second
   * validator
   */
  if (retVal != null) {
    return mSecond.validateAttribute(localName, uri, prefix, retVal);
  }
  // Otherwise the original
  return mSecond.validateAttribute(localName, uri, prefix,
                   valueChars, valueStart, valueEnd);
}

代码示例来源:origin: woodstox/wstx-lgpl

public String validateAttribute(String localName, String uri,
                String prefix,
                char[] valueChars, int valueStart,
                int valueEnd)
  throws XMLValidationException
{
  String retVal =  mFirst.validateAttribute(localName, uri, prefix,
                       valueChars, valueStart, valueEnd);
  /* If it got normalized, let's pass normalized value to the second
   * validator
   */
  if (retVal != null) {
    return mSecond.validateAttribute(localName, uri, prefix, retVal);
  }
  // Otherwise the original
  return mSecond.validateAttribute(localName, uri, prefix,
                   valueChars, valueStart, valueEnd);
}

代码示例来源:origin: Nextdoor/bender

public String validateAttribute(String localName, String uri,
                String prefix,
                char[] valueChars, int valueStart,
                int valueEnd)
  throws XMLStreamException
{
  String retVal =  mFirst.validateAttribute(localName, uri, prefix,
                       valueChars, valueStart, valueEnd);
  /* If it got normalized, let's pass normalized value to the second
   * validator
   */
  if (retVal != null) {
    return mSecond.validateAttribute(localName, uri, prefix, retVal);
  }
  // Otherwise the original
  return mSecond.validateAttribute(localName, uri, prefix,
                   valueChars, valueStart, valueEnd);
}

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

protected final void doWriteAttr(String localName, String nsURI, String prefix,
                 char[] buf, int start, int len)
  throws XMLStreamException
{
  if (mCheckAttrs) { // still need to ensure no duplicate attrs?
    mCurrElem.checkAttrWrite(nsURI, localName);
  }
  if (mValidator != null) {
    // No need to get it normalized... even if validator does normalize
    // it, we don't use that for anything
    mValidator.validateAttribute(localName, nsURI, prefix, buf, start, len);
  }
  try {
    if (prefix != null && prefix.length() > 0) {
      mWriter.writeAttribute(prefix, localName, buf, start, len);
    } else {
      mWriter.writeAttribute(localName, buf, start, len);
    }
  } catch (IOException ioe) {
    throw new WstxIOException(ioe);
  }
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

protected final void doWriteAttr(String localName, String nsURI, String prefix,
                 char[] buf, int start, int len)
  throws XMLStreamException
{
  if (mCheckAttrs) { // still need to ensure no duplicate attrs?
    mCurrElem.checkAttrWrite(nsURI, localName);
  }
  if (mValidator != null) {
    /* No need to get it normalized... even if validator does normalize
     * it, we don't use that for anything
     */
    mValidator.validateAttribute(localName, nsURI, prefix, buf, start, len);
  }
  try {
    if (prefix != null && prefix.length() > 0) {
      mWriter.writeAttribute(prefix, localName, buf, start, len);
    } else {
      mWriter.writeAttribute(localName, buf, start, len);
    }
  } catch (IOException ioe) {
    throw new WstxIOException(ioe);
  }
}

代码示例来源:origin: FasterXML/woodstox

protected void validateAttribute(int index, XMLValidator vld)
  throws XMLStreamException
{
  Attribute attr = mAttributes[index];
  String normValue = vld.validateAttribute
    (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix,
     mValueBuilder.getCharBuffer(),
     getValueStartOffset(index),
     getValueStartOffset(index+1));
  if (normValue != null) {
    attr.setValue(normValue);
  }
}

代码示例来源:origin: org.codehaus.woodstox/woodstox-core-lgpl

protected void validateAttribute(int index, XMLValidator vld)
  throws XMLStreamException
{
  Attribute attr = mAttributes[index];
  String normValue = vld.validateAttribute
    (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix,
     mValueBuilder.getCharBuffer(),
     getValueStartOffset(index),
     getValueStartOffset(index+1));
  if (normValue != null) {
    attr.setValue(normValue);
  }
}

代码示例来源:origin: Nextdoor/bender

protected void validateAttribute(int index, XMLValidator vld)
  throws XMLStreamException
{
  Attribute attr = mAttributes[index];
  String normValue = vld.validateAttribute
    (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix,
     mValueBuilder.getCharBuffer(),
     getValueStartOffset(index),
     getValueStartOffset(index+1));
  if (normValue != null) {
    attr.setValue(normValue);
  }
}

代码示例来源:origin: com.fasterxml.woodstox/woodstox-core

protected void validateAttribute(int index, XMLValidator vld)
  throws XMLStreamException
{
  Attribute attr = mAttributes[index];
  String normValue = vld.validateAttribute
    (attr.mLocalName, attr.mNamespaceURI, attr.mPrefix,
     mValueBuilder.getCharBuffer(),
     getValueStartOffset(index),
     getValueStartOffset(index+1));
  if (normValue != null) {
    attr.setValue(normValue);
  }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com