View Javadoc

    1   /*
    2    * Copyright 2010 University Corporation for Advanced Internet Development, Inc.
    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
    17  package edu.internet2.middleware.shibboleth.wayf.idpdisco;
    18
    19  import java.util.List;
    20
    21  import org.opensaml.common.impl.AbstractSAMLObject;
    22  import org.opensaml.saml2.metadata.LocalizedString;
    23  import org.opensaml.xml.XMLObject;
    24
    25  /**
    26   * Concrete implementation of {@link edu.internet2.middleware.shibboleth.wayf.idpdisco.Logo}.
    27   * @author rod widdowson
    28   */
    29  public class LogoImpl extends AbstractSAMLObject implements Logo {
    30
    31      /** Logo URL. */
    32      private LocalizedString localizedURL;
    33
    34      /** X-Dimension of the logo. */
    35      private Integer width;
    36
    37      /** Y-Dimension of the logo. */
    38      private Integer height;
    39
    40      /**
    41       * Constructor.
    42       *
    43       * @param namespaceURI namespaceURI
    44       * @param elementLocalName elementLocalName
    45       * @param namespacePrefix namespacePrefix
    46       */
    47      protected LogoImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
    48          super(namespaceURI, elementLocalName, namespacePrefix);
    49      }
    50
    51
    52      /** {@inheritDoc} */
    53      public Integer getHeight() {
    54          return height;
    55      }
    56
    57      /** {@inheritDoc} */
    58      public void setHeight(Integer newHeight) {
    59           height = prepareForAssignment(height, newHeight);
    60      }
    61
    62      /** {@inheritDoc} */
    63      public Integer getWidth() {
    64          return width;
    65      }
    66
    67      /** {@inheritDoc} */
    68      public void setWidth(Integer newWidth) {
    69          width = prepareForAssignment(width, newWidth);
    70      }
    71
    72      /** {@inheritDoc} */
    73      public LocalizedString getURL() {
    74          return localizedURL;
    75      }
    76
    77      /** {@inheritDoc} */
    78      public void setURL(LocalizedString newURL) {
    79          localizedURL = newURL;
    80      }
    81
    82      /** {@inheritDoc} */
    83      public String getXMLLang() {
    84          localizedURL.getLanguage();
    85          return null;
    86      }
    87
    88
    89      /** {@inheritDoc} */
    90      public void setXMLLang(String newLang) {
    91          localizedURL.setLanguage(newLang);
    92      }
    93
    94      /** {@inheritDoc} */
    95      public List<XMLObject> getOrderedChildren() {
    96          return null;
    97      }
    98
    99      /**
    100      * {@inheritDoc}
    101      */
    102     public int hashCode() {
    103         int hash = 1;
    104         hash = hash * 31 + localizedURL.hashCode();
    105         hash = hash * 31 + height;
    106         hash = hash * 31 + width;
    107         return hash;
    108     }
    109 }