コード例 #1
0
        /**
         * Read a tag with a given tag id. The tag will be read out of the class
         * defined in getTagEnum().
         *
         * @param tagid
         *            A RPM tag id
         * @return The name of the RPM tag
         * @throws IllegalArgumentException
         *             if the tag id was not found
         */
        public String getTagNameForId(long tagid)
        {
            EnumIf e = RPMHeaderTag.getEnumById(tagid);

            if (e == null)
            {
                throw new java.lang.IllegalArgumentException("unknown tag with id <" + tagid
                                                             + ">");
            }
            return(e.getName());
        }
コード例 #2
0
        /**
         * Read a tag with a given tag name. The tag will be read out of the class
         * defined in getTagEnum().
         *
         * @param tagname
         *            A RPM tag name
         * @return The id of the RPM tag
         * @throws IllegalArgumentException
         *             if the tag name was not found
         */
        public long getTagIdForName(String tagname)
        {
            EnumIf e = RPMHeaderTag.getEnumByName(tagname);

            if (e == null)
            {
                throw new java.lang.IllegalArgumentException("unknown tag with name <"
                                                             + tagname + ">");
            }

            return(e.getId());
        }
コード例 #3
0
 /**
  * Read all known tag names for this header structure.
  *
  * @return An array of tag names
  */
 public static String[] getKnownTagNames()
 {
     return(RPMHeaderTag.getEnumNames());
 }
コード例 #4
0
 /**
  * Test if the given tagname is associated with a valid tag
  *
  * @param tagname
  *            The name of a tag
  * @return TRUE if the tagname is valid
  */
 public bool isValidTag(String tagname)
 {
     return(RPMHeaderTag.getEnumByName(tagname) != null);
 }
コード例 #5
0
 /**
  * Test if the given tagid is associated with a valid tag
  *
  * @param tagid
  *            The id of a tag
  * @return TRUE if the tagid is valid
  */
 public bool isValidTag(long tagid)
 {
     return(RPMHeaderTag.getEnumById(tagid) != null);
 }