/** * Returns the object for this element or null, if this element does not create an object. * * @return the object. * @throws SAXException if an parser error occured. */ public Object getObject() throws SAXException { return bundleMetaDataReadHandler.getObject(); } }
public String getMetaDataName() { return getTagName(); } }
protected void doneParsing() throws SAXException { final ArrayList<UserDefinedAttribute> userAttributes = new ArrayList<UserDefinedAttribute>(); metaData = new DefaultBundleMetaData(); for ( int i = 0; i < entries.size(); i++ ) { final BundleMetaDataEntryReadHandler handler = entries.get( i ); final Object value = handler.getObject(); final String namespace = handler.getMetaDataNameSpace(); final String tagName = handler.getMetaDataName(); if ( value instanceof UserDefinedAttribute ) { userAttributes.add( (UserDefinedAttribute) value ); } else { metaData.putBundleAttribute( namespace, tagName, value ); } } metaData.putBundleAttribute( ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.USER_DEFINED, userAttributes.toArray( new UserDefinedAttribute[ userAttributes.size() ] ) ); }
protected XmlReadHandler getHandlerForChild( final String uri, final String tagName, final Attributes atts ) throws SAXException { final BundleMetaDataEntryReadHandlerFactory handlerFactory = BundleMetaDataEntryReadHandlerFactory.getInstance(); final BundleMetaDataEntryReadHandler readHandler = (BundleMetaDataEntryReadHandler) handlerFactory.getHandler( uri, tagName ); if ( readHandler != null ) { entries.add( readHandler ); return readHandler; } return null; }
public static synchronized BundleMetaDataEntryReadHandlerFactory getInstance() { if ( readHandlerFactory == null ) { final Configuration config = LibDocBundleBoot.getInstance().getGlobalConfig(); readHandlerFactory = new BundleMetaDataEntryReadHandlerFactory(); readHandlerFactory.configure( config, BundleMetaDataEntryReadHandlerFactory.PREFIX_SELECTOR ); } return readHandlerFactory; }
public BundleMetaDataRootReadHandler() { bundleMetaDataReadHandler = new BundleMetaDataReadHandler(); }
public XmlReadHandler createReadHandler( final XmlDocumentInfo documentInfo ) { return new BundleManifestReadHandler(); } }
public String getMetaDataName() { return getTagName(); } }
public String getMetaDataNameSpace() { return getUri(); }
public String getMetaDataNameSpace() { return getUri(); }
public XmlReadHandler createReadHandler( final XmlDocumentInfo documentInfo ) { return new BundleMetaDataRootReadHandler(); }
protected XmlReadHandler getHandlerForChild( final String uri, final String tagName, final Attributes atts ) throws SAXException { if ( BundleManifestXmlFactoryModule.NAMESPACE.equals( uri ) == false ) { return null; } if ( "file-entry".equals( tagName ) == false ) { return null; } return new BundleManifestEntryReadHandler( manifest ); }
/** * Returns the object for this element. * * @return the object. */ public Object getObject() { return BundleUtilities.parseDate( getResult() ); } }
public void initializeDefaults() { super.initializeDefaults(); final XmlFactoryModule[] registeredHandlers = registry.getRegisteredHandlers(); for ( int i = 0; i < registeredHandlers.length; i++ ) { registerModule( registeredHandlers[ i ] ); } }
public void initializeDefaults() { super.initializeDefaults(); final XmlFactoryModule[] registeredHandlers = registry.getRegisteredHandlers(); for ( int i = 0; i < registeredHandlers.length; i++ ) { registerModule( registeredHandlers[ i ] ); } }
protected void startParsing( final Attributes attrs ) throws SAXException { final String fullPath = attrs.getValue( BundleManifestXmlFactoryModule.NAMESPACE, "full-path" ); if ( fullPath == null ) { throw new ParseException( "Required attribute 'full-path' is missing.", getLocator() ); } final String mediaType = attrs.getValue( BundleManifestXmlFactoryModule.NAMESPACE, "media-type" ); manifest.addEntry( fullPath, mediaType ); final int length = attrs.getLength(); for ( int i = 0; i < length; i++ ) { final String attr = attrs.getValue( i ); final String name = attrs.getLocalName( i ); if ( "media-type".equals( name ) ) { continue; } if ( "full-path".equals( name ) ) { continue; } if ( BundleManifestXmlFactoryModule.NAMESPACE.equals( attrs.getURI( i ) ) == false ) { continue; } manifest.setAttribute( fullPath, name, attr ); } }