@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); if (m_aData == null && m_aType == null) HCConsistencyChecker.consistencyError ("OBJECT contains neither type nor data"); }
@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); if (HCHTMLHelper.recursiveContainsChildWithTagName (this, EHTMLElement.METER)) HCConsistencyChecker.consistencyError ("METER contains other nested meter"); }
@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); if (HCHTMLHelper.recursiveContainsChildWithTagName (this, EHTMLElement.PROGRESS)) HCConsistencyChecker.consistencyError ("PROGRESS contains other nested progress"); }
@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); if (HCHTMLHelper.recursiveContainsChildWithTagName (this, EHTMLElement.FORM)) HCConsistencyChecker.consistencyError ("FORM contains other nested form"); }
@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); final IHCElement <?> aChild = HCHTMLHelper.recursiveGetFirstChildWithTagName (this, EHTMLElement.IMG, EHTMLElement.OBJECT, EHTMLElement.SMALL, EHTMLElement.SUB, EHTMLElement.SUP); if (aChild != null) HCConsistencyChecker.consistencyError ("PRE elements contains forbidden tag " + aChild.getElement ()); } }
@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); final IHCElement <?> aChild = HCHTMLHelper.recursiveGetFirstChildWithTagName (this, EHTMLElement.A, EHTMLElement.INPUT, EHTMLElement.SELECT, EHTMLElement.TEXTAREA, EHTMLElement.LABEL, EHTMLElement.BUTTON, EHTMLElement.FORM, EHTMLElement.FIELDSET, EHTMLElement.IFRAME); if (aChild != null) HCConsistencyChecker.consistencyError ("BUTTON element contains forbidden tag " + aChild.getElement ()); }
@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); if (HCHTMLHelper.recursiveContainsChildWithTagName (this, EHTMLElement.A)) HCConsistencyChecker.consistencyError ("<A> may never contain other links!"); if (HCHTMLHelper.recursiveContainsChildWithTagName (this, EHTMLElement.SELECT)) HCConsistencyChecker.consistencyError ("<A> contains invalid child element!"); }
@Override protected void onConsistencyCheck (@Nonnull final IHCConversionSettingsToNode aConversionSettings) { super.onConsistencyCheck (aConversionSettings); final ICommonsSet <String> aUsedIDs = new CommonsHashSet <> (); HCHelper.iterateTree (this, (aParentNode, aChildNode) -> { if (aChildNode instanceof IHCHasID <?>) { final IHCHasID <?> aElement = (IHCHasID <?>) aChildNode; final String sID = aElement.getID (); if (StringHelper.hasText (sID) && !aUsedIDs.add (sID)) { HCConsistencyChecker.consistencyError ("The ID '" + sID + "' is used more than once within a single HTML page!"); } } return EFinish.UNFINISHED; }); }