Class CSSImportRule

    • Method Detail

      • hasMediaQueries

        public boolean hasMediaQueries()
        Returns:
        true if this import rule has any specific media queries, to which it belongs, false if not.
      • getMediaQueryCount

        @Nonnegative
        public int getMediaQueryCount()
        Returns:
        The number of contained media queries. Always ≥ 0.
      • addMediaQuery

        @Nonnull
        public CSSImportRule addMediaQuery​(@Nonnull
                                           CSSMediaQuery aMediaQuery)
        Add a media query at the end of the list.
        Parameters:
        aMediaQuery - The media query to be added. May not be null.
        Returns:
        this
      • addMediaQuery

        @Nonnull
        public CSSImportRule addMediaQuery​(@Nonnegative
                                           int nIndex,
                                           @Nonnull
                                           CSSMediaQuery aMediaQuery)
        Add a media query at the specified index of the list.
        Parameters:
        nIndex - The index where to add the media query. Must be ≥ 0.
        aMediaQuery - The media query to be added. May not be null.
        Returns:
        this
      • removeMediaQuery

        @Nonnull
        public com.helger.commons.state.EChange removeMediaQuery​(@Nullable
                                                                 CSSMediaQuery aMediaQuery)
        Remove the specified media query.
        Parameters:
        aMediaQuery - The media query to be removed. May be null.
        Returns:
        EChange.CHANGED if removal was successful.
      • removeMediaQuery

        @Nonnull
        public com.helger.commons.state.EChange removeMediaQuery​(int nMediumIndex)
        Remove the media query at the specified index.
        Parameters:
        nMediumIndex - The index of the media query to be removed.
        Returns:
        EChange.CHANGED if removal was successful.
      • removeAllMediaQueries

        @Nonnull
        public com.helger.commons.state.EChange removeAllMediaQueries()
        Remove all contained media queries.
        Returns:
        EChange.CHANGED if at least one media query was contained.
      • getAllMediaQueries

        @Nonnull
        @ReturnsMutableCopy
        public com.helger.commons.collection.impl.ICommonsList<CSSMediaQuery> getAllMediaQueries()
        Returns:
        A list with all contained media queries. Never null and always a copy of the underlying list.
      • getLocation

        @Nonnull
        public final CSSURI getLocation()
        Returns:
        The URL object of the CSS file to import. Never null.
      • getLocationString

        @Nonnull
        @Nonempty
        public final String getLocationString()
        Returns:
        The URL of the CSS file to import. Never null. This is a shortcut for getLocation().getURI()
      • setLocation

        @Nonnull
        public final CSSImportRule setLocation​(@Nonnull
                                               CSSURI aLocation)
        Set the URI of the file to be imported.
        Parameters:
        aLocation - The location to use. May not be null.
        Returns:
        this;
      • setLocationString

        @Nonnull
        public final CSSImportRule setLocationString​(@Nonnull
                                                     String sLocationURI)
        Set the URI of the file to be imported.
        Parameters:
        sLocationURI - The location URI to use. May not be null.
        Returns:
        this;
      • getAsCSSString

        @Nonnull
        @Nonempty
        public String getAsCSSString​(@Nonnull
                                     ICSSWriterSettings aSettings,
                                     @Nonnegative
                                     int nIndentLevel)
        Description copied from interface: ICSSWriteable
        Get the contents of this object as a serialized CSS string for writing to an output.
        Specified by:
        getAsCSSString in interface ICSSWriteable
        Parameters:
        aSettings - The settings to be used to format the output. May not be null.
        nIndentLevel - The current indentation level
        Returns:
        The content of this object as CSS string. Never null.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object