Revision 527 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/dynobject/impl/DefaultDynField.java

View differences:

DefaultDynField.java
133 133
		this.mandatory = mandatory;
134 134
		this.theClass = null;
135 135
		this.validateElements = false;
136
		this.subtype = null;
136
		this.subtype = this.dataType.getSubtype();
137 137
		this.groupName = null;
138 138
		this.order = 0;
139 139
		this.hidden = false;
......
143 143
	public String toString() {
144 144
		StringBuffer buffer = new StringBuffer();
145 145

  
146
		buffer.append("DynField").append("[").append(this.hashCode()).append(
147
				"]").append("( ").append("name='").append(this.name).append(
148
				"', ").append("description='").append(this.description).append(
149
				"', ").append("dataType='").append(this.dataType).append(", ")
150
				.append("minValue='").append(this.minValue).append(", ")
151
				.append("maxValue='").append(this.maxValue).append(", ")
152
				.append("mandatory='").append(this.isMandatory()).append(", ")
146
		buffer.append("DynField").append("[").append(this.hashCode()).append("]")
147
		        .append("( ")
148
		        .append("name='").append(this.name).append("', ")
149
				.append("description='").append(this.description).append("', ")
150
                .append("type='").append(this.dataType.getName()).append("', ")
151
                .append("subType='").append(this.subtype).append("', ")
152
                .append("mandatory='").append(this.isMandatory()).append("', ")
153
                .append("defaultValue='").append(this.getDefaultValue()).append("', ")
154
                .append("dataType=[").append(this.dataType).append("], ")
155
				.append("minValue='").append(this.minValue).append("', ")
156
				.append("maxValue='").append(this.maxValue).append("', ")
153 157
				.append("persistent='").append(this.isPersistent())
154
				.append(", ").append("defaultValue='").append(
155
						this.getDefaultValue()).append(" )");
158
				.append(" )");
156 159
		return buffer.toString();
157 160
	}
158 161

  
......
193 196
		this.subtype = subtype;
194 197
		if( subtype!=null && this.dataType.getType() == DataTypes.DYNOBJECT ) {
195 198
			if( ToolsLocator.getDynObjectManager().get(subtype) == null ) {
196
				throw new IllegalArgumentException("DynClass '"+subtype+"' does not exist.");
199
				throw new IllegalArgumentException("DynClass '" + subtype + "' does not exist.");
197 200
			}
201
		}else if( subtype!=null && this.dataType.getType() == DataTypes.LIST && this.elementsType!=null && this.elementsType.getType() == DataTypes.DYNOBJECT ) {
202
		    if( ToolsLocator.getDynObjectManager().get(subtype) == null ) {
203
                throw new IllegalArgumentException("DynClass '" + subtype + "' does not exist.");
204
            }
205
		    this.elementsType.setSubtype(subtype);
198 206
		}
199 207
		return this;
200 208
	}
......
493 501
			}
494 502
		}
495 503
//
496
//      Esto no deberia hacer falta ya que cualquier asignacion pasa
497
//      Por el coerce.
504
//		This shouldn't be necessary since any assignment passes through the coerce function anyway
498 505
//
499 506
//		//if all the above is correct, then we should check that coercing is possible
500 507
//		try {

Also available in: Unified diff