26 February 2004

Appendix B: Java Language Binding

This appendix contains the complete Java [Java] bindings for the Level 3 Document Object Views and Formatting.

The Java files are also available as http://www.w3.org/TR/2004/NOTE-DOM-Level-3-Views-20040226/java-binding.zip

org/w3c/dom/views/View.java:

package org.w3c.dom.views;

import org.w3c.dom.Node;
import org.w3c.dom.DOMException;

public interface View {
    public void select(Node boundary, 
                       int offset, 
                       boolean extend, 
                       boolean add);

    public Segment createSegment();

    public boolean matchFirstSegment(Segment todo)
                                     throws DOMException;

    public int getIntegerProperty(String name)
                                  throws DOMException;

    public String getStringProperty(String name)
                                    throws DOMException;

    public boolean getBooleanProperty(boolean name)
                                      throws DOMException;

    public Node getContentPropertyNode(String name)
                                       throws DOMException;

    public int getContentPropertyOffset(String name)
                                        throws DOMException;

}

org/w3c/dom/views/Segment.java:

package org.w3c.dom.views;

import org.w3c.dom.Node;

public interface Segment extends Match {
    public Match getCriteria();
    public void setCriteria(Match criteria);

    public String getOrder();
    public void setOrder(String order);

    public void addItem(Item add);

    public MatchString createMatchString(short test, 
                                         String name, 
                                         String value);

    public MatchInteger createMatchInteger(short test, 
                                           String name, 
                                           int value);

    public MatchBoolean createMatchBoolean(short test, 
                                           String name, 
                                           boolean value);

    public MatchContent createMatchContent(short test, 
                                           String name, 
                                           int offset, 
                                           Node nodeArg);

    public MatchSet createMatchSet(short test);

    public StringItem createStringItem(String name);

    public IntegerItem createIntegerItem(String name);

    public BooleanItem createBooleanItem(String name);

    public ContentItem createContentItem(String name);

    public void getItem(int index);

    public boolean getNext();

}

org/w3c/dom/views/Match.java:

package org.w3c.dom.views;

public interface Match {
    // MatchTestGroup
    public static final short IS_EQUAL                  = 0;
    public static final short IS_NOT_EQUAL              = 1;
    public static final short INT_PRECEDES              = 2;
    public static final short INT_PRECEDES_OR_EQUALS    = 3;
    public static final short INT_FOLLOWS               = 4;
    public static final short INT_FOLLOWS_OR_EQUALS     = 5;
    public static final short STR_STARTS_WITH           = 6;
    public static final short STR_ENDS_WITH             = 7;
    public static final short STR_CONTAINS              = 8;
    public static final short SET_ANY                   = 9;
    public static final short SET_ALL                   = 10;
    public static final short SET_NOT_ANY               = 11;
    public static final short SET_NOT_ALL               = 12;

    public short getTest();

}

org/w3c/dom/views/MatchString.java:

package org.w3c.dom.views;

public interface MatchString extends Match {
    public String getName();

    public String getValue();

}

org/w3c/dom/views/MatchInteger.java:

package org.w3c.dom.views;

public interface MatchInteger extends Match {
    public String getName();

    public int getValue();

}

org/w3c/dom/views/MatchBoolean.java:

package org.w3c.dom.views;

public interface MatchBoolean extends Match {
    public String getName();

    public boolean getValue();

}

org/w3c/dom/views/MatchContent.java:

package org.w3c.dom.views;

import org.w3c.dom.Node;

public interface MatchContent extends Match {
    public String getName();

    public Node getNodeArg();

    public int getOffset();

}

org/w3c/dom/views/MatchSet.java:

package org.w3c.dom.views;

import org.w3c.dom.Node;

public interface MatchSet extends Match {
    public Node getNodeArg();

    public void addMatch(Match add);

    public Match getMatch(int index);

}

org/w3c/dom/views/Item.java:

package org.w3c.dom.views;

public interface Item {
    public boolean getExists();

    public String getName();

}

org/w3c/dom/views/StringItem.java:

package org.w3c.dom.views;

public interface StringItem extends Item {
    public String getValue();

}

org/w3c/dom/views/IntegerItem.java:

package org.w3c.dom.views;

public interface IntegerItem extends Item {
    public int getValue();

}

org/w3c/dom/views/BooleanItem.java:

package org.w3c.dom.views;

public interface BooleanItem extends Item {
    public boolean getValue();
    public void setValue(boolean value);

}

org/w3c/dom/views/ContentItem.java:

package org.w3c.dom.views;

import org.w3c.dom.Node;

public interface ContentItem extends Item {
    public Node getNodeArg();
    public void setNodeArg(Node nodeArg);

    public int getOffset();
    public void setOffset(int offset);

}

org/w3c/dom/views/VisualView.java:

package org.w3c.dom.views;

import org.w3c.dom.Node;

public interface VisualView {
    public String getFontScheme();

    public int getWidth();

    public int getHeight();

    public int getHorizontalDPI();

    public int getVerticalDPI();

    public VisualCharacter createVisualCharacter();

    public VisualCharacterRun createVisualCharacterRun();

    public VisualFrame createVisualFrame();

    public VisualImage createVisualImage();

    public VisualFormButton createVisualFormButton();

    public VisualFormField createVisualFormField();

    public void select(Node boundary, 
                       int offset, 
                       boolean extend, 
                       boolean add);

    public void matchSegment(VisualResource segment);

}

org/w3c/dom/views/VisualResource.java:

package org.w3c.dom.views;

public interface VisualResource {
}

org/w3c/dom/views/VisualFont.java:

package org.w3c.dom.views;

public interface VisualFont extends VisualResource {
    public String getMatchFontName();
    public void setMatchFontName(String matchFontName);

    public boolean getExists();

    public String getFontName();

    public boolean getNext();

}

org/w3c/dom/views/VisualSegment.java:

package org.w3c.dom.views;

import org.w3c.dom.Node;

public interface VisualSegment extends VisualResource {
    public boolean getMatchPosition();
    public void setMatchPosition(boolean matchPosition);

    public boolean getMatchInside();
    public void setMatchInside(boolean matchInside);

    public boolean getMatchContaining();
    public void setMatchContaining(boolean matchContaining);

    public int getMatchX();
    public void setMatchX(int matchX);

    public int getMatchY();
    public void setMatchY(int matchY);

    public int getMatchXR();
    public void setMatchXR(int matchXR);

    public int getMatchYR();
    public void setMatchYR(int matchYR);

    public boolean getMatchContent();
    public void setMatchContent(boolean matchContent);

    public boolean getMatchRange();
    public void setMatchRange(boolean matchRange);

    public Node getMatchNode();
    public void setMatchNode(Node matchNode);

    public int getMatchOffset();
    public void setMatchOffset(int matchOffset);

    public Node getMatchNodeR();
    public void setMatchNodeR(Node matchNodeR);

    public int getMatchOffsetR();
    public void setMatchOffsetR(int matchOffsetR);

    public boolean getMatchContainsSelected();
    public void setMatchContainsSelected(boolean matchContainsSelected);

    public boolean getMatchContainsVisible();
    public void setMatchContainsVisible(boolean matchContainsVisible);

    public boolean getExists();

    public Node getStartNode();

    public int getStartOffset();

    public Node getEndNode();

    public int getEndOffset();

    public int getTopOffset();

    public int getBottomOffset();

    public int getLeftOffset();

    public int getRightOffset();

    public int getWidth();

    public int getHeight();

    public boolean getSelected();

    public boolean getVisible();

    public int getForegroundColor();

    public int getBackgroundColor();

    public String getFontName();

    public String getFontHeight();

    public boolean getNext();

}

org/w3c/dom/views/VisualCharacter.java:

package org.w3c.dom.views;

public interface VisualCharacter extends VisualSegment {
}

org/w3c/dom/views/VisualCharacterRun.java:

package org.w3c.dom.views;

public interface VisualCharacterRun extends VisualSegment {
}

org/w3c/dom/views/VisualFrame.java:

package org.w3c.dom.views;

public interface VisualFrame extends VisualSegment {
    public VisualSegment getEmbedded();

}

org/w3c/dom/views/VisualImage.java:

package org.w3c.dom.views;

public interface VisualImage extends VisualSegment {
    public String getImageURL();

    public boolean isLoaded();

}

org/w3c/dom/views/VisualFormButton.java:

package org.w3c.dom.views;

public interface VisualFormButton extends VisualSegment {
    public boolean isPressed();

}

org/w3c/dom/views/VisualFormField.java:

package org.w3c.dom.views;

public interface VisualFormField extends VisualSegment {
    public String getFormValue();

}