286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2001-2005 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xerces.internal.impl.xs.opti;
286N/A
286N/Aimport java.io.IOException;
286N/A
286N/Aimport com.sun.org.apache.xerces.internal.impl.Constants;
286N/Aimport com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
286N/Aimport com.sun.org.apache.xerces.internal.impl.xs.SchemaSymbols;
286N/Aimport com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
286N/Aimport com.sun.org.apache.xerces.internal.util.XMLAttributesImpl;
286N/Aimport com.sun.org.apache.xerces.internal.util.XMLChar;
286N/Aimport com.sun.org.apache.xerces.internal.xni.Augmentations;
286N/Aimport com.sun.org.apache.xerces.internal.xni.NamespaceContext;
286N/Aimport com.sun.org.apache.xerces.internal.xni.QName;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLAttributes;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLLocator;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XMLString;
286N/Aimport com.sun.org.apache.xerces.internal.xni.XNIException;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
286N/Aimport org.w3c.dom.Document;
286N/A
286N/A/**
286N/A * @xerces.internal
286N/A *
286N/A * @author Rahul Srivastava, Sun Microsystems Inc.
286N/A * @author Sandy Gao, IBM
286N/A *
286N/A * @version $Id: SchemaDOMParser.java,v 1.8 2010-11-01 04:40:01 joehw Exp $
286N/A */
286N/Apublic class SchemaDOMParser extends DefaultXMLDocumentHandler {
286N/A
286N/A //
286N/A // Data
286N/A //
286N/A
286N/A /** Property identifier: error reporter. */
286N/A public static final String ERROR_REPORTER =
286N/A Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
286N/A
286N/A /** Feature identifier: generate synthetic annotations. */
286N/A public static final String GENERATE_SYNTHETIC_ANNOTATION =
286N/A Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
286N/A
286N/A // the locator containing line/column information
286N/A protected XMLLocator fLocator;
286N/A
286N/A // namespace context, needed for producing
286N/A // representations of annotations
286N/A protected NamespaceContext fNamespaceContext = null;
286N/A
286N/A SchemaDOM schemaDOM;
286N/A
286N/A XMLParserConfiguration config;
286N/A
286N/A //
286N/A // Constructors
286N/A //
286N/A
286N/A /** Default constructor. */
286N/A public SchemaDOMParser(XMLParserConfiguration config) {
286N/A this.config = config;
286N/A config.setDocumentHandler(this);
286N/A config.setDTDHandler(this);
286N/A config.setDTDContentModelHandler(this);
286N/A }
286N/A
286N/A // Reference to the current annotation element.
286N/A private ElementImpl fCurrentAnnotationElement;
286N/A // where an annotation element itself begins
286N/A // -1 means not in an annotation's scope
286N/A private int fAnnotationDepth = -1;
286N/A // Where xs:appinfo or xs:documentation starts;
286N/A // -1 means not in the scope of either of the two elements.
286N/A private int fInnerAnnotationDepth = -1;
286N/A // The current element depth
286N/A private int fDepth = -1;
286N/A // Use to report the error when characters are not allowed.
286N/A XMLErrorReporter fErrorReporter;
286N/A
286N/A // fields for generate-synthetic annotations feature
286N/A private boolean fGenerateSyntheticAnnotation = false;
286N/A private BooleanStack fHasNonSchemaAttributes = new BooleanStack();
286N/A private BooleanStack fSawAnnotation = new BooleanStack();
286N/A private XMLAttributes fEmptyAttr = new XMLAttributesImpl();
286N/A
286N/A //
286N/A // XMLDocumentHandler methods
286N/A //
286N/A
286N/A public void startDocument(XMLLocator locator, String encoding,
286N/A NamespaceContext namespaceContext, Augmentations augs)
286N/A throws XNIException {
286N/A fErrorReporter = (XMLErrorReporter)config.getProperty(ERROR_REPORTER);
286N/A fGenerateSyntheticAnnotation = config.getFeature(GENERATE_SYNTHETIC_ANNOTATION);
286N/A fHasNonSchemaAttributes.clear();
286N/A fSawAnnotation.clear();
286N/A schemaDOM = new SchemaDOM();
286N/A fCurrentAnnotationElement = null;
286N/A fAnnotationDepth = -1;
286N/A fInnerAnnotationDepth = -1;
286N/A fDepth = -1;
286N/A fLocator = locator;
286N/A fNamespaceContext = namespaceContext;
286N/A schemaDOM.setDocumentURI(locator.getExpandedSystemId());
286N/A } // startDocument(XMLLocator,String,NamespaceContext, Augmentations)
286N/A
286N/A /**
286N/A * The end of the document.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endDocument(Augmentations augs) throws XNIException {
286N/A // To debug the DOM created uncomment the line below
286N/A // schemaDOM.printDOM();
286N/A } // endDocument()
286N/A
286N/A
286N/A /**
286N/A * A comment.
286N/A *
286N/A * @param text The text in the comment.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by application to signal an error.
286N/A */
286N/A public void comment(XMLString text, Augmentations augs) throws XNIException {
286N/A if(fAnnotationDepth > -1) {
286N/A schemaDOM.comment(text);
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * A processing instruction. Processing instructions consist of a
286N/A * target name and, optionally, text data. The data is only meaningful
286N/A * to the application.
286N/A * <p>
286N/A * Typically, a processing instruction's data will contain a series
286N/A * of pseudo-attributes. These pseudo-attributes follow the form of
286N/A * element attributes but are <strong>not</strong> parsed or presented
286N/A * to the application as anything other than text. The application is
286N/A * responsible for parsing the data.
286N/A *
286N/A * @param target The target.
286N/A * @param data The data or null if none specified.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void processingInstruction(String target, XMLString data, Augmentations augs)
286N/A throws XNIException {
286N/A if (fAnnotationDepth > -1) {
286N/A schemaDOM.processingInstruction(target, data);
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * Character content.
286N/A *
286N/A * @param text The content.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void characters(XMLString text, Augmentations augs) throws XNIException {
286N/A // when it's not within xs:appinfo or xs:documentation
286N/A if (fInnerAnnotationDepth == -1 ) {
286N/A for (int i=text.offset; i<text.offset+text.length; i++) {
286N/A // and there is a non-whitespace character
286N/A if (!XMLChar.isSpace(text.ch[i])) {
286N/A // the string we saw: starting from the first non-whitespace character.
286N/A String txt = new String(text.ch, i, text.length+text.offset-i);
286N/A // report an error
286N/A fErrorReporter.reportError(fLocator,
286N/A XSMessageFormatter.SCHEMA_DOMAIN,
286N/A "s4s-elt-character",
286N/A new Object[]{txt},
286N/A XMLErrorReporter.SEVERITY_ERROR);
286N/A break;
286N/A }
286N/A }
286N/A // don't call super.characters() when it's not within one of the 2
286N/A // annotation elements: the traversers ignore them anyway. We can
286N/A // save time/memory creating the text nodes.
286N/A }
286N/A // when it's within either of the 2 elements, characters are allowed
286N/A // and we need to store them.
286N/A else {
286N/A schemaDOM.characters(text);
286N/A }
286N/A
286N/A }
286N/A
286N/A
286N/A /**
286N/A * The start of an element.
286N/A *
286N/A * @param element The name of the element.
286N/A * @param attributes The element attributes.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
286N/A throws XNIException {
286N/A
286N/A fDepth++;
286N/A // while it is true that non-whitespace character data
286N/A // may only occur in appInfo or documentation
286N/A // elements, it's certainly legal for comments and PI's to
286N/A // occur as children of annotation; we need
286N/A // to account for these here.
286N/A if (fAnnotationDepth == -1) {
286N/A if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA &&
286N/A element.localpart == SchemaSymbols.ELT_ANNOTATION) {
286N/A if (fGenerateSyntheticAnnotation) {
286N/A if (fSawAnnotation.size() > 0) {
286N/A fSawAnnotation.pop();
286N/A }
286N/A fSawAnnotation.push(true);
286N/A }
286N/A fAnnotationDepth = fDepth;
286N/A schemaDOM.startAnnotation(element, attributes, fNamespaceContext);
286N/A fCurrentAnnotationElement = schemaDOM.startElement(element, attributes,
286N/A fLocator.getLineNumber(),
286N/A fLocator.getColumnNumber(),
286N/A fLocator.getCharacterOffset());
286N/A return;
286N/A }
286N/A else if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && fGenerateSyntheticAnnotation) {
286N/A fSawAnnotation.push(false);
286N/A fHasNonSchemaAttributes.push(hasNonSchemaAttributes(element, attributes));
286N/A }
286N/A }
286N/A else if (fDepth == fAnnotationDepth + 1) {
286N/A fInnerAnnotationDepth = fDepth;
286N/A schemaDOM.startAnnotationElement(element, attributes);
286N/A }
286N/A else {
286N/A schemaDOM.startAnnotationElement(element, attributes);
286N/A // avoid falling through; don't call startElement in this case
286N/A return;
286N/A }
286N/A schemaDOM.startElement(element, attributes,
286N/A fLocator.getLineNumber(),
286N/A fLocator.getColumnNumber(),
286N/A fLocator.getCharacterOffset());
286N/A
286N/A }
286N/A
286N/A
286N/A /**
286N/A * An empty element.
286N/A *
286N/A * @param element The name of the element.
286N/A * @param attributes The element attributes.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
286N/A throws XNIException {
286N/A
286N/A if (fGenerateSyntheticAnnotation && fAnnotationDepth == -1 &&
286N/A element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && element.localpart != SchemaSymbols.ELT_ANNOTATION && hasNonSchemaAttributes(element, attributes)) {
286N/A
286N/A schemaDOM.startElement(element, attributes,
286N/A fLocator.getLineNumber(),
286N/A fLocator.getColumnNumber(),
286N/A fLocator.getCharacterOffset());
286N/A
286N/A attributes.removeAllAttributes();
286N/A String schemaPrefix = fNamespaceContext.getPrefix(SchemaSymbols.URI_SCHEMAFORSCHEMA);
286N/A final String annRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_ANNOTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_ANNOTATION);
286N/A schemaDOM.startAnnotation(annRawName, attributes, fNamespaceContext);
286N/A final String elemRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_DOCUMENTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_DOCUMENTATION);
286N/A schemaDOM.startAnnotationElement(elemRawName, attributes);
286N/A schemaDOM.charactersRaw("SYNTHETIC_ANNOTATION");
286N/A schemaDOM.endSyntheticAnnotationElement(elemRawName, false);
286N/A schemaDOM.endSyntheticAnnotationElement(annRawName, true);
286N/A
286N/A schemaDOM.endElement();
286N/A
286N/A return;
286N/A }
286N/A // the order of events that occurs here is:
286N/A // schemaDOM.startAnnotation/startAnnotationElement (if applicable)
286N/A // schemaDOM.emptyElement (basically the same as startElement then endElement)
286N/A // schemaDOM.endAnnotationElement (if applicable)
286N/A // the order of events that would occur if this was <element></element>:
286N/A // schemaDOM.startAnnotation/startAnnotationElement (if applicable)
286N/A // schemaDOM.startElement
286N/A // schemaDOM.endAnnotationElement (if applicable)
286N/A // schemaDOM.endElementElement
286N/A // Thus, we can see that the order of events isn't the same. However, it doesn't
286N/A // seem to matter. -- PJM
286N/A if (fAnnotationDepth == -1) {
286N/A // this is messed up, but a case to consider:
286N/A if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA &&
286N/A element.localpart == SchemaSymbols.ELT_ANNOTATION) {
286N/A schemaDOM.startAnnotation(element, attributes, fNamespaceContext);
286N/A }
286N/A }
286N/A else {
286N/A schemaDOM.startAnnotationElement(element, attributes);
286N/A }
286N/A
286N/A ElementImpl newElem = schemaDOM.emptyElement(element, attributes,
286N/A fLocator.getLineNumber(),
286N/A fLocator.getColumnNumber(),
286N/A fLocator.getCharacterOffset());
286N/A
286N/A if (fAnnotationDepth == -1) {
286N/A // this is messed up, but a case to consider:
286N/A if (element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA &&
286N/A element.localpart == SchemaSymbols.ELT_ANNOTATION) {
286N/A schemaDOM.endAnnotation(element, newElem);
286N/A }
286N/A }
286N/A else {
286N/A schemaDOM.endAnnotationElement(element);
286N/A }
286N/A }
286N/A
286N/A
286N/A /**
286N/A * The end of an element.
286N/A *
286N/A * @param element The name of the element.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void endElement(QName element, Augmentations augs) throws XNIException {
286N/A
286N/A // when we reach the endElement of xs:appinfo or xs:documentation,
286N/A // change fInnerAnnotationDepth to -1
286N/A if(fAnnotationDepth > -1) {
286N/A if (fInnerAnnotationDepth == fDepth) {
286N/A fInnerAnnotationDepth = -1;
286N/A schemaDOM.endAnnotationElement(element);
286N/A schemaDOM.endElement();
286N/A } else if (fAnnotationDepth == fDepth) {
286N/A fAnnotationDepth = -1;
286N/A schemaDOM.endAnnotation(element, fCurrentAnnotationElement);
286N/A schemaDOM.endElement();
286N/A } else { // inside a child of annotation
286N/A schemaDOM.endAnnotationElement(element);
286N/A }
286N/A } else { // not in an annotation at all
286N/A if(element.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA && fGenerateSyntheticAnnotation) {
286N/A boolean value = fHasNonSchemaAttributes.pop();
286N/A boolean sawann = fSawAnnotation.pop();
286N/A if (value && !sawann) {
286N/A String schemaPrefix = fNamespaceContext.getPrefix(SchemaSymbols.URI_SCHEMAFORSCHEMA);
286N/A final String annRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_ANNOTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_ANNOTATION);
286N/A schemaDOM.startAnnotation(annRawName, fEmptyAttr, fNamespaceContext);
286N/A final String elemRawName = (schemaPrefix.length() == 0) ? SchemaSymbols.ELT_DOCUMENTATION : (schemaPrefix + ':' + SchemaSymbols.ELT_DOCUMENTATION);
286N/A schemaDOM.startAnnotationElement(elemRawName, fEmptyAttr);
286N/A schemaDOM.charactersRaw("SYNTHETIC_ANNOTATION");
286N/A schemaDOM.endSyntheticAnnotationElement(elemRawName, false);
286N/A schemaDOM.endSyntheticAnnotationElement(annRawName, true);
286N/A }
286N/A }
286N/A schemaDOM.endElement();
286N/A }
286N/A fDepth--;
286N/A
286N/A }
286N/A
286N/A /**
286N/A * @param attributes
286N/A * @return
286N/A */
286N/A private boolean hasNonSchemaAttributes(QName element, XMLAttributes attributes) {
286N/A final int length = attributes.getLength();
286N/A for (int i = 0; i < length; ++i) {
286N/A String uri = attributes.getURI(i);
286N/A if (uri != null && uri != SchemaSymbols.URI_SCHEMAFORSCHEMA &&
286N/A uri != NamespaceContext.XMLNS_URI &&
286N/A !(uri == NamespaceContext.XML_URI &&
286N/A attributes.getQName(i) == SchemaSymbols.ATT_XML_LANG && element.localpart == SchemaSymbols.ELT_SCHEMA)) {
286N/A return true;
286N/A }
286N/A }
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * Ignorable whitespace. For this method to be called, the document
286N/A * source must have some way of determining that the text containing
286N/A * only whitespace characters should be considered ignorable. For
286N/A * example, the validator can determine if a length of whitespace
286N/A * characters in the document are ignorable based on the element
286N/A * content model.
286N/A *
286N/A * @param text The ignorable whitespace.
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
286N/A // unlikely to be called, but you never know...
286N/A if (fAnnotationDepth != -1 ) {
286N/A schemaDOM.characters(text);
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * The start of a CDATA section.
286N/A *
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void startCDATA(Augmentations augs) throws XNIException {
286N/A // only deal with CDATA boundaries within an annotation.
286N/A if (fAnnotationDepth != -1) {
286N/A schemaDOM.startAnnotationCDATA();
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * The end of a CDATA section.
286N/A *
286N/A * @param augs Additional information that may include infoset augmentations
286N/A *
286N/A * @exception XNIException
286N/A * Thrown by handler to signal an error.
286N/A */
286N/A public void endCDATA(Augmentations augs) throws XNIException {
286N/A // only deal with CDATA boundaries within an annotation.
286N/A if (fAnnotationDepth != -1) {
286N/A schemaDOM.endAnnotationCDATA();
286N/A }
286N/A }
286N/A
286N/A
286N/A //
286N/A // other methods
286N/A //
286N/A
286N/A /**
286N/A * Returns the DOM document object.
286N/A */
286N/A public Document getDocument() {
286N/A return schemaDOM;
286N/A }
286N/A
286N/A /**
286N/A * Delegates to SchemaParsingConfig.setFeature
286N/A * @param featureId
286N/A * @param state
286N/A */
286N/A public void setFeature(String featureId, boolean state){
286N/A config.setFeature(featureId, state);
286N/A }
286N/A
286N/A /**
286N/A * Delegates to SchemaParsingConfig.getFeature
286N/A * @param featureId
286N/A * @return boolean
286N/A */
286N/A public boolean getFeature(String featureId){
286N/A return config.getFeature(featureId);
286N/A }
286N/A
286N/A /**
286N/A * Delegates to SchemaParsingConfig.setProperty.
286N/A * @param propertyId
286N/A * @param value
286N/A */
286N/A public void setProperty(String propertyId, Object value){
286N/A config.setProperty(propertyId, value);
286N/A }
286N/A
286N/A /**
286N/A * Delegates to SchemaParsingConfig.getProperty.
286N/A * @param propertyId
286N/A * @return Object
286N/A */
286N/A public Object getProperty(String propertyId){
286N/A return config.getProperty(propertyId);
286N/A }
286N/A
286N/A /**
286N/A * Delegates to SchemaParsingConfig.setEntityResolver.
286N/A * @param er XMLEntityResolver
286N/A */
286N/A public void setEntityResolver(XMLEntityResolver er) {
286N/A config.setEntityResolver(er);
286N/A }
286N/A
286N/A /**
286N/A * Delegates parsing to SchemaParsingConfig
286N/A *
286N/A * @param inputSource
286N/A * @throws IOException
286N/A */
286N/A public void parse(XMLInputSource inputSource) throws IOException {
286N/A config.parse(inputSource);
286N/A }
286N/A
286N/A /**
286N/A * Reset SchemaParsingConfig
286N/A */
286N/A public void reset() {
286N/A ((SchemaParsingConfig)config).reset();
286N/A }
286N/A
286N/A /**
286N/A * ResetNodePool on SchemaParsingConfig
286N/A */
286N/A public void resetNodePool() {
286N/A ((SchemaParsingConfig)config).resetNodePool();
286N/A }
286N/A
286N/A /**
286N/A * A simple boolean based stack.
286N/A *
286N/A * @xerces.internal
286N/A */
286N/A private static final class BooleanStack {
286N/A
286N/A //
286N/A // Data
286N/A //
286N/A
286N/A /** Stack depth. */
286N/A private int fDepth;
286N/A
286N/A /** Stack data. */
286N/A private boolean[] fData;
286N/A
286N/A //
286N/A // Constructor
286N/A //
286N/A
286N/A public BooleanStack () {}
286N/A
286N/A //
286N/A // Public methods
286N/A //
286N/A
286N/A /** Returns the size of the stack. */
286N/A public int size() {
286N/A return fDepth;
286N/A }
286N/A
286N/A /** Pushes a value onto the stack. */
286N/A public void push(boolean value) {
286N/A ensureCapacity(fDepth + 1);
286N/A fData[fDepth++] = value;
286N/A }
286N/A
286N/A /** Pops a value off of the stack. */
286N/A public boolean pop() {
286N/A return fData[--fDepth];
286N/A }
286N/A
286N/A /** Clears the stack. */
286N/A public void clear() {
286N/A fDepth = 0;
286N/A }
286N/A
286N/A //
286N/A // Private methods
286N/A //
286N/A
286N/A /** Ensures capacity. */
286N/A private void ensureCapacity(int size) {
286N/A if (fData == null) {
286N/A fData = new boolean[32];
286N/A }
286N/A else if (fData.length <= size) {
286N/A boolean[] newdata = new boolean[fData.length * 2];
286N/A System.arraycopy(fData, 0, newdata, 0, fData.length);
286N/A fData = newdata;
286N/A }
286N/A }
286N/A }
286N/A}