logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Debian::Javahelper::Manifest - Javahelper representation of a Jar Manifest

Author

       Niels Thykier <niels@thykier.net>

Description

       This module is used to represent a Java Manifest.

   Constants
       MAIN_SECTION
           A constant denoting the main section of the manifest.

           Exported by default.

   Methods
       Debian::Javahelper::Manifest->new()
           Creates a new manifest. It will only contain the main section with the Manifest-Version attribute.

       $manifest->get_section($name[, $create])
           Returns  the  section  denoted  by  $name. If this section does not exist, then it will either return
           undef or (if $create is a truth-value) create a new empty section with that name.

           Use the MAIN_SECTION constant to access the main section of the manifest.

       $manifest->get_sections()
           Returns a list of all sections in $manifest. The main section will always be the first in  the  list,
           and the remaining sections will be sorted in name order.

           Modifying  the  list will not change which sections are present in $manifest, but modifying a section
           in this list will also update the section in the manifest.

       $manifest->merge($other)
           Merge all entries in $other into $manifest. All sections in $other will be added to $manifest if they
           are not already present.

           If an attribute in a given section is only present in one of the two manifests, then  that  attribute
           and its value will be in $manifest after merge returns.

           If  the attribute in a given section is present in both manifests, then the value from $other will be
           used.

           This can be used to make a deep copy a manifest:

            my $copy = Debian::Javahelper::Manifest->new();
            $copy->merge($orig);

Name

       Debian::Javahelper::Manifest - Javahelper representation of a Jar Manifest

See Also

Debian::Javahelper::Java(3)       -       had       parse/write       methods       for        manifests.
       Debian::Javahelper::ManifestSection(3) - for how sections are handled.

Synopsis

        use Debian::Javahelper::Java;

        my $manifest = ...;
        my $main_sec = $manifest->get_section(MAIN_SECTION);
        # Create if it does not exist.
        my $file_sec = $manifest->get_section("java/lang/Object.class", 1);

See Also