001 package org.apache.myfaces.tobago.context; 002 003 /* 004 * Licensed to the Apache Software Foundation (ASF) under one or more 005 * contributor license agreements. See the NOTICE file distributed with 006 * this work for additional information regarding copyright ownership. 007 * The ASF licenses this file to You under the Apache License, Version 2.0 008 * (the "License"); you may not use this file except in compliance with 009 * the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 */ 019 020 import java.io.Serializable; 021 import java.util.Locale; 022 023 /* 024 * Created by IntelliJ IDEA. 025 * User: bommel 026 * Date: Sep 25, 2006 027 * Time: 10:54:19 AM 028 */ 029 public class RendererConfig implements Serializable { 030 031 private static final long serialVersionUID = 1L; 032 033 private String name; 034 private MarkupConfig markupConfig; 035 036 public String getName() { 037 return name; 038 } 039 040 public void setName(String name) { 041 this.name = name.substring(0, 1).toLowerCase(Locale.ENGLISH) + name.substring(1); 042 } 043 044 public boolean equals(Object o) { 045 if (this == o) { 046 return true; 047 } 048 if (o == null || getClass() != o.getClass()) { 049 return false; 050 } 051 052 final RendererConfig that = (RendererConfig) o; 053 054 return name.equals(that.name); 055 056 } 057 058 public boolean contains(String markup) { 059 return markupConfig.contains(markup); 060 } 061 062 public int hashCode() { 063 return name.hashCode(); 064 } 065 066 public MarkupConfig getMarkupConfig() { 067 return markupConfig; 068 } 069 070 public void setMarkupConfig(MarkupConfig markupConfig) { 071 this.markupConfig = markupConfig; 072 } 073 074 public String toString() { 075 return "RendererConfig: " + getName() + " " + markupConfig; 076 } 077 078 }