Refine search
protected XMLValidator addValidator(XMLValidator vld) { if (mValidator == null) { mValidator = vld; } else { mValidator = new ValidatorPair(mValidator, vld); } return vld; }
public XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException { XMLValidator[] results = new XMLValidator[2]; if (ValidatorPair.removeValidator(mValidator, schema, results)) { // found XMLValidator found = results[0]; mValidator = results[1]; found.validationCompleted(false); return found; } return null; }
private boolean doRemoveValidator(XMLValidationSchema schema, XMLValidator[] results) { if (removeValidator(mFirst, schema, results)) { XMLValidator newFirst = results[1]; if (newFirst == null) { // removed first (was leaf) -> remove this pair results[1] = mSecond; } else { mFirst = newFirst; // two may be the same, need not be results[1] = this; } return true; } if (removeValidator(mSecond, schema, results)) { XMLValidator newSecond = results[1]; if (newSecond == null) { // removed second (was leaf) -> remove this pair results[1] = mFirst; } else { mSecond = newSecond; // two may be the same, need not be results[1] = this; // will still have this pair } return true; } return false; }
public static boolean removeValidator(XMLValidator root, XMLValidationSchema schema, XMLValidator[] results) { if (root instanceof ValidatorPair) { return ((ValidatorPair) root).doRemoveValidator(schema, results); } else { if (root.getSchema() == schema) { results[0] = root; results[1] = null; return true; } } return false; }
public static boolean removeValidator(XMLValidator root, XMLValidator vld, XMLValidator[] results) { if (root == vld) { // single validator? results[0] = root; results[1] = null; return true; } else if (root instanceof ValidatorPair) { return ((ValidatorPair) root).doRemoveValidator(vld, results); } return false; }
private boolean doRemoveValidator(XMLValidator vld, XMLValidator[] results) { if (removeValidator(mFirst, vld, results)) { XMLValidator newFirst = results[1]; if (newFirst == null) { // removed first (was leaf) -> remove this pair results[1] = mSecond; } else { mFirst = newFirst; // two may be the same, need not be results[1] = this; } return true; } if (removeValidator(mSecond, vld, results)) { XMLValidator newSecond = results[1]; if (newSecond == null) { // removed second (was leaf) -> remove this pair results[1] = mFirst; } else { mSecond = newSecond; // two may be the same, need not be results[1] = this; // will still have this pair } return true; } return false; }
public static boolean removeValidator(XMLValidator root, XMLValidationSchema schema, XMLValidator[] results) { if (root instanceof ValidatorPair) { return ((ValidatorPair) root).doRemoveValidator(schema, results); } else { if (root.getSchema() == schema) { results[0] = root; results[1] = null; return true; } } return false; }
public static boolean removeValidator(XMLValidator root, XMLValidator vld, XMLValidator[] results) { if (root == vld) { // single validator? results[0] = root; results[1] = null; return true; } else if (root instanceof ValidatorPair) { return ((ValidatorPair) root).doRemoveValidator(vld, results); } return false; }
public XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException { XMLValidator[] results = new XMLValidator[2]; if (ValidatorPair.removeValidator(mValidator, validator, results)) { // found XMLValidator found = results[0]; mValidator = results[1]; found.validationCompleted(false); return found; } return null; }
public XMLValidator validateAgainst(XMLValidationSchema schema) throws XMLStreamException { XMLValidator vld = schema.createValidator(this); if (mValidator == null) { /* Need to enable other validation modes? Structural validation * should always be done when we have other validators as well, * as well as attribute uniqueness checks. */ mCheckStructure = true; mCheckAttrs = true; mValidator = vld; } else { mValidator = new ValidatorPair(mValidator, vld); } return vld; }
private boolean doRemoveValidator(XMLValidationSchema schema, XMLValidator[] results) { if (removeValidator(mFirst, schema, results)) { XMLValidator newFirst = results[1]; if (newFirst == null) { // removed first (was leaf) -> remove this pair results[1] = mSecond; } else { mFirst = newFirst; // two may be the same, need not be results[1] = this; } return true; } if (removeValidator(mSecond, schema, results)) { XMLValidator newSecond = results[1]; if (newSecond == null) { // removed second (was leaf) -> remove this pair results[1] = mFirst; } else { mSecond = newSecond; // two may be the same, need not be results[1] = this; // will still have this pair } return true; } return false; }
public static boolean removeValidator(XMLValidator root, XMLValidationSchema schema, XMLValidator[] results) { if (root instanceof ValidatorPair) { return ((ValidatorPair) root).doRemoveValidator(schema, results); } else { if (root.getSchema() == schema) { results[0] = root; results[1] = null; return true; } } return false; }
public static boolean removeValidator(XMLValidator root, XMLValidator vld, XMLValidator[] results) { if (root == vld) { // single validator? results[0] = root; results[1] = null; return true; } else if (root instanceof ValidatorPair) { return ((ValidatorPair) root).doRemoveValidator(vld, results); } return false; }
public XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException { XMLValidator[] results = new XMLValidator[2]; XMLValidator found = null; if (ValidatorPair.removeValidator(mValidator, schema, results)) { // found found = results[0]; mValidator = results[1]; found.validationCompleted(false); if (mValidator == null) { resetValidationFlags(); } } return found; }
protected XMLValidator addValidator(XMLValidator vld) { if (mValidator == null) { mValidator = vld; } else { mValidator = new ValidatorPair(mValidator, vld); } return vld; }
private boolean doRemoveValidator(XMLValidator vld, XMLValidator[] results) { if (removeValidator(mFirst, vld, results)) { XMLValidator newFirst = results[1]; if (newFirst == null) { // removed first (was leaf) -> remove this pair results[1] = mSecond; } else { mFirst = newFirst; // two may be the same, need not be results[1] = this; } return true; } if (removeValidator(mSecond, vld, results)) { XMLValidator newSecond = results[1]; if (newSecond == null) { // removed second (was leaf) -> remove this pair results[1] = mFirst; } else { mSecond = newSecond; // two may be the same, need not be results[1] = this; // will still have this pair } return true; } return false; }
public static boolean removeValidator(XMLValidator root, XMLValidationSchema schema, XMLValidator[] results) { if (root instanceof ValidatorPair) { return ((ValidatorPair) root).doRemoveValidator(schema, results); } else { if (root.getSchema() == schema) { results[0] = root; results[1] = null; return true; } } return false; }
public static boolean removeValidator(XMLValidator root, XMLValidator vld, XMLValidator[] results) { if (root == vld) { // single validator? results[0] = root; results[1] = null; return true; } else if (root instanceof ValidatorPair) { return ((ValidatorPair) root).doRemoveValidator(vld, results); } return false; }
public XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException { XMLValidator[] results = new XMLValidator[2]; XMLValidator found = null; if (ValidatorPair.removeValidator(mValidator, validator, results)) { // found found = results[0]; mValidator = results[1]; found.validationCompleted(false); if (mValidator == null) { resetValidationFlags(); } } return found; }
protected XMLValidator addValidator(XMLValidator vld) { if (mValidator == null) { mValidator = vld; } else { mValidator = new ValidatorPair(mValidator, vld); } return vld; }