com.eviware.soapui.impl.wadl.inference.schema
Class Context

java.lang.Object
  extended by com.eviware.soapui.impl.wadl.inference.schema.Context

public class Context
extends java.lang.Object

An object that holds information about a validation in-progress, such as the cursor of the content to be validated., etc.

Author:
Dain Nilsson

Constructor Summary
Context(SchemaSystem system, ConflictHandler handler, org.apache.xmlbeans.XmlCursor cursor)
          Creates a new Context object.
 
Method Summary
 void cd(java.lang.String item)
          Append an element to the end of the current path.
 void clearAttribute(java.lang.String key)
          Delete a stored attribute.
 java.lang.String getAttribute(java.lang.String key)
          Get a stored attribute.
 org.apache.xmlbeans.XmlCursor getCursor()
          Get the internal cursor pointing to the current position of the XML content to be validated.
 ConflictHandler getHandler()
          Getter for the contained ConflictHandler.
 java.lang.String getName()
          Get a name to use for a Complex Type at the current path.
 java.lang.String getPath()
          Get the path currently at.
 SchemaSystem getSchemaSystem()
          Get the SchemaSystem currently used for validation.
 void popPath()
          Pop a previously pushed path from the internal stack, overwriting whatever is currently in the path.
 void pushPath()
          Push the current path to an internal stack, and start with an empty path.
 void putAttribute(java.lang.String key, java.lang.String value)
          Store an attribute.
 void up()
          Move up one level, removing the last element from the path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context(SchemaSystem system,
               ConflictHandler handler,
               org.apache.xmlbeans.XmlCursor cursor)
Creates a new Context object.

Parameters:
system - The SchemaSystem holding the namespaces to be used for validation.
handler - The ConflictHandler to use whenever a validation error occurs to decide upon which action to take.
cursor - An XmlCursor pointing to the beginning of the XML content to validate.
Method Detail

getHandler

public ConflictHandler getHandler()
Getter for the contained ConflictHandler.

Returns:
Returns the ConflictHandler used for validation.

getName

public java.lang.String getName()
Get a name to use for a Complex Type at the current path. Names are derived from paths, using the locality from the Settings class.

Returns:
A name to be used for the Complex Type at the current location.

getAttribute

public java.lang.String getAttribute(java.lang.String key)
Get a stored attribute.

Parameters:
key - The key of the attribute to get.
Returns:
Returns the value of the attribute, if it exists. An empty string is returned if not.

putAttribute

public void putAttribute(java.lang.String key,
                         java.lang.String value)
Store an attribute.

Parameters:
key - The name of the attribute to store.
value - The value to store.

clearAttribute

public void clearAttribute(java.lang.String key)
Delete a stored attribute.

Parameters:
key - The name of the attribute to delete.

getPath

public java.lang.String getPath()
Get the path currently at.

Returns:
Returns the current path, elements are separated by slash.

pushPath

public void pushPath()
Push the current path to an internal stack, and start with an empty path.


popPath

public void popPath()
Pop a previously pushed path from the internal stack, overwriting whatever is currently in the path.


cd

public void cd(java.lang.String item)
Append an element to the end of the current path.

Parameters:
item - The name of the element to trascend into.

up

public void up()
Move up one level, removing the last element from the path.


getCursor

public org.apache.xmlbeans.XmlCursor getCursor()
Get the internal cursor pointing to the current position of the XML content to be validated.

Returns:
Returns an XmlCursor.

getSchemaSystem

public SchemaSystem getSchemaSystem()
Get the SchemaSystem currently used for validation.

Returns:
Returns a SchemaSystem.


Copyright © 2005-2009 eviware.com. All Rights Reserved.