## org.apache.xerces.validators.common
Class InsertableElementsInfo

    java.lang.Object
      |
      +--org.apache.xerces.validators.common.InsertableElementsInfo

public class InsertableElementsInfo
extends java.lang.Object

--------------------------------------------------------------------------- InsertableElementsInfo is a simple 'data packet' class that is used to get information into and out of the validator APIs that allow you to ask what kind of elements can be inserted into a particular place in an element's content model. The parent element is not explicitly stored here, since it is a separate parameter to the methods that do the query. Since it exists purely to exchange data, it just uses simple public data members. --------------------------------------------------------------------------- InsertableElementsInfo is a simple 'data packet' class that is used to get information into and out of the validator APIs that allow you to ask what kind of elements can be inserted into a particular place in an element's content model.

The parent element is not explicitly stored here, since it is a separate parameter to the methods that do the query.

Since it exists purely to exchange data, it just uses simple public data members.

Version:
  $Id: InsertableElementsInfo.java,v 1.2 2000/05/17 18:33:04 jeffreyr Exp $

Field Summary
`boolean` `canHoldPCData` One of the things that could be inserted here is a PCDATA node, in addition to the element type nodes reported.
`int` `childCount` The count of elements in the curChildren array.
`QName[]` `curChildren` The current list of children of the parent element.
`int` `insertAt` The insertion point.
`boolean` `isValidEOC` Indicates that one of the valid things after the insert point is 'end of content', which means that the element being inserted after can legally be the last element.
`QName[]` `possibleChildren` This array is filled with flags that indicate what the possible insertable elements are (i.e.
`boolean[]` `results` This array must be at least as large as possibleChildren since a flag is set in the same indexes in this array to indicate that the possible child at that index in possibleChildren can be inserted at the requested insertion point.
`int` `resultsCount` The number of elements that are valid in the possibleChildren and resultsCount arrays.

Constructor Summary
`InsertableElementsInfo()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### canHoldPCData

    public boolean canHoldPCData

  One of the things that could be inserted here is a PCDATA node, in addition to the element type nodes reported.

### childCount

    public int childCount

  The count of elements in the curChildren array. The array can be larger than this (for reuse purposes), so this value indicates how many elements are valid.

  Note that, since the curChildren array must have an empty slot at the insertion index, this value can never be zero.

  Note also that this value can be changed during processing, though its value on return is meaningless to the caller.

### curChildren

    public QName[] curChildren

  The current list of children of the parent element. This may or may not be the real list of children, since the caller can lie but that's of no concern to the validator. These query APIs are intended to be for 'what if' kind of work, so any list of children could be passed in.

  There must be an empy slot in the array at the requested insertion point. That slot does not have to have any particular value, but it will be used by the validator to do brute force validation in some cases when a 'fully valid' check is done for valid insertable elements.

  Note that this array can be modified by the call, so do not expect its contents to remain the same as on input.

### isValidEOC

    public boolean isValidEOC

  Indicates that one of the valid things after the insert point is 'end of content', which means that the element being inserted after can legally be the last element.

### insertAt

    public int insertAt

  The insertion point. The question is 'what can go here' and this indicates where 'where' is. It is an offset into curChildren.

### possibleChildren

    public QName[] possibleChildren

  This array is filled with flags that indicate what the possible insertable elements are (i.e. the list of unique elements that could possibly be inserted somewhere in this type of element.) Effectively this is the list of unique children in the content model of the parent element.

  If this array is not big enough to hold the results, or is null, then it will be replaced with a new array of the correct size.

### resultsCount

    public int resultsCount

  The number of elements that are valid in the possibleChildren and resultsCount arrays. They can be larger than that, so there must be a way to indicate how many elements are filled in with value results. If they were not at least this large on input, then they will be reallocated up to this size.

### results

    public boolean[] results

  This array must be at least as large as possibleChildren since a flag is set in the same indexes in this array to indicate that the possible child at that index in possibleChildren can be inserted at the requested insertion point.

  If this array is not big enough to hold the results, or is null, then it will be replaced with a new array of the correct size.

Constructor Detail

### InsertableElementsInfo

    public InsertableElementsInfo()

Copyright © 1999-2001 Apache XML Project. All Rights Reserved.