001: /*
002: * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar 2006) eelco12 $
003: * $Revision: 461653 $
004: * $Date: 2006-03-17 20:47:08 -0800 (Fri, 17 Mar 2006) $
005: *
006: * ==============================================================================
007: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
008: * use this file except in compliance with the License. You may obtain a copy of
009: * the License at
010: *
011: * http://www.apache.org/licenses/LICENSE-2.0
012: *
013: * Unless required by applicable law or agreed to in writing, software
014: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
015: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
016: * License for the specific language governing permissions and limitations under
017: * the License.
018: */
019: package wicket.markup;
020:
021: /**
022: * Holds markup as a resource (the stream that the markup came from) and a list
023: * of MarkupElements (the markup itself).
024: *
025: * @see MarkupElement
026: * @see ComponentTag
027: * @see wicket.markup.RawMarkup
028: *
029: * @author Jonathan Locke
030: * @author Juergen Donnerstag
031: */
032: public abstract interface IMarkup {
033: /** Placeholder that indicates no markup */
034: public static final Markup NO_MARKUP = new Markup();
035:
036: /**
037: * Find the markup element index of the component with 'path'
038: *
039: * @param path
040: * The component path expression
041: * @param id
042: * The component's id to search for
043: * @return -1, if not found
044: */
045: int findComponentIndex(final String path, final String id);
046:
047: /**
048: * For Wicket it would be sufficient for this method to be package
049: * protected. However to allow wicket-bench easy access to the information
050: * ...
051: *
052: * @param index
053: * Index into markup list
054: * @return Markup element
055: */
056: MarkupElement get(final int index);
057:
058: /**
059: * Gets the markup encoding. A markup encoding may be specified in a markup
060: * file with an XML encoding specifier of the form <?xml ...
061: * encoding="..." ?>.
062: *
063: * @return Encoding, or null if not found.
064: */
065: String getEncoding();
066:
067: /**
068: * Gets the resource that contains this markup
069: *
070: * @return The resource where this markup came from
071: */
072: MarkupResourceStream getResource();
073:
074: /**
075: * Get the wicket namespace valid for this specific markup
076: *
077: * @return wicket namespace
078: */
079: String getWicketNamespace();
080:
081: /**
082: * Return the XML declaration string, in case if found in the markup.
083: *
084: * @return Null, if not found.
085: */
086: String getXmlDeclaration();
087:
088: /**
089: * For Wicket it would be sufficient for this method to be package
090: * protected. However to allow wicket-bench easy access to the information
091: * ...
092: *
093: * @return Number of markup elements
094: */
095: int size();
096:
097: /**
098: * @return String representation of markup list
099: */
100: String toDebugString();
101:
102: /**
103: * @return String representation of markup list
104: */
105: String toString();
106: }
|