Package org.apache.cxf.staxutils

Examples of org.apache.cxf.staxutils.DocumentDepthProperties


                                                            inAppendMap,
                                                            true);
    }
   
    protected XMLStreamReader createDepthReaderIfNeeded(XMLStreamReader reader, InputStream is) {
        DocumentDepthProperties props = getDepthProperties();
        if (props != null && props.isEffective()) {
            reader = TransformUtils.createNewReaderIfNeeded(reader, is);
            return new DepthRestrictingStreamReader(reader, props);
        }
        return reader;
    }
View Full Code Here


                    int totalElementCount = totalElementCountStr != null
                        ? Integer.valueOf(totalElementCountStr) : -1;
                    int elementLevel = elementLevelStr != null ? Integer.valueOf(elementLevelStr) : -1;
                    int innerElementCount = innerElementCountStr != null
                        ? Integer.valueOf(innerElementCountStr) : -1;
                    return new DocumentDepthProperties(totalElementCount, elementLevel, innerElementCount);
                } catch (Exception ex) {
                    throw new InternalServerErrorException(ex);
                }
            }
        }
View Full Code Here

    @SuppressWarnings({ "unchecked", "rawtypes" })
    protected JAXBElementProvider defaultJAXBProvider() {
        JAXBElementProvider defaultJAXBProvider = new JAXBElementProvider();

        DocumentDepthProperties depthProperties = new DocumentDepthProperties();
        depthProperties.setInnerElementCountThreshold(500);
        defaultJAXBProvider.setDepthProperties(depthProperties);

        Map marshallerProperties = new HashMap();
        marshallerProperties.put(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
        defaultJAXBProvider.setMarshallerProperties(marshallerProperties);
View Full Code Here

    public void setIgnoreEmptyArrayValues(boolean ignoreEmptyArrayElements) {
        this.ignoreEmptyArrayValues = ignoreEmptyArrayElements;
    }

    protected DocumentDepthProperties getDepthProperties() {
        DocumentDepthProperties depthProperties = super.getDepthProperties();
        if (depthProperties != null) {
            return depthProperties;
        }
        if (getContext() != null) {
            String totalElementCountStr = (String)getContext().getContextualProperty(
                DocumentDepthProperties.TOTAL_ELEMENT_COUNT);
            String innerElementCountStr = (String)getContext().getContextualProperty(
                DocumentDepthProperties.INNER_ELEMENT_COUNT);
            String elementLevelStr = (String)getContext().getContextualProperty(
                DocumentDepthProperties.INNER_ELEMENT_LEVEL);
            if (totalElementCountStr != null || innerElementCountStr != null || elementLevelStr != null) {
                try {
                    int totalElementCount = totalElementCountStr != null
                        ? Integer.valueOf(totalElementCountStr) : -1;
                    int elementLevel = elementLevelStr != null ? Integer.valueOf(elementLevelStr) : -1;
                    int innerElementCount = innerElementCountStr != null
                        ? Integer.valueOf(innerElementCountStr) : -1;
                    return new DocumentDepthProperties(totalElementCount, elementLevel, innerElementCount);
                } catch (Exception ex) {
                    throw ExceptionUtils.toInternalServerErrorException(ex, null);
                }
            }
        }
View Full Code Here

                                                            inAppendMap,
                                                            true);
    }
   
    protected XMLStreamReader createDepthReaderIfNeeded(XMLStreamReader reader, InputStream is) {
        DocumentDepthProperties props = getDepthProperties();
        if (props != null && props.isEffective()) {
            reader = TransformUtils.createNewReaderIfNeeded(reader, is);
            return new DepthRestrictingStreamReader(reader, props);
        }
        return reader;
    }
View Full Code Here

                    int totalElementCount = totalElementCountStr != null
                        ? Integer.valueOf(totalElementCountStr) : -1;
                    int elementLevel = elementLevelStr != null ? Integer.valueOf(elementLevelStr) : -1;
                    int innerElementCount = innerElementCountStr != null
                        ? Integer.valueOf(innerElementCountStr) : -1;
                    return new DocumentDepthProperties(totalElementCount, elementLevel, innerElementCount);
                } catch (Exception ex) {
                    throw new InternalServerErrorException(ex);
                }
            }
        }
View Full Code Here

                                                            inAppendMap,
                                                            true);
    }
   
    protected XMLStreamReader createDepthReaderIfNeeded(XMLStreamReader reader, InputStream is) {
        DocumentDepthProperties props = getDepthProperties();
        if (props != null && props.isEffective()) {
            reader = TransformUtils.createNewReaderIfNeeded(reader, is);
            return new DepthRestrictingStreamReader(reader, props);
        }
        return reader;
    }
View Full Code Here

                    int totalElementCount = totalElementCountStr != null
                        ? Integer.valueOf(totalElementCountStr) : -1;
                    int elementLevel = elementLevelStr != null ? Integer.valueOf(elementLevelStr) : -1;
                    int innerElementCount = innerElementCountStr != null
                        ? Integer.valueOf(innerElementCountStr) : -1;
                    return new DocumentDepthProperties(totalElementCount, elementLevel, innerElementCount);
                } catch (Exception ex) {
                    throw ExceptionUtils.toInternalServerErrorException(ex, null);
                }
            }
        }
View Full Code Here

                                                            inAppendMap,
                                                            true);
    }
   
    protected XMLStreamReader createDepthReaderIfNeeded(XMLStreamReader reader, InputStream is) {
        DocumentDepthProperties props = getDepthProperties();
        if (props != null && props.isEffective()) {
            reader = TransformUtils.createNewReaderIfNeeded(reader, is);
            reader = new DepthRestrictingStreamReader(reader, props);
        } else if (reader != null) {
            reader = configureReaderRestrictions(reader);
        }
View Full Code Here

                                                            inAppendMap,
                                                            true);
    }
   
    protected XMLStreamReader createDepthReaderIfNeeded(XMLStreamReader reader, InputStream is) {
        DocumentDepthProperties props = getDepthProperties();
        if (props != null && props.isEffective()) {
            reader = TransformUtils.createNewReaderIfNeeded(reader, is);
            return new DepthRestrictingStreamReader(reader, props);
        }
        return reader;
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.staxutils.DocumentDepthProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.