001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.wicket.markup; 018 019import java.io.Serializable; 020 021/** 022 * 023 * @author Juergen Donnerstag 024 */ 025public class MarkupType implements Serializable 026{ 027 private static final long serialVersionUID = 1L; 028 029 /** Mime string for XHTML */ 030 public static final String XML_MIME = "application/xhtml+xml"; 031 032 /** Mime string for HTML */ 033 public static final String HTML_MIME = "text/html"; 034 035 /** A HTML markup type for web pages */ 036 public final static MarkupType HTML_MARKUP_TYPE = new MarkupType("html", HTML_MIME); 037 038 private final String extension; 039 040 private final String mimeType; 041 042 /** 043 * Construct. 044 * 045 * @param extension 046 * associate markup file extension. "html" by default. 047 * @param mimeType 048 */ 049 public MarkupType(final String extension, final String mimeType) 050 { 051 this.extension = extension; 052 this.mimeType = mimeType; 053 } 054 055 /** 056 * Gets extension. 057 * 058 * @return extension 059 */ 060 public final String getExtension() 061 { 062 return extension; 063 } 064 065 /** 066 * Gets mimeType. 067 * 068 * @return mimeType 069 */ 070 public final String getMimeType() 071 { 072 return mimeType; 073 } 074 075 @Override 076 public String toString() 077 { 078 return "MarkupType [extension=" + extension + ", mimeType=" + mimeType + "]"; 079 } 080}