|
Oxygen XML Editor 12.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AuthorSchemaManager
Author schema manager. Provides support for obtaining information about what elements, attributes can be inserted in a given context.
Field Summary | |
---|---|
static short |
VALIDATION_MODE_LAX
Defines LAX validation of the elements from a fragment in a given context (they are found in the list of possible children of the context element). |
static short |
VALIDATION_MODE_STRICT_FIRST_CHILD_LAX_OTHERS
Defines STRICT validation for the first element from the fragment in a given context (it is accepted by the parent in the exact position he is about to be inserted) and LAX validation for all other siblings (they are found in the list of possible children of the context element). |
Method Summary | |
---|---|
boolean |
canInsertDocumentFragment(AuthorDocumentFragment fragment,
int offset,
short validationMode)
Check if the given fragment can be inserted at the given offset with respect to the given validation mode. |
boolean |
canInsertDocumentFragments(AuthorDocumentFragment[] fragments,
int offset,
short validationMode)
Check if the given fragments can be inserted at the given offset with respect to the given validation mode. |
boolean |
canInsertDocumentFragments(AuthorDocumentFragment[] fragments,
WhatElementsCanGoHereContext insertionContext,
short validationMode)
Check if the given fragments can be inserted in the given context with respect to the given validation mode. |
boolean |
canInsertText(int offset)
Check if the element at the given offset accepts text (in other words element content type is not ELEMENT ONLY or EMPTY). |
AuthorDocumentFragment |
createAuthorDocumentFragment(CIElement element)
Create an author document fragment from a CIElement |
WhatAttributesCanGoHereContext |
createWhatAttributesCanGoHereContext(AuthorElement element)
Create a context for the given element that can be used to obtain the list with attributes that element accepts. |
WhatElementsCanGoHereContext |
createWhatElementsCanGoHereContext(int offset)
Create an element context for the given offset. |
WhatPossibleValuesHasAttributeContext |
createWhatPossibleValuesHasAttributeContext(AuthorElement element,
java.lang.String attributeName)
Create an attribute values context for the given element and attribute name. |
java.util.List<CIElement> |
getAllPossibleElements()
Get all the elements, including eventual local ones. |
CIAttribute |
getAttributeDescription(WhatPossibleValuesHasAttributeContext ctxt)
Get the description of an attribute. |
AuthorSchemaAwareOptions |
getAuthorSchemaAwareOptions()
|
java.util.List<CIElement> |
getChildrenElements(WhatElementsCanGoHereContext context)
Get the elements that can be children of the element for which the context was built. |
CIElement |
getElementDescription(Context ctxt)
Get the description of an element. |
java.util.List<NameValue> |
getEntities()
Gets the context-independent list of entities declared in the document's DOCTYPE declaration. |
java.util.List<CIElement> |
getGlobalElements()
Get all the names of global elements defined in the associated grammar. |
java.net.URL[] |
getGrammarURLs()
Get the array of URLs of the loaded DTD or XML Schema. |
boolean |
hasLoadingErrors()
|
boolean |
isElementDescriptionSupported()
If true the element description(model) support is available, otherwise not. |
boolean |
isLearnSchema()
Returns true if schema was learned by Oxygen only from the structure of the XML document. |
java.util.List<CIAttribute> |
whatAttributesCanGoHere(WhatAttributesCanGoHereContext whatAttributesCanGoHereContext)
Examines the grammar and decides what attributes can be inserted in the parent element, after the list of attributes names. |
java.util.List<CIElement> |
whatElementsCanGoHere(WhatElementsCanGoHereContext whatElementsCanGoHereContext)
Examines the grammar and decides what elements can be inserted in the parent element, after the list of child names. |
java.util.List<CIValue> |
whatPossibleValuesHasAttribute(WhatPossibleValuesHasAttributeContext ctxt)
Queries the possible values of an element attribute. |
java.util.List<CIValue> |
whatPossibleValuesHasElement(WhatElementsCanGoHereContext ctxt)
Queries the possible values of an element. |
Field Detail |
---|
static final short VALIDATION_MODE_LAX
static final short VALIDATION_MODE_STRICT_FIRST_CHILD_LAX_OTHERS
Method Detail |
---|
boolean canInsertDocumentFragment(AuthorDocumentFragment fragment, int offset, short validationMode)
fragment
- Author fragment.offset
- The offset where to check if the fragment can be inserted.validationMode
- VALIDATION_MODE_LAX or VALIDATION_MODE_STRICT_FIRST_CHILD_LAX_OTHERS.
true
if the fragment can be inserted with respect to the given validation mode.boolean canInsertDocumentFragments(AuthorDocumentFragment[] fragments, int offset, short validationMode)
fragments
- Author fragment.offset
- The offset where to check if the fragments can be inserted.validationMode
- VALIDATION_MODE_LAX or VALIDATION_MODE_STRICT_FIRST_CHILD_LAX_OTHERS.
true
if the fragments can be inserted with respect to the given validation mode.boolean canInsertText(int offset)
offset
- The offset where to check if text can be inserted.
true
if text can be inserted at the given offset.boolean canInsertDocumentFragments(AuthorDocumentFragment[] fragments, WhatElementsCanGoHereContext insertionContext, short validationMode)
fragments
- Author fragments.insertionContext
- Insertion context.authorNode
- The corresponding node for the given context.validationMode
- VALIDATION_MODE_LAX or VALIDATION_MODE_STRICT_FIRST_CHILD_LAX_OTHERS.
true
if the fragment can be inserted with respect to the given validation mode.WhatElementsCanGoHereContext createWhatElementsCanGoHereContext(int offset) throws javax.swing.text.BadLocationException
offset
- Offset in document for which to create an element context.
javax.swing.text.BadLocationException
- When the offset is below zero or greater than the content.WhatAttributesCanGoHereContext createWhatAttributesCanGoHereContext(AuthorElement element)
element
- The element to to create WhatAttributesCanGoHereContext
whatAttributesCanGoHere(WhatAttributesCanGoHereContext)
WhatPossibleValuesHasAttributeContext createWhatPossibleValuesHasAttributeContext(AuthorElement element, java.lang.String attributeName)
element
- The element whose attribute values interest us.attributeName
- The name of attribute to create context.
AuthorSchemaAwareOptions getAuthorSchemaAwareOptions()
java.util.List<CIAttribute> whatAttributesCanGoHere(WhatAttributesCanGoHereContext whatAttributesCanGoHereContext)
whatAttributesCanGoHereContext
- the context for the call. It must
have:
createWhatAttributesCanGoHereContext(AuthorElement)
java.util.List<CIElement> whatElementsCanGoHere(WhatElementsCanGoHereContext whatElementsCanGoHereContext)
whatElementsCanGoHereContext
- the context for the call. It must have:
java.util.List<CIValue> whatPossibleValuesHasAttribute(WhatPossibleValuesHasAttributeContext ctxt)
ctxt
- The context WhatPossiBleValuesHasAttributeContext.
java.util.List<CIValue> whatPossibleValuesHasElement(WhatElementsCanGoHereContext ctxt)
ctxt
- The context.
java.net.URL[] getGrammarURLs()
update(InputSource[])
methods.
CIAttribute getAttributeDescription(WhatPossibleValuesHasAttributeContext ctxt)
ctxt
- the context describing the target attribute.
java.util.List<NameValue> getEntities()
If the DOCTYPE declaration is not changed, the document should not be processed each time this method is called.
CIElement getElementDescription(Context ctxt)
ctxt
- the context describing the target element. It contains:boolean isElementDescriptionSupported()
java.util.List<CIElement> getChildrenElements(WhatElementsCanGoHereContext context)
context
- The element context.
boolean isLearnSchema()
boolean hasLoadingErrors()
AuthorDocumentFragment createAuthorDocumentFragment(CIElement element) throws javax.swing.text.BadLocationException
element
- The CI Element from which to create a full fragment which can be inserted
javax.swing.text.BadLocationException
java.util.List<CIElement> getGlobalElements()
java.util.List<CIElement> getAllPossibleElements()
Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.
|
Oxygen XML Editor 12.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |