javax.xml.stream.XMLStreamReader.getProperty()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(96)

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

XMLStreamReader.getProperty介绍

[英]Get the value of a feature/property from the underlying implementation
[中]从底层实现获取功能/属性的值

代码示例

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

public Object getProperty(final String name) throws IllegalArgumentException {
    return xmlStreamReader.getProperty(name);
  }
}

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

private static boolean getBoolProp(XMLStreamReader r, String n) {
  try {
    Object o = r.getProperty(n);
    if(o instanceof Boolean)    return (Boolean)o;
    return false;
  } catch (Exception e) {
    // be defensive against broken StAX parsers since javadoc is not clear
    // about when an error happens
    return false;
  }
}

代码示例来源:origin: plutext/docx4j

@Override
public Object getProperty(String name) throws IllegalArgumentException {
  return underlying.getProperty(name);
}

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

private static boolean checkImplementaionNameOfSjsxp(XMLStreamReader reader) {
  try {
    Object name = reader.getProperty("http://java.sun.com/xml/stream/properties/implementation-name");
    return name!=null && name.equals("sjsxp");
  } catch (Exception e) {
    // be defensive against broken StAX parsers since javadoc is not clear
    // about when an error happens
    return false;
  }
}

代码示例来源:origin: org.apache.xmlbeans/xmlbeans

public Object getProperty(String s)
  throws IllegalArgumentException
{
  return _xmlStream.getProperty(s);
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

private static boolean getBoolProp(XMLStreamReader r, String n) {
  try {
    Object o = r.getProperty(n);
    if(o instanceof Boolean)    return (Boolean)o;
    return false;
  } catch (Exception e) {
    // be defensive against broken StAX parsers since javadoc is not clear
    // about when an error happens
    return false;
  }
}

代码示例来源:origin: org.glassfish.jaxb/jaxb-runtime

private static boolean checkImplementaionNameOfSjsxp(XMLStreamReader reader) {
  try {
    Object name = reader.getProperty("http://java.sun.com/xml/stream/properties/implementation-name");
    return name!=null && name.equals("sjsxp");
  } catch (Exception e) {
    // be defensive against broken StAX parsers since javadoc is not clear
    // about when an error happens
    return false;
  }
}

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-api

@Override
  protected String getDocumentTypeDeclaration(XMLStreamReader reader) {
    return (String)reader.getProperty("javax.xml.stream.dtd.declaration");
  }
};

代码示例来源:origin: com.sun.xml.stream/sjsxp

/**
 *
 * @param name
 * @throws IllegalArgumentException
 * @return
 */
public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
  return fStreamReader.getProperty(name);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl

private static boolean getBoolProp(XMLStreamReader r, String n) {
  try {
    Object o = r.getProperty(n);
    if(o instanceof Boolean)    return (Boolean)o;
    return false;
  } catch (Exception e) {
    // be defensive against broken StAX parsers since javadoc is not clear
    // about when an error happens
    return false;
  }
}

代码示例来源:origin: apache/cxf

public static boolean isSecureReader(XMLStreamReader reader, Message message) {
  if (reader instanceof DocumentDepthProperties) {
    return true;
  }
  try {
    if (reader.getProperty("com.ctc.wstx.maxChildrenPerElement") != null) {
      return true;
    }
  } catch (Exception ex) {
    //ignore
  }
  return false;
}

代码示例来源:origin: com.sun.xml.stream/sjsxp

/** Get the value of a feature/property from the underlying implementation
 * @param name The name of the property
 * @return The value of the property
 * @throws IllegalArgumentException if the property is not supported
 */
public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
  return fXMLReader.getProperty(name) ;
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/** Get the value of a feature/property from the underlying implementation
 * @param name The name of the property
 * @return The value of the property
 * @throws IllegalArgumentException if the property is not supported
 */
public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
  return fXMLReader.getProperty(name) ;
}

代码示例来源:origin: com.sun.xml.parsers/jaxp-ri

/**
 *
 * @param name
 * @throws IllegalArgumentException
 * @return
 */
public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
  return fStreamReader.getProperty(name);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

/**
 * @param key
 * @throws IllegalArgumentException
 */
public Object getProperty(String key) throws IllegalArgumentException {
  if (reader != null) {
    return reader.getProperty(key);
  }
  return null;
}

代码示例来源:origin: org.apache.xmlbeans/com.springsource.org.apache.xmlbeans

public Object getProperty(String s)
  throws IllegalArgumentException
{
  return _xmlStream.getProperty(s);
}

代码示例来源:origin: deegree/deegree3

@Override
public Object getProperty( String name )
            throws IllegalArgumentException {
  return reader.getProperty( name );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxp-ri

/**
 *
 * @param name
 * @throws IllegalArgumentException
 * @return
 */
public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException {
  return fStreamReader.getProperty(name);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public Object getProperty(String s) throws IllegalArgumentException {
  if (isDelegating()) {
    return realReader.getProperty(s);
  } else {
    throw new IllegalArgumentException();
  }
}

代码示例来源:origin: com.sun.xml.stream/sjsxp

public XMLEventReaderImpl(XMLStreamReader reader) throws  XMLStreamException {
  fXMLReader = reader ;
  fXMLEventAllocator = (XMLEventAllocator)reader.getProperty(XMLInputFactory.ALLOCATOR);
  if(fXMLEventAllocator == null){
    fXMLEventAllocator = new XMLEventAllocatorImpl();
  }
  fPeekedEvent = fXMLEventAllocator.allocate(fXMLReader);        
}

相关文章

微信公众号

最新文章

更多