Debian::Javahelper::ManifestSection3
Javahelper representation of a section in a jar manifest
Usage
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();
Overview
This module is used to represent a Section in a Java Manifest.
Constants
- MAIN_SECTION
-
A constant denoting the main section of the manifest.
Exported by default.
Methods
- Debian::Javahelper::ManifestSection->new($name)
-
Creates a new section - if
$nameis MAIN_SECTION, then it will set "Manifest-Version" otherwise it will set "Name" to$name.Generally you should not need to use this directly! The Debian::Javahelper::Manifest will create sections as they are needed. There is no support for creating a section and then adding it to a manifest after wards.
- $section->set_value($attr, $value)
-
Sets the value of
$attrto$value. If$attrdid not exist in this section then it will be created.$valuemay not contain newlines.Note:
$attrexists if an attribute matches$attrignoring the case of the two. When$attris created, the original case will be stored for later (for writing). Later updates to$attrwill not affect the original case.
- $section->get_value($attr[, $empty])
-
Returns the value of
$attr, long values are merged into a single line.$attris looked up case-insensitively.Returns
undefif$attris not present in the section, unless$emptyis a truth-value. In this case it will return ''.
- $section->
get_values() -
Returns all the values in the section in a list of [$attr,
$value] pairs. "Manifest-Version" and "Name" will appear first in this list if they appear in this section, the remaining attributes appears in any order and this order may change.Modifying the list or the pairs will not affect the attributes in the section.
Note: The
$attrpart will be the original case of the attribute.
Copyright and license
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.
Releases
8 releases since Debian 6.0 (Squeeze); the text changed 6 times.