Package org.apache.flex.swc

Examples of org.apache.flex.swc.ISWCVersion


                else if (tagName.equals(TAG_FLEX))
                {
                    final String flexVersion = reader.getAttributeValue(null, ATTR_VERSION);
                    final String minSupportedVersion = reader.getAttributeValue(null, ATTR_MINIMUM_SUPPORTED_VERSION);
                    final String flexBuild = reader.getAttributeValue(null, ATTR_BUILD);
                    ISWCVersion swcVersion = swc.getVersion();
                    swcVersion.setFlexVersion(flexVersion);
                    swcVersion.setFlexMinSupportedVersion(minSupportedVersion);
                    swcVersion.setFlexBuild(flexBuild);
                }
                else if (tagName.equals(TAG_SWC))
                {
                    final String swcVersion = reader.getAttributeValue(null, ATTR_VERSION);
                    swc.getVersion().setSWCVersion(swcVersion);
                }
                else if (tagName.equals(TAG_DEF))
                {
                    String id = reader.getAttributeValue(null, ATTR_ID);
                    id = QNameNormalization.normalize(id);
                    currentScript.addDefinition(id);

                    final SWCComponent component = componentIndex.get(id);
                    if (component != null)
                        component.setScript(currentScript);
                }
                else if (tagName.equals(TAG_DEP))
                {
                    String id = reader.getAttributeValue(null, ATTR_ID);
                    id = QNameNormalization.normalize(id);
                    final String type = reader.getAttributeValue(null, ATTR_TYPE);
                    assert type.length() == 1;
                    currentScript.addDependency(id, DependencyType.get(type.charAt(0)));
                }
                else if (tagName.equals(TAG_FILE))
                {
                    String path = reader.getAttributeValue(null, ATTR_PATH);
                    String modString = reader.getAttributeValue(null, ATTR_MOD);

                    long mod = 0;
                    if (modString != null)
                        mod = Long.parseLong(modString);

                    SWCFileEntry fileEntry = new SWCFileEntry(containingSWCFile, path, mod);
                    swc.addFile(fileEntry);
                }
                else if (tagName.equals(TAG_DIGEST))
                {
                    String type = reader.getAttributeValue(null, ATTR_TYPE);
                    String value = reader.getAttributeValue(null, ATTR_VALUE);
                    boolean isSigned = Boolean.parseBoolean(reader.getAttributeValue(null, ATTR_SIGNED));
                    SWCDigest swcDigest = new SWCDigest();
                    swcDigest.setType(type);
                    swcDigest.setValue(value);
                    swcDigest.setSigned(isSigned);
                   
                    currentLibrary.addDigest(swcDigest);
                }
                else if (tagName.equals(TAG_METADATA))
                {
                    String metadataName = reader.getAttributeValue(null, ATTR_NAME);
                    currentLibrary.addNameToKeepAS3MetadataSet(metadataName);
                }
                else if (tagName.equals(TAG_COMPILER))
                {
                    final String compilerName = reader.getAttributeValue(null, ATTR_NAME);
                    final String compilerVersion = reader.getAttributeValue(null, ATTR_VERSION);
                    final String compilerBuild = reader.getAttributeValue(null, ATTR_BUILD);
                    ISWCVersion swcVersion = swc.getVersion();
                    swcVersion.setCompilerName(compilerName);
                    swcVersion.setCompilerVersion(compilerVersion);
                    swcVersion.setCompilerBuild(compilerBuild);
                }
            }
        }
        catch (XMLStreamException e)
        {
View Full Code Here


        xmlWriter.writeEndElement();
    }

    private void writeVersions() throws XMLStreamException
    {
        final ISWCVersion version = swc.getVersion();
        if (version == null)
            return;

        xmlWriter.writeStartElement(TAG_VERSIONS);

        // SWC version
        final String swcVersion = version.getSWCVersion();
        if (swcVersion != null)
        {
            xmlWriter.writeEmptyElement(TAG_SWC);
            xmlWriter.writeAttribute(ATTR_VERSION, swcVersion);
        }

        // Flex version
        final String flexVersion = version.getFlexVersion();
        if (flexVersion != null)
        {
            xmlWriter.writeEmptyElement(TAG_FLEX);
            xmlWriter.writeAttribute(ATTR_VERSION, flexVersion);

            final String flexBuild = version.getFlexBuild();
            if (flexBuild != null)
                xmlWriter.writeAttribute(ATTR_BUILD, flexBuild);

            final String flexMinSupportedVersion = version.getFlexMinSupportedVersion();
            if (flexMinSupportedVersion != null)
                xmlWriter.writeAttribute(ATTR_MINIMUM_SUPPORTED_VERSION, flexMinSupportedVersion);
        }

        // Compiler version
        final String compilerVersion = version.getCompilerVersion();
        if (compilerVersion != null)
        {
            xmlWriter.writeEmptyElement(TAG_COMPILER);
           
            final String compilerName = version.getCompilerName();
            if (compilerName != null)
                xmlWriter.writeAttribute(ATTR_NAME, compilerName);
           
            xmlWriter.writeAttribute(ATTR_VERSION, compilerVersion);

            final String compilerBuild = version.getCompilerBuild();
            if (compilerBuild != null)
                xmlWriter.writeAttribute(ATTR_BUILD, compilerBuild);
        }

        xmlWriter.writeEndElement();
View Full Code Here

    /**
     * Sets version information to be written into the <versions> tag in catalog.xml.
     */
    private void setVersionInfo()
    {
        ISWCVersion swcVersion = swc.getVersion();
        swcVersion.setSWCVersion(VersionInfo.getLibVersion());
        if (flexProject.isFlex())
        {
            swcVersion.setFlexVersion(VersionInfo.getFlexVersion());
            swcVersion.setFlexBuild(VersionInfo.getBuild());
            swcVersion.setFlexMinSupportedVersion(targetSettings.getFlexMinimumSupportedVersion());
        }
        swcVersion.setCompilerName(VersionInfo.getCompilerName());
        swcVersion.setCompilerVersion(VersionInfo.getCompilerVersion());
        swcVersion.setCompilerBuild(VersionInfo.getCompilerBuild());
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.swc.ISWCVersion

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.