📄 compoundpredicate.java
字号:
if( _objSimplePredicate != null )
elem.addContent(_objSimplePredicate.marshal());
/** Marshals a CompoundPredicate object to an element */
if( _objCompoundPredicate != null )
elem.addContent(_objCompoundPredicate.marshal());
/** Marshals a SimpleSetPredicate object to an element */
if( _objSimpleSetPredicate != null )
elem.addContent(_objSimpleSetPredicate.marshal());
/** Marshals a True object to an element */
if( _objTrue != null )
elem.addContent(_objTrue.marshal());
/** Marshals a False object to an element */
if( _objFalse != null )
elem.addContent(_objFalse.marshal());
/** Marshals a list of SimplePredicate objects to elements */
Iterator it1 = _objSimplePredicate1.iterator();
while( it1.hasNext() )
{
SimplePredicate obj = (SimplePredicate)it1.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a list of CompoundPredicate objects to elements */
Iterator it2 = _objCompoundPredicate1.iterator();
while( it2.hasNext() )
{
CompoundPredicate obj = (CompoundPredicate)it2.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a list of SimpleSetPredicate objects to elements */
Iterator it3 = _objSimpleSetPredicate1.iterator();
while( it3.hasNext() )
{
SimpleSetPredicate obj = (SimpleSetPredicate)it3.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a list of True objects to elements */
Iterator it4 = _objTrue1.iterator();
while( it4.hasNext() )
{
True obj = (True)it4.next();
if( obj != null )
elem.addContent(obj.marshal());
}
/** Marshals a list of False objects to elements */
Iterator it5 = _objFalse1.iterator();
while( it5.hasNext() )
{
False obj = (False)it5.next();
if( obj != null )
elem.addContent(obj.marshal());
}
return elem;
}
/**
* Unmarshals the specified "CompoundPredicate" element back to a CompoundPredicate object.
*/
public static CompoundPredicate unmarshal(com.borland.xml.toolkit.Element elem)
{
if( elem == null )
return null;
CompoundPredicate __objCompoundPredicate = new CompoundPredicate();
if( __objCompoundPredicate != null ) //found the element?
{
/** Unmarshals "booleanOperator" attribute */
__objCompoundPredicate.booleanOperator.setValue(elem.getAttribute("booleanOperator"));
}
/** Unmarshals an element back to a SimplePredicate object */
__objCompoundPredicate.setSimplePredicate(SimplePredicate.unmarshal(elem.getChild(SimplePredicate._tagName)));
/** Unmarshals an element back to a CompoundPredicate object */
__objCompoundPredicate.setCompoundPredicate(CompoundPredicate.unmarshal(elem.getChild(CompoundPredicate._tagName)));
/** Unmarshals an element back to a SimpleSetPredicate object */
__objCompoundPredicate.setSimpleSetPredicate(SimpleSetPredicate.unmarshal(elem.getChild(SimpleSetPredicate._tagName)));
/** Unmarshals an element back to a True object */
__objCompoundPredicate.setTrue(True.unmarshal(elem.getChild(True._tagName)));
/** Unmarshals an element back to a False object */
__objCompoundPredicate.setFalse(False.unmarshal(elem.getChild(False._tagName)));
/** Unmarshals a list of "<<_tagName_>>" elements back to SimplePredicate objects. */
Iterator it1 = elem.getChildren(SimplePredicate._tagName).iterator();
while( it1.hasNext() )
__objCompoundPredicate.addSimplePredicate1(SimplePredicate.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
/** Unmarshals a list of "<<_tagName_>>" elements back to CompoundPredicate objects. */
Iterator it2 = elem.getChildren(CompoundPredicate._tagName).iterator();
while( it2.hasNext() )
__objCompoundPredicate.addCompoundPredicate1(CompoundPredicate.unmarshal((com.borland.xml.toolkit.Element)it2.next()));
/** Unmarshals a list of "<<_tagName_>>" elements back to SimpleSetPredicate objects. */
Iterator it3 = elem.getChildren(SimpleSetPredicate._tagName).iterator();
while( it3.hasNext() )
__objCompoundPredicate.addSimpleSetPredicate1(SimpleSetPredicate.unmarshal((com.borland.xml.toolkit.Element)it3.next()));
/** Unmarshals a list of "<<_tagName_>>" elements back to True objects. */
Iterator it4 = elem.getChildren(True._tagName).iterator();
while( it4.hasNext() )
__objCompoundPredicate.addTrue1(True.unmarshal((com.borland.xml.toolkit.Element)it4.next()));
/** Unmarshals a list of "<<_tagName_>>" elements back to False objects. */
Iterator it5 = elem.getChildren(False._tagName).iterator();
while( it5.hasNext() )
__objCompoundPredicate.addFalse1(False.unmarshal((com.borland.xml.toolkit.Element)it5.next()));
return __objCompoundPredicate;
}
/**
* Validates this object. If you pass <code>true</code> to this method, it
* checks for the first error and stops. On the other hand, if you pass
* <code>false</code> to this method, it collects all the errors by
* visiting every available elements.
* @param firstError <code>true</code> to exit this method when the first error
* is found; <code>false</code> to collect all errors.
* @return com.borland.xml.toolkit.ErrorList A list that contains one or more errors.
* @see com.borland.xml.toolkit.XmlObject#validate()
* @see com.borland.xml.toolkit.XmlObject#isValid()
* @see com.borland.xml.toolkit.ErrorList
*/
public com.borland.xml.toolkit.ErrorList validate(boolean firstError)
{
com.borland.xml.toolkit.ErrorList errors = new com.borland.xml.toolkit.ErrorList();
/** "or" block */
if( _objSimplePredicate != null || _objCompoundPredicate != null || _objSimpleSetPredicate != null || _objTrue != null )
{
/** "or" block */
if( _objSimplePredicate != null || _objCompoundPredicate != null || _objSimpleSetPredicate != null )
{
/** "or" block */
if( _objSimplePredicate != null || _objCompoundPredicate != null )
{
/** "or" block */
if( _objSimplePredicate != null )
{
/** SimplePredicate is mandatory */
if( _objSimplePredicate != null )
errors.add(_objSimplePredicate.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( _objCompoundPredicate != null )
{
/** CompoundPredicate is mandatory */
if( _objCompoundPredicate != null )
errors.add(_objCompoundPredicate.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objSimplePredicate != null) && !(_objCompoundPredicate != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objSimpleSetPredicate != null )
{
/** SimpleSetPredicate is mandatory */
if( _objSimpleSetPredicate != null )
errors.add(_objSimpleSetPredicate.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objSimplePredicate != null || _objCompoundPredicate != null) && !(_objSimpleSetPredicate != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objTrue != null )
{
/** True is mandatory */
if( _objTrue != null )
errors.add(_objTrue.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, True.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objSimplePredicate != null || _objCompoundPredicate != null || _objSimpleSetPredicate != null) && !(_objTrue != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, True.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objFalse != null )
{
/** False is mandatory */
if( _objFalse != null )
errors.add(_objFalse.validate(firstError));
else
errors.add(new com.borland.xml.toolkit.ElementError(this, False.class));
if( firstError && errors.size() > 0 )
return errors;
}
if( !(_objSimplePredicate != null || _objCompoundPredicate != null || _objSimpleSetPredicate != null || _objTrue != null) && !(_objFalse != null) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, True.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, False.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
/** "or" block */
if( _objSimplePredicate1.size() > 0 || _objCompoundPredicate1.size() > 0 || _objSimpleSetPredicate1.size() > 0 || _objTrue1.size() > 0 )
{
/** "or" block */
if( _objSimplePredicate1.size() > 0 || _objCompoundPredicate1.size() > 0 || _objSimpleSetPredicate1.size() > 0 )
{
/** "or" block */
if( _objSimplePredicate1.size() > 0 || _objCompoundPredicate1.size() > 0 )
{
/** "or" block */
if( _objSimplePredicate1.size() > 0 )
{
/** SimplePredicate is one or more */
if( _objSimplePredicate1.size() == 0 )
{
errors.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
if( firstError )
return errors;
}
else
{
Iterator it1 = _objSimplePredicate1.iterator();
while( it1.hasNext() )
{
SimplePredicate obj = (SimplePredicate)it1.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
}
}
if( _objCompoundPredicate1.size() > 0 )
{
/** CompoundPredicate is one or more */
if( _objCompoundPredicate1.size() == 0 )
{
errors.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
if( firstError )
return errors;
}
else
{
Iterator it2 = _objCompoundPredicate1.iterator();
while( it2.hasNext() )
{
CompoundPredicate obj = (CompoundPredicate)it2.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
}
}
if( !(_objSimplePredicate1.size() > 0) && !(_objCompoundPredicate1.size() > 0) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objSimpleSetPredicate1.size() > 0 )
{
/** SimpleSetPredicate is one or more */
if( _objSimpleSetPredicate1.size() == 0 )
{
errors.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
if( firstError )
return errors;
}
else
{
Iterator it3 = _objSimpleSetPredicate1.iterator();
while( it3.hasNext() )
{
SimpleSetPredicate obj = (SimpleSetPredicate)it3.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
}
}
if( !(_objSimplePredicate1.size() > 0 || _objCompoundPredicate1.size() > 0) && !(_objSimpleSetPredicate1.size() > 0) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objTrue1.size() > 0 )
{
/** True is one or more */
if( _objTrue1.size() == 0 )
{
errors.add(new com.borland.xml.toolkit.ElementError(this, True.class));
if( firstError )
return errors;
}
else
{
Iterator it4 = _objTrue1.iterator();
while( it4.hasNext() )
{
True obj = (True)it4.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
}
}
if( !(_objSimplePredicate1.size() > 0 || _objCompoundPredicate1.size() > 0 || _objSimpleSetPredicate1.size() > 0) && !(_objTrue1.size() > 0) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, True.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
}
if( _objFalse1.size() > 0 )
{
/** False is one or more */
if( _objFalse1.size() == 0 )
{
errors.add(new com.borland.xml.toolkit.ElementError(this, False.class));
if( firstError )
return errors;
}
else
{
Iterator it5 = _objFalse1.iterator();
while( it5.hasNext() )
{
False obj = (False)it5.next();
if( obj != null )
{
errors.add(obj.validate(firstError));
if( firstError && errors.size() > 0 )
return errors;
}
}
}
}
if( !(_objSimplePredicate1.size() > 0 || _objCompoundPredicate1.size() > 0 || _objSimpleSetPredicate1.size() > 0 || _objTrue1.size() > 0) && !(_objFalse1.size() > 0) ) /** missing one or more elements? */
{
com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimplePredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, CompoundPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, SimpleSetPredicate.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, True.class));
errors1.add(new com.borland.xml.toolkit.ElementError(this, False.class));
errors.add(errors1);
if( firstError && errors.size() > 0 )
return errors;
}
return errors.size()==0 ? null : errors;
}
/**
* Returns a list containing all child elements. Each element in the list is a subclass
* of XmlObject.
*/
public java.util.List _getChildren()
{
java.util.List children = new java.util.ArrayList();
/** adds _objSimplePredicate */
if( _objSimplePredicate != null )
children.add(_objSimplePredicate);
/** adds _objCompoundPredicate */
if( _objCompoundPredicate != null )
children.add(_objCompoundPredicate);
/** adds _objSimpleSetPredicate */
if( _objSimpleSetPredicate != null )
children.add(_objSimpleSetPredicate);
/** adds _objTrue */
if( _objTrue != null )
children.add(_objTrue);
/** adds _objFalse */
if( _objFalse != null )
children.add(_objFalse);
/** adds _objSimplePredicate1 */
if( _objSimplePredicate1 != null && _objSimplePredicate1.size() > 0 )
children.add(_objSimplePredicate1);
/** adds _objCompoundPredicate1 */
if( _objCompoundPredicate1 != null && _objCompoundPredicate1.size() > 0 )
children.add(_objCompoundPredicate1);
/** adds _objSimpleSetPredicate1 */
if( _objSimpleSetPredicate1 != null && _objSimpleSetPredicate1.size() > 0 )
children.add(_objSimpleSetPredicate1);
/** adds _objTrue1 */
if( _objTrue1 != null && _objTrue1.size() > 0 )
children.add(_objTrue1);
/** adds _objFalse1 */
if( _objFalse1 != null && _objFalse1.size() > 0 )
children.add(_objFalse1);
return children;
}
/**
* Gets the tag name of this element.
*/
public String get_TagName()
{
return _tagName;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -