1 /* 2 * Copyright 2013 smartics, Kronseder & Reiner GmbH 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package de.smartics.html5.jatl; 17 18 import de.smartics.resteasy.hypermedia.renderer.ResourceContext; 19 20 /** 21 * Extends {@link ResourceContext} with HTML tools. 22 */ 23 public class HtmlResourceContext 24 { 25 // ********************************* Fields ********************************* 26 27 // --- constants ------------------------------------------------------------ 28 29 // --- members -------------------------------------------------------------- 30 31 /** 32 * The resource context to extend. 33 */ 34 private final ResourceContext context; 35 36 /** 37 * The tools to create HTML documents. 38 */ 39 private final HtmlFactory factory; 40 41 // ****************************** Initializer ******************************* 42 43 // ****************************** Constructors ****************************** 44 45 /** 46 * Default constructor. 47 * 48 * @param context the resource context to extend. 49 * @param factory the tools to create HTML documents. 50 */ 51 public HtmlResourceContext(final ResourceContext context, 52 final HtmlFactory factory) 53 { 54 this.context = context; 55 this.factory = factory; 56 } 57 58 // ****************************** Inner Classes ***************************** 59 60 // ********************************* Methods ******************************** 61 62 // --- init ----------------------------------------------------------------- 63 64 // --- get&set -------------------------------------------------------------- 65 66 /** 67 * Returns the resource context to extend. 68 * 69 * @return the resource context to extend. 70 */ 71 public ResourceContext getContext() 72 { 73 return context; 74 } 75 76 /** 77 * Returns the tools to create HTML documents. 78 * 79 * @return the tools to create HTML documents. 80 */ 81 public HtmlFactory getFactory() 82 { 83 return factory; 84 } 85 86 // --- business ------------------------------------------------------------- 87 88 // --- object basics -------------------------------------------------------- 89 90 }