Package com.tll.model.schema

Examples of com.tll.model.schema.PropertyType


        }
        throw new NullNodeInPropPathException(pp.toString(), pname);
      }

      // get the bound prop val type for this prop path element
      final PropertyType pvType = prop.getType();

      // non-relational prop val
      if(!pvType.isRelational()) {
        if(!atEnd) {
          throw new PropPathNodeMismatchException(pp.toString(), pname, pvType.toString(), "Relational");
        }
        return prop;
      }

      // related one prop val
      else if(pvType == PropertyType.RELATED_ONE) {
        if(indexed) {
          throw new PropPathNodeMismatchException(pp.toString(), pname, pvType.toString(), PropertyType.RELATED_MANY
              .toString());
        }
        final IModelRefProperty mrp = (IModelRefProperty) prop;
        if(atEnd) {
          return mrp;
View Full Code Here


  public static void validateClear(final Model source, final List<Model> visited) throws Exception {
    assert source != null;

    for(final Iterator<IModelProperty> itr = source.iterator(); itr.hasNext();) {
      final IModelProperty srcMp = itr.next();
      final PropertyType pvType = srcMp.getType();
      if(pvType.isValue()) {
        // require cleared property value
        final Object srcValue = srcMp.getValue();
        TestUtils.validateEmpty(srcValue);
      }
      else if(pvType == PropertyType.RELATED_ONE) {
View Full Code Here

      if(requireDistinctModelProperties) {
        // ensure distinct memory address
        TestUtils.validateNotEqualByMemoryAddress(srcProp, tgtProp);
      }

      final PropertyType pvType = srcProp.getType();
      if(pvType.isValue()) {
        // require logical equals
        final Object srcValue = srcProp.getValue();
        final Object tgtValue = tgtProp.getValue();
        TestUtils.validateEquals(srcValue, tgtValue);
      }
View Full Code Here

    }
    else {
      return;
    }

    final PropertyType ptype = prop.getType();
    if(ptype.isModelRef()) {
      // related one
      final TreeItem branch = new TreeItem(getModelRefHtml((IModelRefProperty) prop));
      parent.addItem(branch);
      final Model m = ((IModelRefProperty) prop).getModel();
      if(m != null) {
        for(final IModelProperty nprop : m) {
          addProp(nprop, branch, visited);
        }
      }
    }
    else if(ptype.isRelational()) {
      // related many
      final TreeItem branch = new TreeItem(getModelCollectionHtml((RelatedManyProperty) prop));
      parent.addItem(branch);
      for(final IndexedProperty ip : (RelatedManyProperty) prop) {
        addProp(ip, branch, visited);
      }
    }
    else {
      // non-relational value property
      assert ptype.isValue() == true;
      // don't enumerate the id property (its redundant)
      if(!Model.ID_PROPERTY.equals(prop.getPropertyName())) {
        parent.addItem(getPropValueHtml((IPropertyValue) prop));
      }
    }
View Full Code Here

TOP

Related Classes of com.tll.model.schema.PropertyType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.