本文整理匯總了Java中javax.xml.stream.XMLInputFactory.isPropertySupported方法的典型用法代碼示例。如果您正苦於以下問題:Java XMLInputFactory.isPropertySupported方法的具體用法?Java XMLInputFactory.isPropertySupported怎麽用?Java XMLInputFactory.isPropertySupported使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.xml.stream.XMLInputFactory
的用法示例。
在下文中一共展示了XMLInputFactory.isPropertySupported方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setReportCData
import javax.xml.stream.XMLInputFactory; //導入方法依賴的package包/類
protected static boolean setReportCData(XMLInputFactory f, boolean state) throws XMLStreamException {
Boolean b = state ? Boolean.TRUE : Boolean.FALSE;
if (f.isPropertySupported(PROP_REPORT_CDATA)) {
f.setProperty(PROP_REPORT_CDATA, b);
return true;
}
return false;
}
示例2: Woodstox
import javax.xml.stream.XMLInputFactory; //導入方法依賴的package包/類
public Woodstox(XMLInputFactory xif) {
super(xif);
if (xif.isPropertySupported(P_INTERN_NSURIS)) {
xif.setProperty(P_INTERN_NSURIS, true);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, P_INTERN_NSURIS + " is {0}", true);
}
}
if (xif.isPropertySupported(P_MAX_ATTRIBUTES_PER_ELEMENT)) {
maxAttributesPerElement = Integer.valueOf(buildIntegerValue(
PROPERTY_MAX_ATTRIBUTES_PER_ELEMENT, DEFAULT_MAX_ATTRIBUTES_PER_ELEMENT)
);
xif.setProperty(P_MAX_ATTRIBUTES_PER_ELEMENT, maxAttributesPerElement);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, P_MAX_ATTRIBUTES_PER_ELEMENT + " is {0}", maxAttributesPerElement);
}
}
if (xif.isPropertySupported(P_MAX_ATTRIBUTE_SIZE)) {
maxAttributeSize = Integer.valueOf(buildIntegerValue(
PROPERTY_MAX_ATTRIBUTE_SIZE, DEFAULT_MAX_ATTRIBUTE_SIZE)
);
xif.setProperty(P_MAX_ATTRIBUTE_SIZE, maxAttributeSize);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, P_MAX_ATTRIBUTE_SIZE + " is {0}", maxAttributeSize);
}
}
if (xif.isPropertySupported(P_MAX_CHILDREN_PER_ELEMENT)) {
maxChildrenPerElement = Integer.valueOf(buildIntegerValue(
PROPERTY_MAX_CHILDREN_PER_ELEMENT, DEFAULT_MAX_CHILDREN_PER_ELEMENT)
);
xif.setProperty(P_MAX_CHILDREN_PER_ELEMENT, maxChildrenPerElement);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, P_MAX_CHILDREN_PER_ELEMENT + " is {0}", maxChildrenPerElement);
}
}
if (xif.isPropertySupported(P_MAX_ELEMENT_DEPTH)) {
maxElementDepth = Integer.valueOf(buildIntegerValue(
PROPERTY_MAX_ELEMENT_DEPTH, DEFAULT_MAX_ELEMENT_DEPTH)
);
xif.setProperty(P_MAX_ELEMENT_DEPTH, maxElementDepth);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, P_MAX_ELEMENT_DEPTH + " is {0}", maxElementDepth);
}
}
if (xif.isPropertySupported(P_MAX_ELEMENT_COUNT)) {
maxElementCount = Long.valueOf(buildLongValue(
PROPERTY_MAX_ELEMENT_COUNT, DEFAULT_MAX_ELEMENT_COUNT)
);
xif.setProperty(P_MAX_ELEMENT_COUNT, maxElementCount);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, P_MAX_ELEMENT_COUNT + " is {0}", maxElementCount);
}
}
if (xif.isPropertySupported(P_MAX_CHARACTERS)) {
maxCharacters = Long.valueOf(buildLongValue(
PROPERTY_MAX_CHARACTERS, DEFAULT_MAX_CHARACTERS)
);
xif.setProperty(P_MAX_CHARACTERS, maxCharacters);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, P_MAX_CHARACTERS + " is {0}", maxCharacters);
}
}
}