View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.imaging.formats.jpeg.iptc;
18  
19  public enum IptcTypes implements IptcType {
20      RECORD_VERSION(0, "Record Version"), OBJECT_TYPE_REFERENCE(3, "Object Type Reference"), OBJECT_ATTRIBUTE_REFERENCE(4, "Object Attribute Reference"),
21      OBJECT_NAME(5, "Object Name"), EDIT_STATUS(7, "Edit Status"), EDITORIAL_UPDATE(8, "Editorial Update"), URGENCY(10, "Urgency"),
22      SUBJECT_REFERENCE(12, "Subject Reference"), CATEGORY(15, "Category"), SUPPLEMENTAL_CATEGORY(20, "Supplemental Category"),
23      FIXTURE_IDENTIFIER(22, "Fixture Identifier"), KEYWORDS(25, "Keywords"), CONTENT_LOCATION_CODE(26, "Content Location Code"),
24      CONTENT_LOCATION_NAME(27, "Content Location Name"), RELEASE_DATE(30, "Release Date"), RELEASE_TIME(35, "Release Time"),
25      EXPIRATION_DATE(37, "Expiration Date"), EXPIRATION_TIME(38, "Expiration Time"), SPECIAL_INSTRUCTIONS(40, "Special Instructions"),
26      ACTION_ADVISED(42, "Action Advised"), REFERENCE_SERVICE(45, "Reference Service"), REFERENCE_DATE(47, "Reference Date"),
27      REFERENCE_NUMBER(50, "Reference Number"), DATE_CREATED(55, "Date Created"), TIME_CREATED(60, "Time Created"),
28      DIGITAL_CREATION_DATE(62, "Digital Creation Date"), DIGITAL_CREATION_TIME(63, "Digital Creation Time"), ORIGINATING_PROGRAM(65, "Originating Program"),
29      PROGRAM_VERSION(70, "Program Version"), OBJECT_CYCLE(75, "Object Cycle"), BYLINE(80, "By-line"), BYLINE_TITLE(85, "By-line Title"), CITY(90, "City"),
30      SUBLOCATION(92, "Sublocation"), PROVINCE_STATE(95, "Province/State"), COUNTRY_PRIMARY_LOCATION_CODE(100, "Country/Primary Location Code"),
31      COUNTRY_PRIMARY_LOCATION_NAME(101, "Country/Primary Location Name"), ORIGINAL_TRANSMISSION_REFERENCE(103, "Original Transmission, Reference"),
32      HEADLINE(105, "Headline"), CREDIT(110, "Credit"), SOURCE(115, "Source"), COPYRIGHT_NOTICE(116, "Copyright Notice"), CONTACT(118, "Contact"),
33      CAPTION_ABSTRACT(120, "Caption/Abstract"), WRITER_EDITOR(122, "Writer/Editor"), RASTERIZED_CAPTION(125, "Rasterized Caption"), IMAGE_TYPE(130, "ImageType"),
34      IMAGE_ORIENTATION(131, "Image Orientation"), LANGUAGE_IDENTIFIER(135, "Language Identifier"), AUDIO_TYPE(150, "Audio Type"),
35      AUDIO_SAMPLING_RATE(151, "Audio Sampling Rate"), AUDIO_SAMPLING_RESOLUTION(152, "Audio Sampling Resolution"), AUDIO_DURATION(153, "Audio Duration"),
36      AUDIO_OUTCUE(154, "Audio Outcue"), OBJECT_DATA_PREVIEW_FILE_FORMAT(200, "Object Data Preview, File Format"),
37      OBJECT_DATA_PREVIEW_FILE_FORMAT_VERSION(201, "Object Data Preview, File Format Version"), OBJECT_DATA_PREVIEW_DATA(202, "Object Data Preview Data");
38  
39      public static IptcType getUnknown(final int type) {
40          return new IptcType() {
41              @Override
42              public String getName() {
43                  return "Unknown";
44              }
45  
46              @Override
47              public int getType() {
48                  return type;
49              }
50  
51              @Override
52              public String toString() {
53                  return "Unknown (" + type + ")";
54              }
55          };
56      }
57  
58      public final int type;
59  
60      public final String name;
61  
62      IptcTypes(final int type, final String name) {
63          this.type = type;
64          this.name = name;
65      }
66  
67      @Override
68      public String getName() {
69          return name;
70      }
71  
72      @Override
73      public int getType() {
74          return type;
75      }
76  
77      @Override
78      public String toString() {
79          return name + " (" + type + ")";
80      }
81  }