/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class manages different properties related to Stax specification and its implementation.
* This class constructor also takes itself (PropertyManager object) as parameter and initializes the
* object with the property taken from the object passed.
*
* @author Neeraj Bajaj, neeraj.bajaj@sun.com
* @author K.Venugopal@sun.com
* @author Sunitha Reddy, sunitha.reddy@sun.com
*/
public class PropertyManager {
/** Property identifier: access to external dtd */
/** Property identifier: access to external schema */
/** Creates a new instance of PropertyManager */
switch(context){
case CONTEXT_READER:{
break;
}
case CONTEXT_WRITER:{
break;
}
}
}
/**
* Initialize this object with the properties taken from passed PropertyManager object.
*/
}
return supportedProps ;
}
/**
* Important point:
* 1. We are not exposing Xerces namespace property. Application should configure namespace through
* Stax specific property.
*
*/
private void initConfigurableReaderProperties(){
//spec default values
//zephyr (implementation) specific properties which can be set by the application.
//interning is always done
supportedProps.put(Constants.SAX_FEATURE_PREFIX + Constants.STRING_INTERNING_FEATURE , new Boolean(true));
//recognizing java encoding names by default
supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE, new Boolean(true)) ;
//in stax mode, namespace declarations are not added as attributes
supportedProps.put(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.STAX_REPORT_CDATA_EVENT , new Boolean(false));
supportedProps.put(Constants.ZEPHYR_PROPERTY_PREFIX + Constants.IGNORE_EXTERNAL_DTD, Boolean.FALSE);
supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE, new Boolean(false));
supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE, new Boolean(false));
supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE, new Boolean(false));
}
private void initWriterProps(){
//default value of escaping characters is 'true'
}
/**
* public void reset(){
* supportedProps.clear() ;
* }
*/
}
}
if(property == XMLInputFactory.IS_NAMESPACE_AWARE || property.equals(XMLInputFactory.IS_NAMESPACE_AWARE)){
}
else if(property == XMLInputFactory.IS_VALIDATING || property.equals(XMLInputFactory.IS_VALIDATING)){
}
}
throw new java.lang.IllegalArgumentException("false value of " + STRING_INTERNING + "feature is not supported") ;
}
}
//add internal stax property
supportedProps.put( Constants.XERCES_PROPERTY_PREFIX + Constants.STAX_ENTITY_RESOLVER_PROPERTY , new StaxEntityResolverWrapper((XMLResolver)value)) ;
}
if(equivalentProperty != null){
}
}
return supportedProps.toString();
}
}//PropertyManager