Debian::Javah...anifestSection(3)

πŸ’– NAME πŸ’–

Debian::Javahelper::ManifestSection β€” bestie, this is Javahelper's whole little representation of one single section inside a Jar Manifest. One section. That's her job. She's iconic. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's how you'd actually use her:

use Debian::Javahelper::Manifest;

my $main_sec = $manifest->get_section(MAIN_SECTION, 1);
# set the Main-Class attribute
$main_sec->set_value('Main-Class', 'org.site.app.AppStarter');
# read the classpath entry - may return undef if the attribute does not exist.
my $cp = $main_sec->get_value('Class-Path');
# same as above except $cp will be '' if the attribute does not exist.
$cp = $main_sec->get_value('Class-Path',  1);
# returns a list of [$name, $value] pairs - note $name will be in the original
# case.
my @att = $main_sec->get_values();

like. she's literally just here to hold attributes for you. no cap. πŸ’…


🌸 DESCRIPTION 🌸

So this module is the girl who represents a Section in a Java Manifest. That's it, that's the whole thing, and she does it beautifully. πŸŽ€

✨ Constants ✨

  • MAIN_SECTION β€” a constant that denotes the main section of the manifest. She's exported by default, so she just shows up, uninvited, slaying. 🫢

πŸ’œ Methods πŸ’œ

Debian::Javahelper::ManifestSection->new($name)

Creates a new section. Here's the tea: if $name is MAIN_SECTION, then it will set "Manifest-Version", otherwise it will set "Name" to $name.

ngl generally you should not need to use this directly, bestie! The Debian::Javahelper::Manifest will create sections as they are needed. Also there is no support for creating a section and then adding it to a manifest afterwards. so don't try it, she's not that kind of girl. 😭

$section->set_value($attr, $value)

Sets the value of $attr to $value. If $attr did not exist in this section, then it will be created. And listen β€” $value may not contain newlines. that's the rule, periodt. πŸ’€

Note: $attr exists if an attribute matches $attr ignoring the case of the two. When $attr is created, the original case will be stored for later (for writing). Later updates to $attr will not affect the original case. she remembers how she met you. πŸ™ˆ

$section->get_value($attr[, $empty])

Returns the value of $attr, and long values are merged into a single line. $attr is looked up case-insensitively β€” she's chill like that. 🌈

Returns undef if $attr is not present in the section, unless $empty is a truth-value. In that case it will return ''. so you get an empty string instead of a whole undef situation. much cuter. πŸŽ€

$section->get_values()

Returns all the values in the section, as a list of [$attr, $value] pairs. And here's the ordering lore: "Manifest-Version" and "Name" will appear first in this list if they appear in this section. The remaining attributes appear in any order and this order may change. chaotic but valid. ✨

Modifying the list or the pairs will not affect the attributes in the section. no side effects, we love to see it. 🫢

Note: the $attr part will be the original case of the attribute.


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Niels Thykier <niels@thykier.net> β€” the icon, the legend, the moment. 🌟


Copyright 2010 by Niels Thykier

This module is free software; you may redistribute it and/or modify it under the terms of GNU GPL 2. slay. πŸ’…


fr fr, that's the whole page, bestie. you're so ready for this module now. πŸ¦‹

version 0.82, dated 2026-05-17 β€” mwah, go forth and manifest your manifests. βœ¨πŸ’–

πŸ“¦ where this page comes from