/** * The encodedLength (in octets) of the list of EncodedDataTypes * * @return encodedLength of the compositeType */ public int encodedLength() { int length = 0; for (final Type t : containedTypeByNameMap.values()) { if (t.isVariableLength()) { return Token.VARIABLE_LENGTH; } if (t.offsetAttribute() != -1) { length = t.offsetAttribute(); } if (t.presence() != Presence.CONSTANT) { length += t.encodedLength(); } } return length; }
/** * Check the composite for any specified offsets and validate they are correctly specified. * * @param node of the XML for this composite */ public void checkForValidOffsets(final Node node) { int offset = 0; for (final Type edt : containedTypeByNameMap.values()) { final int offsetAttribute = edt.offsetAttribute(); if (-1 != offsetAttribute) { if (offsetAttribute < offset) { XmlSchemaParser.handleError( node, String.format("composite element \"%s\" has incorrect offset specified", edt.name())); } offset = offsetAttribute; } offset += edt.encodedLength(); } }
type.offsetAttribute(refOffset);
for (final Type elementType : type.getTypeList()) if (elementType.offsetAttribute() != -1) offset = elementType.offsetAttribute();
/** * The encodedLength (in octets) of the list of EncodedDataTypes * * @return encodedLength of the compositeType */ public int encodedLength() { int length = 0; for (final Type t : containedTypeByNameMap.values()) { if (t.isVariableLength()) { return Token.VARIABLE_LENGTH; } if (t.offsetAttribute() != -1) { length = t.offsetAttribute(); } if (t.presence() != Presence.CONSTANT) { length += t.encodedLength(); } } return length; }
/** * The encodedLength (in octets) of the list of EncodedDataTypes * * @return encodedLength of the compositeType */ public int encodedLength() { int length = 0; for (final Type t : containedTypeByNameMap.values()) { if (t.isVariableLength()) { return Token.VARIABLE_LENGTH; } if (t.offsetAttribute() != -1) { length = t.offsetAttribute(); } if (t.presence() != Presence.CONSTANT) { length += t.encodedLength(); } } return length; }
/** * Check the composite for any specified offsets and validate they are correctly specified. * * @param node of the XML for this composite */ public void checkForValidOffsets(final Node node) { int offset = 0; for (final Type edt : containedTypeByNameMap.values()) { final int offsetAttribute = edt.offsetAttribute(); if (-1 != offsetAttribute) { if (offsetAttribute < offset) { XmlSchemaParser.handleError( node, String.format("composite element \"%s\" has incorrect offset specified", edt.name())); } offset = offsetAttribute; } offset += edt.encodedLength(); } }
/** * Check the composite for any specified offsets and validate they are correctly specified. * * @param node of the XML for this composite */ public void checkForValidOffsets(final Node node) { int offset = 0; for (final Type edt : containedTypeByNameMap.values()) { final int offsetAttribute = edt.offsetAttribute(); if (-1 != offsetAttribute) { if (offsetAttribute < offset) { XmlSchemaParser.handleError( node, String.format("composite element \"%s\" has incorrect offset specified", edt.name())); } offset = offsetAttribute; } offset += edt.encodedLength(); } }
type.offsetAttribute(refOffset);
type.offsetAttribute(refOffset);
for (final Type elementType : type.getTypeList()) if (elementType.offsetAttribute() != -1) offset = elementType.offsetAttribute();
for (final Type elementType : type.getTypeList()) if (elementType.offsetAttribute() != -1) offset = elementType.offsetAttribute();