| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| DefineNamespacePrefixToken |
|
| 0.0;0 |
| 1 | // Copyright 2007 The Apache Software Foundation | |
| 2 | // | |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | // you may not use this file except in compliance with the License. | |
| 5 | // You may obtain a copy of the License at | |
| 6 | // | |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | // | |
| 9 | // Unless required by applicable law or agreed to in writing, software | |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | // See the License for the specific language governing permissions and | |
| 13 | // limitations under the License. | |
| 14 | ||
| 15 | package org.apache.tapestry5.internal.parser; | |
| 16 | ||
| 17 | import org.apache.tapestry5.ioc.Location; | |
| 18 | ||
| 19 | /** | |
| 20 | * A token from a template that defines a namespace prefix. This will always follow a {@link | |
| 21 | * org.apache.tapestry5.internal.parser.StartComponentToken} or {@link org.apache.tapestry5.internal.parser.StartElementToken} | |
| 22 | * (and come before {@link org.apache.tapestry5.internal.parser.AttributeToken}) and applies to the component or | |
| 23 | * element. | |
| 24 | * | |
| 25 | * @see org.apache.tapestry5.dom.Element#defineNamespace(String, String) | |
| 26 | */ | |
| 27 | public class DefineNamespacePrefixToken extends TemplateToken | |
| 28 | { | |
| 29 | private final String namespaceURI; | |
| 30 | private final String namespacePrefix; | |
| 31 | ||
| 32 | public DefineNamespacePrefixToken(String namespaceURI, String namespacePrefix, Location location) | |
| 33 | { | |
| 34 | 36 | super(TokenType.DEFINE_NAMESPACE_PREFIX, location); |
| 35 | ||
| 36 | 36 | this.namespacePrefix = namespacePrefix; |
| 37 | 36 | this.namespaceURI = namespaceURI; |
| 38 | 36 | } |
| 39 | ||
| 40 | public String getNamespacePrefix() | |
| 41 | { | |
| 42 | 948 | return namespacePrefix; |
| 43 | } | |
| 44 | ||
| 45 | public String getNamespaceURI() | |
| 46 | { | |
| 47 | 948 | return namespaceURI; |
| 48 | } | |
| 49 | ||
| 50 | @Override | |
| 51 | public String toString() | |
| 52 | { | |
| 53 | 0 | return String.format("DefineNamespacePrefix[%s=%s]", namespacePrefix, namespaceURI); |
| 54 | } | |
| 55 | } |