├── .github └── workflows │ └── java-ci.yml ├── .gitignore ├── LICENSE.txt ├── README.md ├── pom.xml ├── settings.xml └── src ├── main └── java │ ├── com │ └── siemens │ │ └── ct │ │ └── exi │ │ └── core │ │ ├── CodingMode.java │ │ ├── Constants.java │ │ ├── DecodingOptions.java │ │ ├── EXIBodyDecoder.java │ │ ├── EXIBodyEncoder.java │ │ ├── EXIFactory.java │ │ ├── EXIStreamDecoder.java │ │ ├── EXIStreamEncoder.java │ │ ├── EncodingOptions.java │ │ ├── FidelityOptions.java │ │ ├── SchemaIdResolver.java │ │ ├── SelfContainedHandler.java │ │ ├── attributes │ │ ├── AttributeFactory.java │ │ ├── AttributeList.java │ │ ├── AttributeListImpl.java │ │ └── package.html │ │ ├── coder │ │ ├── AbstractEXIBodyCoder.java │ │ ├── AbstractEXIBodyDecoder.java │ │ ├── AbstractEXIBodyEncoder.java │ │ ├── AbstractEXIHeader.java │ │ ├── EXIBodyDecoderInOrder.java │ │ ├── EXIBodyDecoderInOrderSC.java │ │ ├── EXIBodyDecoderReordered.java │ │ ├── EXIBodyEncoderInOrder.java │ │ ├── EXIBodyEncoderInOrderSC.java │ │ ├── EXIBodyEncoderReordered.java │ │ ├── EXIHeaderDecoder.java │ │ ├── EXIHeaderEncoder.java │ │ ├── EXIStreamDecoderImpl.java │ │ ├── EXIStreamEncoderImpl.java │ │ └── package.html │ │ ├── container │ │ ├── DocType.java │ │ ├── NamespaceDeclaration.java │ │ ├── PreReadValue.java │ │ ├── ProcessingInstruction.java │ │ ├── ValueAndDatatype.java │ │ └── package.html │ │ ├── context │ │ ├── AbstractUriContext.java │ │ ├── GrammarContext.java │ │ ├── GrammarUriContext.java │ │ ├── QNameContext.java │ │ ├── UriContext.java │ │ └── package.html │ │ ├── datatype │ │ ├── AbstractBinaryDatatype.java │ │ ├── AbstractDatatype.java │ │ ├── BinaryBase64Datatype.java │ │ ├── BinaryHexDatatype.java │ │ ├── BooleanDatatype.java │ │ ├── BooleanFacetDatatype.java │ │ ├── Datatype.java │ │ ├── DatatypeID.java │ │ ├── DatetimeDatatype.java │ │ ├── DecimalDatatype.java │ │ ├── EnumDatatype.java │ │ ├── EnumerationDatatype.java │ │ ├── ExtendedStringDatatype.java │ │ ├── FloatDatatype.java │ │ ├── IntegerDatatype.java │ │ ├── ListDatatype.java │ │ ├── NBitUnsignedIntegerDatatype.java │ │ ├── RestrictedCharacterSetDatatype.java │ │ ├── StringDatatype.java │ │ ├── UnsignedIntegerDatatype.java │ │ ├── WhiteSpace.java │ │ ├── charset │ │ │ ├── AbstractRestrictedCharacterSet.java │ │ │ ├── CodePointCharacterSet.java │ │ │ ├── RestrictedCharacterSet.java │ │ │ ├── XSDBase64CharacterSet.java │ │ │ ├── XSDBooleanCharacterSet.java │ │ │ ├── XSDDateTimeCharacterSet.java │ │ │ ├── XSDDecimalCharacterSet.java │ │ │ ├── XSDDoubleCharacterSet.java │ │ │ ├── XSDHexBinaryCharacterSet.java │ │ │ ├── XSDIntegerCharacterSet.java │ │ │ ├── XSDStringCharacterSet.java │ │ │ └── package.html │ │ ├── package.html │ │ └── strings │ │ │ ├── AbstractStringCoder.java │ │ │ ├── BoundedStringDecoderImpl.java │ │ │ ├── BoundedStringEncoderImpl.java │ │ │ ├── StringCoder.java │ │ │ ├── StringDecoder.java │ │ │ ├── StringDecoderImpl.java │ │ │ ├── StringEncoder.java │ │ │ ├── StringEncoderImpl.java │ │ │ └── package.html │ │ ├── exceptions │ │ ├── EXIException.java │ │ ├── ErrorHandler.java │ │ ├── UnsupportedOption.java │ │ ├── XMLParsingException.java │ │ └── package.html │ │ ├── grammars │ │ ├── AbstractGrammars.java │ │ ├── Grammars.java │ │ ├── SchemaInformedGrammars.java │ │ ├── SchemaLessGrammars.java │ │ ├── event │ │ │ ├── AbstractDatatypeEvent.java │ │ │ ├── AbstractEvent.java │ │ │ ├── Attribute.java │ │ │ ├── AttributeGeneric.java │ │ │ ├── AttributeNS.java │ │ │ ├── Characters.java │ │ │ ├── CharactersGeneric.java │ │ │ ├── Comment.java │ │ │ ├── DatatypeEvent.java │ │ │ ├── DocType.java │ │ │ ├── EndDocument.java │ │ │ ├── EndElement.java │ │ │ ├── EntityReference.java │ │ │ ├── Event.java │ │ │ ├── EventType.java │ │ │ ├── NamespaceDeclaration.java │ │ │ ├── ProcessingInstruction.java │ │ │ ├── SelfContained.java │ │ │ ├── StartDocument.java │ │ │ ├── StartElement.java │ │ │ ├── StartElementGeneric.java │ │ │ ├── StartElementNS.java │ │ │ └── package.html │ │ ├── grammar │ │ │ ├── AbstractBuiltInContent.java │ │ │ ├── AbstractBuiltInGrammar.java │ │ │ ├── AbstractGrammar.java │ │ │ ├── AbstractSchemaInformedContent.java │ │ │ ├── AbstractSchemaInformedGrammar.java │ │ │ ├── BuiltInDocContent.java │ │ │ ├── BuiltInElement.java │ │ │ ├── BuiltInFragmentContent.java │ │ │ ├── BuiltInGrammar.java │ │ │ ├── BuiltInStartTag.java │ │ │ ├── DocEnd.java │ │ │ ├── Document.java │ │ │ ├── Fragment.java │ │ │ ├── Grammar.java │ │ │ ├── GrammarType.java │ │ │ ├── SchemaInformedDocContent.java │ │ │ ├── SchemaInformedElement.java │ │ │ ├── SchemaInformedFirstStartTag.java │ │ │ ├── SchemaInformedFirstStartTagGrammar.java │ │ │ ├── SchemaInformedFragmentContent.java │ │ │ ├── SchemaInformedGrammar.java │ │ │ ├── SchemaInformedStartTag.java │ │ │ ├── SchemaInformedStartTagGrammar.java │ │ │ └── package.html │ │ ├── package.html │ │ └── production │ │ │ ├── AbstractProduction.java │ │ │ ├── Production.java │ │ │ ├── SchemaInformedProduction.java │ │ │ ├── SchemaLessProduction.java │ │ │ └── package.html │ │ ├── helpers │ │ ├── DefaultEXIFactory.java │ │ ├── DefaultErrorHandler.java │ │ └── package.html │ │ ├── io │ │ ├── BitInputStream.java │ │ ├── BitOutputStream.java │ │ ├── channel │ │ │ ├── AbstractDecoderChannel.java │ │ │ ├── AbstractEncoderChannel.java │ │ │ ├── BitDecoderChannel.java │ │ │ ├── BitEncoderChannel.java │ │ │ ├── ByteDecoderChannel.java │ │ │ ├── ByteEncoderChannel.java │ │ │ ├── DecoderChannel.java │ │ │ ├── EncoderChannel.java │ │ │ └── package.html │ │ ├── compression │ │ │ └── EXIInflaterInputStream.java │ │ └── package.html │ │ ├── package.html │ │ ├── types │ │ ├── AbstractTypeCoder.java │ │ ├── AbstractTypeDecoder.java │ │ ├── AbstractTypeEncoder.java │ │ ├── BuiltIn.java │ │ ├── BuiltInType.java │ │ ├── DateTimeType.java │ │ ├── IntegerType.java │ │ ├── LexicalTypeDecoder.java │ │ ├── LexicalTypeEncoder.java │ │ ├── StringTypeDecoder.java │ │ ├── StringTypeEncoder.java │ │ ├── TypeCoder.java │ │ ├── TypeDecoder.java │ │ ├── TypeEncoder.java │ │ ├── TypedTypeDecoder.java │ │ ├── TypedTypeEncoder.java │ │ └── package.html │ │ ├── util │ │ ├── MethodsBag.java │ │ ├── package.html │ │ ├── sort │ │ │ ├── AttributeSort.java │ │ │ ├── QNameSort.java │ │ │ ├── StartElementSort.java │ │ │ └── package.html │ │ └── xml │ │ │ ├── QNameUtilities.java │ │ │ ├── XMLWhitespace.java │ │ │ └── package.html │ │ └── values │ │ ├── AbstractBinaryValue.java │ │ ├── AbstractValue.java │ │ ├── BinaryBase64Value.java │ │ ├── BinaryHexValue.java │ │ ├── BooleanValue.java │ │ ├── DateTimeValue.java │ │ ├── DecimalValue.java │ │ ├── FloatValue.java │ │ ├── IntegerValue.java │ │ ├── IntegerValueType.java │ │ ├── ListValue.java │ │ ├── QNameValue.java │ │ ├── StringValue.java │ │ ├── Value.java │ │ ├── ValueType.java │ │ └── package.html │ └── overview.html └── test └── java └── com └── siemens └── ct └── exi └── core ├── attributes └── AttributeListCoreTest.java ├── coder ├── EXIHeaderCoreTest.java └── SchemaLessCoreTest.java ├── datatype ├── AbstractCoreTestCase.java ├── BinaryCoreTest.java ├── BooleanCoreTest.java ├── DatetimeCoreTest.java ├── DecimalCoreTest.java ├── FloatCoreTest.java ├── IntegerCoreTest.java ├── ListCoreTest.java ├── NBitUnsignedIntegerCoreTest.java ├── StringCoreTest.java ├── StringTableCoreTest.java └── UnsignedIntegerCoreTest.java └── types └── TypeCoreTest.java /.github/workflows/java-ci.yml: -------------------------------------------------------------------------------- 1 | name: Java CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | - name: Set up JDK 8 12 | uses: actions/setup-java@v2 13 | with: 14 | java-version: '8' 15 | distribution: 'adopt' 16 | - name: Build with Maven 17 | run: mvn --batch-mode --update-snapshots verify 18 | # - name: Deploy with Maven 19 | # run: mvn deploy --settings settings.xml -DskipTests=true -B 20 | # env: 21 | # SONATYPE_USERNAME: daniel_peintner 22 | # secure: "V/MtY7NEa1wjYVXrvHpZj9kOxehDaOE+86evKTAZJEBqbmAi6nDU+rCKZ6ODJubsf0n6Y4nW2nC/x+8dSuUSLpQA+BoDozS6Topo60Qg/SCoN/7udnxL56o2EYq7aHLPaLPAEoyrZ1EuSwpg+z5Yb6ngQEzr74EG943LgXh/9iN6RG4jidsXULc7XlBflI0trRH9WnlmqXeiKDQWdER//tXmoFidja8rj+Hps78M5sfyJ93BKEZcFnxO1st+IqRX1qBv8WBhQRtQP/yZKkauRTSk8313JGBn/EUegdHDnRZXwbCAuUQ5qBInyGOAGaGC/0iJLIFWDr/BAQG/1Fo4ESf5VysbR7uR4ZpmNyID1erE/ebo8WK61klZFxiFa02Vj3L/pqWbfaplXVhHes2pC9yS/10J3hpgoNiq9hUfO1FVHB9EBVWVimMKqOVZbIAg/UED70YTZKxCRe2szvMVQXtPu7W7EnKIeEbVB5qZiYEp6Tw3/cl8EpTF0fYQR6jh58UuXaxjvGLzCmwGG4odkHcZOisQCREZolQnKROr0hq26QLZMW4gqXfCISPCwmMxxqGAN9OTAVclsIQpwEvH0rGCmpWnXiUhD5xE8SDdw7SZ7wJAhHA1zABO2ZHpIUCN/TRKLynjXkec5E4njs+BTD1kOyu7azGaf4QJEDO1za0=" 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .idea 3 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2007-2018 Siemens AG 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EXIficient 2 | 3 | EXIficient core part of the open source implementation of the W3C [Efficient XML Interchange](http://www.w3.org/TR/exi/) (EXI) format specification. 4 | 5 | [![Java CI](https://github.com/EXIficient/exificient-core/actions/workflows/java-ci.yml/badge.svg)](https://github.com/EXIficient/exificient-core/actions/workflows/java-ci.yml) 6 | -------------------------------------------------------------------------------- /settings.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | sonatype-nexus-snapshots 7 | ${env.SONATYPE_USERNAME} 8 | ${env.SONATYPE_PASSWORD} 9 | 10 | 11 | sonatype-nexus-staging 12 | ${env.SONATYPE_USERNAME} 13 | ${env.SONATYPE_PASSWORD} 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/EXIStreamDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core; 25 | 26 | import java.io.IOException; 27 | import java.io.InputStream; 28 | 29 | import com.siemens.ct.exi.core.exceptions.EXIException; 30 | 31 | /** 32 | * An EXI stream is an EXI header followed by an EXI body. The EXI body carries 33 | * the content of the document, while the EXI header communicates the options 34 | * used for encoding the EXI body. 35 | * 36 | *

37 | * Note: In case of multiple EXI documents with EXI Compression mode in one 38 | * stream or subsequent data in the stream/file one needs to provide the input 39 | * stream as PushbackInputStream with the size of at least 40 | * 41 | * DecodingOptions.PUSHBACK_BUFFER_SIZE. The reason for doing so is that the 42 | * Java inflater sometimes reads beyond the EXI channel/block and 43 | * PushbackInputStream allows us to push back this data so that it is not lost. 44 | *

45 | * 46 | * @author Daniel.Peintner.EXT@siemens.com 47 | * @author Richard.Kuntschke@siemens.com 48 | * 49 | */ 50 | 51 | public interface EXIStreamDecoder { 52 | 53 | public EXIBodyDecoder getBodyOnlyDecoder(InputStream is) 54 | throws EXIException, IOException; 55 | 56 | public EXIBodyDecoder decodeHeader(InputStream is) throws EXIException, 57 | IOException; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/EXIStreamEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core; 25 | 26 | import java.io.IOException; 27 | import java.io.OutputStream; 28 | 29 | import com.siemens.ct.exi.core.exceptions.EXIException; 30 | 31 | /** 32 | * An EXI stream is an EXI header followed by an EXI body. The EXI body carries 33 | * the content of the document, while the EXI header communicates the options 34 | * used for encoding the EXI body. 35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | 41 | public interface EXIStreamEncoder { 42 | 43 | public EXIBodyEncoder encodeHeader(OutputStream os) throws EXIException, 44 | IOException; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/SelfContainedHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core; 25 | 26 | import com.siemens.ct.exi.core.exceptions.EXIException; 27 | import com.siemens.ct.exi.core.io.channel.EncoderChannel; 28 | 29 | /** 30 | * The class allows you to keep track of selfContained elements. 31 | * 32 | * 33 | * @author Daniel.Peintner.EXT@siemens.com 34 | * @author Richard.Kuntschke@siemens.com 35 | * 36 | */ 37 | 38 | public interface SelfContainedHandler { 39 | 40 | /** 41 | * Receive notification of SC element. 42 | * 43 | * @param uri 44 | * namespaceURI of of SC element 45 | * @param localName 46 | * local-name of SC element 47 | * @param channel 48 | * encoder channel 49 | * 50 | * @throws EXIException 51 | * EXI exception 52 | */ 53 | public void scElement(String uri, String localName, EncoderChannel channel) 54 | throws EXIException; 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/attributes/AttributeFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.attributes; 25 | 26 | import com.siemens.ct.exi.core.EXIFactory; 27 | 28 | /** 29 | * Factory for creating attribute lists according to EXI Factory. 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class AttributeFactory { 37 | protected AttributeFactory() { 38 | } 39 | 40 | public static AttributeFactory newInstance() { 41 | return new AttributeFactory(); 42 | } 43 | 44 | public AttributeList createAttributeListInstance(EXIFactory exiFactory) { 45 | return new AttributeListImpl(exiFactory); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/attributes/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | Package to parse attributes. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/coder/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | Core functionality for EXIEncoder, EXIDecoder and EXIHeader. 13 | 14 |

Availability to use different classes for XML documents and/or 15 | fragments.

16 | 17 |

Package Specification

18 | 19 | // none // 20 | 21 |

Related Documentation

22 | 23 | // none // 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/container/DocType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.container; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class DocType { 34 | public final char[] name; 35 | public final char[] publicID; 36 | public final char[] systemID; 37 | public final char[] text; 38 | 39 | public DocType(char[] name, char[] publicID, char[] systemID, char[] text) { 40 | this.name = name; 41 | this.publicID = publicID; 42 | this.systemID = systemID; 43 | this.text = text; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/container/NamespaceDeclaration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.container; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class NamespaceDeclaration { 34 | public final String namespaceURI; 35 | public final String prefix; 36 | 37 | public NamespaceDeclaration(String namespaceURI, String prefix) { 38 | this.namespaceURI = namespaceURI; 39 | this.prefix = prefix; 40 | } 41 | 42 | @Override 43 | public boolean equals(Object o) { 44 | if (o instanceof NamespaceDeclaration) { 45 | NamespaceDeclaration other = (NamespaceDeclaration) o; 46 | return (namespaceURI.equals(other.namespaceURI) && prefix 47 | .equals(other.prefix)); 48 | } 49 | return false; 50 | } 51 | 52 | @Override 53 | public int hashCode() { 54 | return namespaceURI.hashCode() ^ prefix.hashCode(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/container/PreReadValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.container; 25 | 26 | import com.siemens.ct.exi.core.values.Value; 27 | 28 | /** 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public class PreReadValue { 36 | 37 | protected Value[] contentValues; 38 | protected int index; 39 | 40 | public PreReadValue(Value[] contentValues) { 41 | setValues(contentValues); 42 | } 43 | 44 | protected void setValues(Value[] contentValues) { 45 | this.contentValues = contentValues; 46 | this.index = 0; 47 | } 48 | 49 | public Value[] getValues() { 50 | return contentValues; 51 | } 52 | 53 | public Value getNextContantValue() { 54 | return contentValues[index++]; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/container/ProcessingInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.container; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class ProcessingInstruction { 34 | 35 | public final String target; 36 | public final String data; 37 | 38 | public ProcessingInstruction(String target, String data) { 39 | this.target = target; 40 | this.data = data; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/container/ValueAndDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.container; 25 | 26 | import com.siemens.ct.exi.core.datatype.Datatype; 27 | import com.siemens.ct.exi.core.values.Value; 28 | 29 | public class ValueAndDatatype { 30 | public final Value value; 31 | public final Datatype datatype; 32 | 33 | public ValueAndDatatype(Value value, Datatype datatype) { 34 | this.value = value; 35 | this.datatype = datatype; 36 | } 37 | 38 | @Override 39 | public String toString() { 40 | return "\"" + value + "\" AS " + datatype; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/container/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | Core containers while coding EXI documents/fragments. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/context/AbstractUriContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.context; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public abstract class AbstractUriContext implements UriContext { 34 | 35 | // namespace 36 | final int namespaceUriID; 37 | final String namespaceUri; 38 | 39 | public AbstractUriContext(int namespaceUriID, String namespaceUri) { 40 | this.namespaceUriID = namespaceUriID; 41 | this.namespaceUri = namespaceUri; 42 | } 43 | 44 | public final int getNamespaceUriID() { 45 | return namespaceUriID; 46 | } 47 | 48 | public final String getNamespaceUri() { 49 | return namespaceUri; 50 | } 51 | 52 | @Override 53 | public boolean equals(Object o) { 54 | if (o instanceof AbstractUriContext) { 55 | return ((AbstractUriContext) o).namespaceUriID == this.namespaceUriID; 56 | } 57 | return false; 58 | } 59 | 60 | public String toString() { 61 | return namespaceUriID + "," + namespaceUri; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/context/UriContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.context; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public interface UriContext { 34 | 35 | public int getNamespaceUriID(); 36 | 37 | public String getNamespaceUri(); 38 | 39 | public int getNumberOfQNames(); 40 | 41 | public int getNumberOfPrefixes(); 42 | 43 | public String getPrefix(int prefixID); 44 | 45 | public int getPrefixID(String prefix); 46 | 47 | public QNameContext getQNameContext(int localNameID); 48 | 49 | public QNameContext getQNameContext(String localName); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/context/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | Helper package for coding contexts (e.g., uris, qnames, ...) 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/AbstractBinaryDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public abstract class AbstractBinaryDatatype extends AbstractDatatype { 37 | 38 | public AbstractBinaryDatatype(BuiltInType binaryType, 39 | QNameContext schemaType) { 40 | super(binaryType, schemaType); 41 | assert (binaryType == BuiltInType.BINARY_BASE64 || binaryType == BuiltInType.BINARY_HEX); 42 | } 43 | 44 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/BinaryBase64Datatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class BinaryBase64Datatype extends AbstractBinaryDatatype { 37 | 38 | public BinaryBase64Datatype(QNameContext schemaType) { 39 | super(BuiltInType.BINARY_BASE64, schemaType); 40 | } 41 | 42 | public DatatypeID getDatatypeID() { 43 | return DatatypeID.exi_base64Binary; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/BinaryHexDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class BinaryHexDatatype extends AbstractBinaryDatatype { 37 | 38 | public BinaryHexDatatype(QNameContext schemaType) { 39 | super(BuiltInType.BINARY_HEX, schemaType); 40 | } 41 | 42 | public DatatypeID getDatatypeID() { 43 | return DatatypeID.exi_hexBinary; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/BooleanDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class BooleanDatatype extends AbstractDatatype { 37 | 38 | public BooleanDatatype(QNameContext schemaType) { 39 | super(BuiltInType.BOOLEAN, schemaType); 40 | } 41 | 42 | public DatatypeID getDatatypeID() { 43 | return DatatypeID.exi_boolean; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/BooleanFacetDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class BooleanFacetDatatype extends AbstractDatatype { 37 | 38 | public BooleanFacetDatatype(QNameContext schemaType) { 39 | super(BuiltInType.BOOLEAN_FACET, schemaType); 40 | } 41 | 42 | public DatatypeID getDatatypeID() { 43 | return DatatypeID.exi_boolean; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/Datatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public interface Datatype { 37 | 38 | // if no codec map is used 39 | public BuiltInType getBuiltInType(); 40 | 41 | // used for dtr map 42 | public QNameContext getSchemaType(); 43 | 44 | // base datatype 45 | public Datatype getBaseDatatype(); 46 | 47 | public void setBaseDatatype(Datatype baseDatatype); 48 | 49 | // Extension Extended String: 50 | // https://www.w3.org/XML/EXI/docs/extendedString/exi-extString.html 51 | public void setGrammarEnumeration(EnumDatatype grammarEnumeration); 52 | 53 | public EnumDatatype getGrammarEnumeration(); 54 | 55 | // whiteSpace 56 | public WhiteSpace getWhiteSpace(); 57 | 58 | // used for preserve lexicalValues 59 | public DatatypeID getDatatypeID(); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/DatatypeID.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public enum DatatypeID { 34 | /** exi:base64Binary */ 35 | exi_base64Binary, 36 | /** exi:hexBinary */ 37 | exi_hexBinary, 38 | /** exi:boolean */ 39 | exi_boolean, 40 | /** exi:dateTime */ 41 | exi_dateTime, 42 | /** exi:time */ 43 | exi_time, 44 | /** exi:date */ 45 | exi_date, 46 | /** exi:gYearMonth */ 47 | exi_gYearMonth, 48 | /** exi:gYear */ 49 | exi_gYear, 50 | /** exi:gMonthDay */ 51 | exi_gMonthDay, 52 | /** exi:gDay */ 53 | exi_gDay, 54 | /** exi:gMonth */ 55 | exi_gMonth, 56 | /** exi:decimal */ 57 | exi_decimal, 58 | /** exi:double */ 59 | exi_double, 60 | /** exi:integer */ 61 | exi_integer, 62 | /** exi:string */ 63 | exi_string, 64 | /** exi:estring */ 65 | exi_estring 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/DecimalDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | import com.siemens.ct.exi.core.values.DecimalValue; 29 | 30 | /** 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class DecimalDatatype extends AbstractDatatype { 38 | 39 | protected DecimalValue lastValidDecimal; 40 | 41 | public DecimalDatatype(QNameContext schemaType) { 42 | super(BuiltInType.DECIMAL, schemaType); 43 | } 44 | 45 | public DatatypeID getDatatypeID() { 46 | return DatatypeID.exi_decimal; 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/EnumDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.values.Value; 27 | 28 | /** 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public interface EnumDatatype extends Datatype { 36 | 37 | public int getCodingLength(); 38 | 39 | public int getEnumerationSize(); 40 | 41 | public Value getEnumValue(int i); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/ExtendedStringDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import java.util.List; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.types.BuiltInType; 30 | 31 | /** 32 | * 33 | * @author Daniel.Peintner.EXT@siemens.com 34 | * @author Richard.Kuntschke@siemens.com 35 | * 36 | */ 37 | 38 | public class ExtendedStringDatatype extends AbstractDatatype { 39 | 40 | protected String lastValue; 41 | 42 | protected List sharedStrings; 43 | protected EnumDatatype grammarStrings; 44 | 45 | public ExtendedStringDatatype(QNameContext schemaType) { 46 | // default whiteSpace facet for string is preserve 47 | this(schemaType, WhiteSpace.preserve); 48 | } 49 | 50 | public ExtendedStringDatatype(QNameContext schemaType, WhiteSpace whiteSpace) { 51 | super(BuiltInType.EXTENDED_STRING, schemaType); 52 | 53 | /* default whiteSpace facet for string is preserve */ 54 | this.whiteSpace = whiteSpace; 55 | } 56 | 57 | public void setSharedStrings(List sharedStrings) { 58 | this.sharedStrings = sharedStrings; 59 | } 60 | 61 | public void setGrammarStrings(EnumDatatype grammarStrings) { 62 | this.grammarStrings = grammarStrings; 63 | } 64 | 65 | public EnumDatatype getGrammarStrings() { 66 | return this.grammarStrings; 67 | } 68 | 69 | public DatatypeID getDatatypeID() { 70 | return DatatypeID.exi_estring; 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/FloatDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class FloatDatatype extends AbstractDatatype { 37 | 38 | public FloatDatatype(QNameContext schemaType) { 39 | super(BuiltInType.FLOAT, schemaType); 40 | } 41 | 42 | public DatatypeID getDatatypeID() { 43 | return DatatypeID.exi_double; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/IntegerDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class IntegerDatatype extends AbstractDatatype { 37 | 38 | public IntegerDatatype(QNameContext schemaType) { 39 | super(BuiltInType.INTEGER, schemaType); 40 | } 41 | 42 | public DatatypeID getDatatypeID() { 43 | return DatatypeID.exi_integer; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/ListDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class ListDatatype extends AbstractDatatype { 37 | 38 | private Datatype listDatatype; 39 | 40 | public ListDatatype(Datatype listDatatype, QNameContext schemaType) { 41 | super(BuiltInType.LIST, schemaType); 42 | 43 | if (listDatatype.getBuiltInType() == BuiltInType.LIST) { 44 | throw new IllegalArgumentException(); 45 | } 46 | 47 | this.listDatatype = listDatatype; 48 | } 49 | 50 | public DatatypeID getDatatypeID() { 51 | return listDatatype.getDatatypeID(); 52 | } 53 | 54 | public Datatype getListDatatype() { 55 | return listDatatype; 56 | } 57 | 58 | @Override 59 | public boolean equals(Object o) { 60 | if (super.equals(o) && o instanceof ListDatatype) { 61 | ListDatatype l = (ListDatatype) o; 62 | return (this.listDatatype.equals(l.listDatatype)); 63 | } 64 | return false; 65 | } 66 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/RestrictedCharacterSetDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.datatype.charset.RestrictedCharacterSet; 28 | import com.siemens.ct.exi.core.types.BuiltInType; 29 | 30 | /** 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class RestrictedCharacterSetDatatype extends AbstractDatatype { 38 | 39 | protected RestrictedCharacterSet rcs; 40 | 41 | public RestrictedCharacterSetDatatype(RestrictedCharacterSet rcs, 42 | QNameContext schemaType) { 43 | // default whiteSpace facet for string is preserve 44 | this(rcs, schemaType, WhiteSpace.preserve); 45 | } 46 | 47 | public RestrictedCharacterSetDatatype(RestrictedCharacterSet rcs, 48 | QNameContext schemaType, WhiteSpace whiteSpace) { 49 | super(BuiltInType.RCS_STRING, schemaType); 50 | this.rcs = rcs; 51 | this.whiteSpace = whiteSpace; 52 | } 53 | 54 | public RestrictedCharacterSet getRestrictedCharacterSet() { 55 | return this.rcs; 56 | } 57 | 58 | public DatatypeID getDatatypeID() { 59 | return DatatypeID.exi_string; 60 | } 61 | 62 | @Override 63 | public boolean equals(Object o) { 64 | if (super.equals(o) && o instanceof RestrictedCharacterSetDatatype) { 65 | RestrictedCharacterSetDatatype r = (RestrictedCharacterSetDatatype) o; 66 | return (this.rcs.equals(r.rcs)); 67 | } 68 | return false; 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/StringDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class StringDatatype extends AbstractDatatype { 37 | 38 | protected final boolean isDerivedByUnion; 39 | 40 | public StringDatatype(QNameContext schemaType) { 41 | // default whiteSpace facet for string is preserve 42 | this(schemaType, WhiteSpace.preserve); 43 | } 44 | 45 | public StringDatatype(QNameContext schemaType, WhiteSpace whiteSpace) { 46 | this(schemaType, false); 47 | /* default whiteSpace facet for string is preserve */ 48 | this.whiteSpace = whiteSpace; 49 | } 50 | 51 | public DatatypeID getDatatypeID() { 52 | return DatatypeID.exi_string; 53 | } 54 | 55 | public StringDatatype(QNameContext schemaType, boolean isDerivedByUnion) { 56 | super(BuiltInType.STRING, schemaType); 57 | this.isDerivedByUnion = isDerivedByUnion; 58 | } 59 | 60 | public boolean isDerivedByUnion() { 61 | return isDerivedByUnion; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/UnsignedIntegerDatatype.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | import com.siemens.ct.exi.core.context.QNameContext; 27 | import com.siemens.ct.exi.core.types.BuiltInType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class UnsignedIntegerDatatype extends AbstractDatatype { 37 | 38 | public UnsignedIntegerDatatype(QNameContext schemaType) { 39 | super(BuiltInType.UNSIGNED_INTEGER, schemaType); 40 | } 41 | 42 | public DatatypeID getDatatypeID() { 43 | return DatatypeID.exi_integer; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/WhiteSpace.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype; 25 | 26 | /** 27 | * WhiteSpace constrains the value space of types derived from string. The value 28 | * of whiteSpace must be one of {preserve, replace, collapse}. For all atomic 29 | * datatypes other than string (and types derived by restriction from it) the 30 | * value of whiteSpace is collapse. For string the default value of whiteSpace 31 | * is preserve. {@link}http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace 32 | */ 33 | public enum WhiteSpace { 34 | /** 35 | * No normalization is done, the value is not changed (this is the behavior 36 | * required by [XML 1.0 (Second Edition)] for element content) 37 | */ 38 | preserve, 39 | /** 40 | * All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) 41 | * are replaced with #x20 (space) 42 | */ 43 | replace, 44 | /** 45 | * After the processing implied by replace, contiguous sequences of #x20's 46 | * are collapsed to a single #x20, and leading and trailing #x20's are 47 | * removed. 48 | */ 49 | collapse 50 | /* 51 | * Note: The notation #xA used here represents the Universal Character Set 52 | * (UCS) code point hexadecimal A (line feed), which is denoted by U+000A. 53 | * This notation is to be distinguished from , which is the XML 54 | * character reference to that same UCS code point. 55 | */ 56 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/CodePointCharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | import java.util.ArrayList; 27 | import java.util.Collections; 28 | import java.util.Iterator; 29 | import java.util.List; 30 | import java.util.Set; 31 | 32 | /** 33 | * Utility class to build a RestrictedCharacterSet by a given Set. 34 | * 35 | * @author Daniel.Peintner.EXT@siemens.com 36 | * @author Richard.Kuntschke@siemens.com 37 | * 38 | */ 39 | 40 | public class CodePointCharacterSet extends AbstractRestrictedCharacterSet { 41 | 42 | public CodePointCharacterSet(Set codePoints) { 43 | super(); 44 | // sort code-points by UCS 45 | List sortedCodePoints = new ArrayList(); 46 | sortedCodePoints.addAll(codePoints); 47 | Collections.sort(sortedCodePoints); 48 | 49 | // iterate over characters 50 | Iterator iter = sortedCodePoints.iterator(); 51 | while (iter.hasNext()) { 52 | addValue(iter.next()); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/XSDBase64CharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | import com.siemens.ct.exi.core.util.xml.XMLWhitespace; 27 | 28 | /** 29 | * Built-In Restricted Character Set for xsd:base64Binary 30 | * http://www.w3.org/TR/exi/#builtInRestrictedStrings 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class XSDBase64CharacterSet extends AbstractRestrictedCharacterSet { 38 | 39 | /* 40 | * xsd:base64Binary { #x9, #xA, #xD, #x20, +, /, [0-9], =, [A-Z], [a-z] } 41 | */ 42 | public XSDBase64CharacterSet() { 43 | super(); 44 | // #x9, #xA, #xD, #x20 45 | addValue(XMLWhitespace.WS_TAB); 46 | addValue(XMLWhitespace.WS_NL); 47 | addValue(XMLWhitespace.WS_CR); 48 | addValue(XMLWhitespace.WS_SPACE); 49 | // +, / 50 | addValue('+'); 51 | addValue('/'); 52 | // [0-9] 53 | for (int i = '0'; i <= '9'; i++) { 54 | addValue((char) i); 55 | } 56 | // = 57 | addValue('='); 58 | // [A-Z] 59 | for (int i = 'A'; i <= 'Z'; i++) { 60 | addValue((char) i); 61 | } 62 | // [a-z] 63 | for (int i = 'a'; i <= 'z'; i++) { 64 | addValue((char) i); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/XSDBooleanCharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | import com.siemens.ct.exi.core.util.xml.XMLWhitespace; 27 | 28 | /** 29 | * Built-In Restricted Character Set for xsd:boolean 30 | * http://www.w3.org/TR/exi/#builtInRestrictedStrings 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class XSDBooleanCharacterSet extends AbstractRestrictedCharacterSet { 38 | 39 | /* 40 | * xsd:boolean { #x9, #xA, #xD, #x20, 0, 1, a, e, f, l, r, s, t, u } 41 | */ 42 | public XSDBooleanCharacterSet() { 43 | super(); 44 | // #x9, #xA, #xD, #x20 45 | addValue(XMLWhitespace.WS_TAB); 46 | addValue(XMLWhitespace.WS_NL); 47 | addValue(XMLWhitespace.WS_CR); 48 | addValue(XMLWhitespace.WS_SPACE); 49 | // 0, 1 50 | addValue('0'); 51 | addValue('1'); 52 | // a, e, f, l, r, s, t, u 53 | addValue('a'); 54 | addValue('e'); 55 | addValue('f'); 56 | addValue('l'); 57 | addValue('r'); 58 | addValue('s'); 59 | addValue('t'); 60 | addValue('u'); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/XSDDateTimeCharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | import com.siemens.ct.exi.core.util.xml.XMLWhitespace; 27 | 28 | /** 29 | * Built-In Restricted Character Set for xsd:dateTime 30 | * http://www.w3.org/TR/exi/#builtInRestrictedStrings 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class XSDDateTimeCharacterSet extends AbstractRestrictedCharacterSet { 38 | 39 | /* 40 | * xsd:dateTime { #x9, #xA, #xD, #x20, +, -, ., [0-9], :, T, Z } 41 | */ 42 | public XSDDateTimeCharacterSet() { 43 | super(); 44 | // #x9, #xA, #xD, #x20 45 | addValue(XMLWhitespace.WS_TAB); 46 | addValue(XMLWhitespace.WS_NL); 47 | addValue(XMLWhitespace.WS_CR); 48 | addValue(XMLWhitespace.WS_SPACE); 49 | // +, -, . 50 | addValue('+'); 51 | addValue('-'); 52 | addValue('.'); 53 | // [0-9] 54 | for (int i = '0'; i <= '9'; i++) { 55 | addValue((char) i); 56 | } 57 | // :, T, Z 58 | addValue(':'); 59 | addValue('T'); 60 | addValue('Z'); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/XSDDecimalCharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | import com.siemens.ct.exi.core.util.xml.XMLWhitespace; 27 | 28 | /** 29 | * Built-In Restricted Character Set for xsd:decimal 30 | * http://www.w3.org/TR/exi/#builtInRestrictedStrings 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class XSDDecimalCharacterSet extends AbstractRestrictedCharacterSet { 38 | 39 | /* 40 | * xsd:decimal { #x9, #xA, #xD, #x20, +, -, ., [0-9] } 41 | */ 42 | public XSDDecimalCharacterSet() { 43 | super(); 44 | // #x9, #xA, #xD, #x20 45 | addValue(XMLWhitespace.WS_TAB); 46 | addValue(XMLWhitespace.WS_NL); 47 | addValue(XMLWhitespace.WS_CR); 48 | addValue(XMLWhitespace.WS_SPACE); 49 | // +, -, . 50 | addValue('+'); 51 | addValue('-'); 52 | addValue('.'); 53 | // [0-9] 54 | for (int i = '0'; i <= '9'; i++) { 55 | addValue((char) i); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/XSDDoubleCharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | import com.siemens.ct.exi.core.util.xml.XMLWhitespace; 27 | 28 | /** 29 | * Built-In Restricted Character Set for xsd:double 30 | * http://www.w3.org/TR/exi/#builtInRestrictedStrings 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class XSDDoubleCharacterSet extends AbstractRestrictedCharacterSet { 38 | 39 | /* 40 | * xsd:double { #x9, #xA, #xD, #x20, +, -, ., [0-9], E, F, I, N, a, e } 41 | */ 42 | public XSDDoubleCharacterSet() { 43 | super(); 44 | // #x9, #xA, #xD, #x20 45 | addValue(XMLWhitespace.WS_TAB); 46 | addValue(XMLWhitespace.WS_NL); 47 | addValue(XMLWhitespace.WS_CR); 48 | addValue(XMLWhitespace.WS_SPACE); 49 | // +, -, . 50 | addValue('+'); 51 | addValue('-'); 52 | addValue('.'); 53 | // [0-9] 54 | for (int i = '0'; i <= '9'; i++) { 55 | addValue((char) i); 56 | } 57 | // E, F, I, N, a, e 58 | addValue('E'); 59 | addValue('F'); 60 | addValue('I'); 61 | addValue('N'); 62 | addValue('a'); 63 | addValue('e'); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/XSDHexBinaryCharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | import com.siemens.ct.exi.core.util.xml.XMLWhitespace; 27 | 28 | /** 29 | * Built-In Restricted Character Set for xsd:hexBinary 30 | * http://www.w3.org/TR/exi/#builtInRestrictedStrings 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class XSDHexBinaryCharacterSet extends AbstractRestrictedCharacterSet { 38 | 39 | /* 40 | * xsd:hexBinary { #x9, #xA, #xD, #x20, [0-9], [A-F], [a-f] } 41 | */ 42 | public XSDHexBinaryCharacterSet() { 43 | super(); 44 | // #x9, #xA, #xD, #x20 45 | addValue(XMLWhitespace.WS_TAB); 46 | addValue(XMLWhitespace.WS_NL); 47 | addValue(XMLWhitespace.WS_CR); 48 | addValue(XMLWhitespace.WS_SPACE); 49 | // [0-9] 50 | for (int i = '0'; i <= '9'; i++) { 51 | addValue((char) i); 52 | } 53 | // [A-F] 54 | for (int i = 'A'; i <= 'F'; i++) { 55 | addValue((char) i); 56 | } 57 | // [a-f] 58 | for (int i = 'a'; i <= 'f'; i++) { 59 | addValue((char) i); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/XSDIntegerCharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | import com.siemens.ct.exi.core.util.xml.XMLWhitespace; 27 | 28 | /** 29 | * Built-In Restricted Character Set for xsd:integer 30 | * http://www.w3.org/TR/exi/#builtInRestrictedStrings 31 | * 32 | * @author Daniel.Peintner.EXT@siemens.com 33 | * @author Richard.Kuntschke@siemens.com 34 | * 35 | */ 36 | 37 | public class XSDIntegerCharacterSet extends AbstractRestrictedCharacterSet { 38 | 39 | /* 40 | * xsd:integer { #x9, #xA, #xD, #x20, +, -, [0-9] } 41 | */ 42 | public XSDIntegerCharacterSet() { 43 | super(); 44 | // #x9, #xA, #xD, #x20 45 | addValue(XMLWhitespace.WS_TAB); 46 | addValue(XMLWhitespace.WS_NL); 47 | addValue(XMLWhitespace.WS_CR); 48 | addValue(XMLWhitespace.WS_SPACE); 49 | // +, - 50 | addValue('+'); 51 | addValue('-'); 52 | // [0-9] 53 | for (int i = '0'; i <= '9'; i++) { 54 | addValue((char) i); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/XSDStringCharacterSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.charset; 25 | 26 | /** 27 | * Built-In Restricted Character Set for xsd:integer 28 | * http://www.w3.org/TR/exi/#builtInRestrictedStrings 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public class XSDStringCharacterSet extends AbstractRestrictedCharacterSet { 36 | 37 | /* 38 | * xsd:string 39 | */ 40 | public XSDStringCharacterSet() { 41 | super(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/charset/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI may use restricted character sets retrieved from XML Schema facets/patterns. 13 |
14 | In addition a given CharSet is provided for built-in datatypes such as boolean, integer, et cetera. 15 | 16 |

Package Specification

17 | 18 | // none // 19 | 20 |

Related Documentation

21 | 22 | // none // 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI built-in datatypes. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/strings/StringCoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.strings; 25 | 26 | import java.util.List; 27 | 28 | import com.siemens.ct.exi.core.Constants; 29 | import com.siemens.ct.exi.core.context.QNameContext; 30 | import com.siemens.ct.exi.core.values.StringValue; 31 | 32 | /** 33 | * 34 | * @author Daniel.Peintner.EXT@siemens.com 35 | * @author Richard.Kuntschke@siemens.com 36 | * 37 | */ 38 | 39 | public interface StringCoder { 40 | 41 | public static final StringValue EMPTY_STRING_VALUE = new StringValue( 42 | Constants.EMPTY_STRING); 43 | 44 | public static final int DEFAULT_INITIAL_QNAME_LISTS = 60; 45 | 46 | public int getNumberOfStringValues(QNameContext qnc); 47 | 48 | public void clear(); 49 | 50 | public void setSharedStrings(List sharedStrings); 51 | 52 | public boolean isLocalValuePartitions(); 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/strings/StringDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.strings; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.io.channel.DecoderChannel; 30 | import com.siemens.ct.exi.core.values.StringValue; 31 | 32 | /** 33 | * 34 | * @author Daniel.Peintner.EXT@siemens.com 35 | * @author Richard.Kuntschke@siemens.com 36 | * 37 | */ 38 | 39 | public interface StringDecoder extends StringCoder { 40 | 41 | public void addValue(QNameContext qnContext, StringValue value); 42 | 43 | public StringValue readValue(QNameContext qnContext, DecoderChannel channel) 44 | throws IOException; 45 | 46 | public StringValue readValueLocalHit(QNameContext qnContext, 47 | DecoderChannel valueChannel) throws IOException; 48 | 49 | public StringValue readValueGlobalHit(DecoderChannel valueChannel) 50 | throws IOException; 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/strings/StringEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.datatype.strings; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | 32 | */ 33 | 34 | import java.io.IOException; 35 | 36 | import com.siemens.ct.exi.core.context.QNameContext; 37 | import com.siemens.ct.exi.core.datatype.strings.StringEncoderImpl.ValueContainer; 38 | import com.siemens.ct.exi.core.io.channel.EncoderChannel; 39 | 40 | public interface StringEncoder extends StringCoder { 41 | 42 | public void addValue(QNameContext qnContext, String value); 43 | 44 | public void writeValue(QNameContext qnContext, EncoderChannel valueChannel, 45 | String value) throws IOException; 46 | 47 | public boolean isStringHit(String value) throws IOException; 48 | 49 | public ValueContainer getValueContainer(String value); 50 | 51 | public int getValueContainerSize(); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/datatype/strings/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI StringTable implementation. 13 | 14 |

EXI uses a string table to assign "compact identifiers" to some 15 | string values. Occurrences of string values found in the string table 16 | are represented using the associated compact identifier rather than 17 | encoding the entire "string literal".

18 | 19 |

Package Specification

20 | 21 | // none // 22 | 23 |

Related Documentation

24 | 25 | // none // 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/exceptions/EXIException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.exceptions; 25 | 26 | /** 27 | * EXI Exception 28 | * 29 | * @author Daniel.Peintner.EXT@siemens.com 30 | * @author Richard.Kuntschke@siemens.com 31 | * 32 | */ 33 | 34 | public class EXIException extends Exception { 35 | /** 36 | * 37 | */ 38 | private static final long serialVersionUID = -8954797101782288026L; 39 | 40 | public EXIException() { 41 | super(); 42 | } 43 | 44 | public EXIException(String message) { 45 | super(message); 46 | } 47 | 48 | public EXIException(String message, Throwable cause) { 49 | super(message, cause); 50 | } 51 | 52 | public EXIException(Throwable cause) { 53 | super(cause); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/exceptions/ErrorHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.exceptions; 25 | 26 | /** 27 | * Basic interface for EXI error handlers. 28 | * 29 | *

30 | * If a EXI application needs to implement customized error handling, it must 31 | * implement this interface and then register an instance. 32 | *

33 | * 34 | * @author Daniel.Peintner.EXT@siemens.com 35 | * @author Richard.Kuntschke@siemens.com 36 | * 37 | */ 38 | 39 | public interface ErrorHandler { 40 | /** 41 | * Receive notification of a warning. 42 | * 43 | *

44 | * Parsers will use this method to report conditions that are not errors. 45 | *

46 | * 47 | * 48 | * @param exception 49 | * The warning information encapsulated in a EXI exception. 50 | */ 51 | public void warning(EXIException exception); 52 | 53 | /** 54 | * Receive notification of a recoverable error. 55 | * 56 | * @param exception 57 | * The error information encapsulated in a EXI exception. 58 | */ 59 | public void error(EXIException exception); 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/exceptions/UnsupportedOption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.exceptions; 25 | 26 | /** 27 | * Unsupported option 28 | * 29 | * @author Daniel.Peintner.EXT@siemens.com 30 | * @author Richard.Kuntschke@siemens.com 31 | * 32 | */ 33 | 34 | public class UnsupportedOption extends EXIException { 35 | /** 36 | * 37 | */ 38 | private static final long serialVersionUID = -8859158367056532581L; 39 | 40 | public UnsupportedOption(String msg) { 41 | super(msg); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/exceptions/XMLParsingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.exceptions; 25 | 26 | /** 27 | * XML parsing exception. 28 | * 29 | * @author Daniel.Peintner.EXT@siemens.com 30 | * @author Richard.Kuntschke@siemens.com 31 | * 32 | */ 33 | 34 | public class XMLParsingException extends EXIException { 35 | 36 | /** 37 | * 38 | */ 39 | private static final long serialVersionUID = -1568757949406610062L; 40 | 41 | public XMLParsingException(String message) { 42 | super(message); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/exceptions/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI Exception collection. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/AbstractDatatypeEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | import com.siemens.ct.exi.core.datatype.Datatype; 27 | 28 | /** 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public abstract class AbstractDatatypeEvent extends AbstractEvent implements 36 | DatatypeEvent { 37 | 38 | protected final Datatype datatype; 39 | 40 | public AbstractDatatypeEvent(EventType eventType, Datatype datatype) { 41 | super(eventType); 42 | this.datatype = datatype; 43 | } 44 | 45 | public Datatype getDatatype() { 46 | return datatype; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return super.toString() + "[" + datatype + "]"; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/AbstractEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public abstract class AbstractEvent implements Event { 34 | 35 | protected final EventType eventType; 36 | 37 | public AbstractEvent(EventType eventType) { 38 | this.eventType = eventType; 39 | } 40 | 41 | public final EventType getEventType() { 42 | return eventType; 43 | } 44 | 45 | public boolean isEventType(EventType type) { 46 | return (type == eventType); 47 | } 48 | 49 | public String toString() { 50 | return eventType.toString(); 51 | } 52 | 53 | @Override 54 | public int hashCode() { 55 | return eventType.ordinal(); 56 | } 57 | 58 | public boolean equals(Object obj) { 59 | if (this == obj) { 60 | return true; 61 | } else if (obj instanceof AbstractEvent) { 62 | return eventType == ((AbstractEvent) obj).eventType; 63 | // return ((Event) obj).isEventType(getEventType()); 64 | } else { 65 | return false; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/Attribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | import javax.xml.namespace.QName; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.types.BuiltIn; 31 | 32 | /** 33 | * 34 | * @author Daniel.Peintner.EXT@siemens.com 35 | * @author Richard.Kuntschke@siemens.com 36 | * 37 | */ 38 | 39 | public class Attribute extends AbstractDatatypeEvent { 40 | 41 | protected final QName qname; 42 | protected final QNameContext qnameContext; 43 | 44 | public Attribute(QNameContext qnc, Datatype datatype) { 45 | super(EventType.ATTRIBUTE, datatype); 46 | this.qnameContext = qnc; 47 | this.qname = qnameContext.getQName(); 48 | } 49 | 50 | public Attribute(QNameContext qnc) { 51 | this(qnc, BuiltIn.getDefaultDatatype()); 52 | } 53 | 54 | public QNameContext getQNameContext() { 55 | return this.qnameContext; 56 | } 57 | 58 | public QName getQName() { 59 | return this.qname; 60 | } 61 | 62 | public String toString() { 63 | return super.toString() + "(" + qname.toString() + ")"; 64 | } 65 | 66 | @Override 67 | public int hashCode() { 68 | return qname.hashCode(); 69 | } 70 | 71 | @Override 72 | public boolean equals(Object obj) { 73 | if (this == obj) { 74 | return true; 75 | } else if (obj instanceof Attribute) { 76 | Attribute otherAT = (Attribute) obj; 77 | return (qname.equals(otherAT.qname)); 78 | } else { 79 | return false; 80 | } 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/AttributeGeneric.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class AttributeGeneric extends AbstractEvent { 34 | 35 | public AttributeGeneric() { 36 | super(EventType.ATTRIBUTE_GENERIC); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/AttributeNS.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class AttributeNS extends AbstractEvent { 34 | 35 | protected final String namespaceUri; 36 | protected final int namespaceUriID; 37 | 38 | public AttributeNS(int namespaceUriID, String namespaceUri) { 39 | super(EventType.ATTRIBUTE_NS); 40 | this.namespaceUriID = namespaceUriID; 41 | this.namespaceUri = namespaceUri; 42 | } 43 | 44 | public String getNamespaceURI() { 45 | return namespaceUri; 46 | } 47 | 48 | public int getNamespaceUriID() { 49 | return namespaceUriID; 50 | } 51 | 52 | public String toString() { 53 | return super.toString() + "(" + getNamespaceURI() + ":*)"; 54 | } 55 | 56 | @Override 57 | public int hashCode() { 58 | return (getNamespaceURI().hashCode()); 59 | } 60 | 61 | @Override 62 | public boolean equals(Object obj) { 63 | if (obj instanceof AttributeNS) { 64 | AttributeNS otherSE = (AttributeNS) obj; 65 | return (getNamespaceURI().equals(otherSE.getNamespaceURI())); 66 | } else { 67 | return false; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/Characters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | 32 | */ 33 | 34 | import com.siemens.ct.exi.core.datatype.Datatype; 35 | 36 | public class Characters extends AbstractDatatypeEvent { 37 | 38 | public Characters(Datatype datatype) { 39 | super(EventType.CHARACTERS, datatype); 40 | } 41 | 42 | public boolean equals(Object o) { 43 | if (super.equals(o)) { 44 | // event-type is ok already 45 | Characters ch = (Characters) o; 46 | // return (this.valueType.equals(ch.valueType) && this.datatype 47 | // .getBuiltInType().equals(ch.getDatatype().getBuiltInType())); 48 | return this.datatype.getBuiltInType().equals( 49 | ch.getDatatype().getBuiltInType()); 50 | } else { 51 | return false; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/CharactersGeneric.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | import com.siemens.ct.exi.core.types.BuiltIn; 27 | 28 | /** 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public class CharactersGeneric extends AbstractDatatypeEvent { 36 | 37 | public CharactersGeneric() { 38 | super(EventType.CHARACTERS_GENERIC, BuiltIn.getDefaultDatatype()); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/Comment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class Comment extends AbstractEvent { 34 | 35 | public Comment() { 36 | super(EventType.COMMENT); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/DatatypeEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | import com.siemens.ct.exi.core.datatype.Datatype; 27 | 28 | /** 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public interface DatatypeEvent extends Event { 36 | 37 | public Datatype getDatatype(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/DocType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class DocType extends AbstractEvent { 34 | 35 | public DocType() { 36 | super(EventType.DOC_TYPE); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/EndDocument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class EndDocument extends AbstractEvent { 34 | 35 | public EndDocument() { 36 | super(EventType.END_DOCUMENT); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/EndElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class EndElement extends AbstractEvent { 34 | 35 | public EndElement() { 36 | super(EventType.END_ELEMENT); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/EntityReference.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class EntityReference extends AbstractEvent { 34 | 35 | public EntityReference() { 36 | super(EventType.ENTITY_REFERENCE); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public interface Event { 34 | 35 | public EventType getEventType(); 36 | 37 | public boolean isEventType(EventType eventType); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/NamespaceDeclaration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class NamespaceDeclaration extends AbstractEvent { 34 | 35 | public NamespaceDeclaration() { 36 | super(EventType.NAMESPACE_DECLARATION); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/ProcessingInstruction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class ProcessingInstruction extends AbstractEvent { 34 | 35 | public ProcessingInstruction() { 36 | super(EventType.PROCESSING_INSTRUCTION); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/SelfContained.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class SelfContained extends AbstractEvent { 34 | 35 | public SelfContained() { 36 | super(EventType.SELF_CONTAINED); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/StartDocument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class StartDocument extends AbstractEvent { 34 | 35 | public StartDocument() { 36 | super(EventType.START_DOCUMENT); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/StartElementGeneric.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class StartElementGeneric extends AbstractEvent { 34 | 35 | public StartElementGeneric() { 36 | super(EventType.START_ELEMENT_GENERIC); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/StartElementNS.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.event; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public class StartElementNS extends AbstractEvent { 34 | 35 | protected final String namespaceUri; 36 | protected final int namespaceUriID; 37 | 38 | public StartElementNS(int namespaceUriID, String namespaceUri) { 39 | super(EventType.START_ELEMENT_NS); 40 | this.namespaceUriID = namespaceUriID; 41 | this.namespaceUri = namespaceUri; 42 | } 43 | 44 | public String getNamespaceURI() { 45 | return namespaceUri; 46 | } 47 | 48 | public int getNamespaceUriID() { 49 | return namespaceUriID; 50 | } 51 | 52 | public String toString() { 53 | return super.toString() + "(" + getNamespaceURI() + ":*)"; 54 | } 55 | 56 | @Override 57 | public int hashCode() { 58 | return (getNamespaceURI().hashCode()); 59 | } 60 | 61 | @Override 62 | public boolean equals(Object obj) { 63 | if (this == obj) { 64 | return true; 65 | } else if (obj instanceof StartElementNS) { 66 | StartElementNS otherSE = (StartElementNS) obj; 67 | return (getNamespaceURI().equals(otherSE.getNamespaceURI())); 68 | } else { 69 | return false; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/event/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI Grammar events. 13 | 14 |

EXI events and associated content that occur in an EXI stream

15 | 16 |

Package Specification

17 | 18 | // none // 19 | 20 |

Related Documentation

21 | 22 | // none // 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/AbstractSchemaInformedContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | * -SNAPSHOT 32 | */ 33 | 34 | public abstract class AbstractSchemaInformedContent extends 35 | AbstractSchemaInformedGrammar { 36 | 37 | public AbstractSchemaInformedContent() { 38 | super(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/BuiltInDocContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | import com.siemens.ct.exi.core.grammars.event.Event; 27 | import com.siemens.ct.exi.core.grammars.event.EventType; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | /* 37 | * 38 | * 39 | * DocContent : SE () DocEnd 0 DT DocContent 1.0 CM DocContent 1.1.0 PI 40 | * DocContent 1.1.1 41 | */ 42 | 43 | public class BuiltInDocContent extends AbstractBuiltInGrammar { 44 | 45 | protected Grammar docEnd; 46 | 47 | public BuiltInDocContent(Grammar docEnd) { 48 | super(); 49 | this.docEnd = docEnd; 50 | // SE(*) --> DocEnd 51 | this.addProduction(START_ELEMENT_GENERIC, docEnd); 52 | } 53 | 54 | public BuiltInDocContent(Grammar docEnd, String label) { 55 | this(docEnd); 56 | this.setLabel(label); 57 | } 58 | 59 | public GrammarType getGrammarType() { 60 | return GrammarType.BUILT_IN_DOC_CONTENT; 61 | } 62 | 63 | @Override 64 | public final void addProduction(Event event, Grammar grammar) { 65 | if (!event.isEventType(EventType.START_ELEMENT_GENERIC) 66 | || this.getNumberOfEvents() > 0) { 67 | throw new RuntimeException("Mis-use of BuiltInDocContent grammar"); 68 | } 69 | super.addProduction(event, grammar); 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/BuiltInElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | import com.siemens.ct.exi.core.grammars.event.Attribute; 27 | import com.siemens.ct.exi.core.grammars.event.StartElement; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | /* 37 | * 38 | * 39 | * ElementContent : EE 0 ChildContentItems (1.0) 40 | * 41 | * ChildContentItems (n.m) : SE () ElementContent n. m CH ElementContent n.(m+1) 42 | * ER ElementContent n.(m+2) CM ElementContent n.(m+3).0 PI ElementContent 43 | * n.(m+3).1 44 | */ 45 | public class BuiltInElement extends AbstractBuiltInContent { 46 | 47 | protected BuiltInElement() { 48 | super(); 49 | 50 | // EE on first level 51 | addProduction(END_ELEMENT, END_RULE); 52 | } 53 | 54 | @Override 55 | public boolean hasEndElement() { 56 | return true; 57 | } 58 | 59 | public GrammarType getGrammarType() { 60 | return GrammarType.BUILT_IN_ELEMENT_CONTENT; 61 | } 62 | 63 | @Override 64 | public void learnStartElement(StartElement se) { 65 | addProduction(se, this); 66 | } 67 | 68 | /* 69 | * Note: learnEndElement ( ) not necessary since EE is already present on 70 | * first level for element-content-rules 71 | */ 72 | 73 | @Override 74 | public void learnAttribute(Attribute at) { 75 | // this should never happen! 76 | throw new IllegalArgumentException( 77 | "ElementContent Rule cannot learn AT events"); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/BuiltInFragmentContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | import com.siemens.ct.exi.core.grammars.event.EndDocument; 27 | import com.siemens.ct.exi.core.grammars.event.StartElement; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | /* 37 | * 38 | * 39 | * FragmentContent : SE () FragmentContent 0 ED 1 CM FragmentContent 2.0 PI 40 | * FragmentContent 2.1 41 | */ 42 | 43 | public class BuiltInFragmentContent extends AbstractBuiltInGrammar { 44 | 45 | /* 46 | * FragmentContent : SE (*) FragmentContent 0 ED 1 CM FragmentContent 2.0 PI 47 | * FragmentContent 2.1 48 | */ 49 | public BuiltInFragmentContent() { 50 | super(); 51 | // Note: Add in different order in schema-less grammars 52 | // EE 53 | addTerminalProduction(new EndDocument()); 54 | // SE(*) --> FragmentContent 55 | addProduction(START_ELEMENT_GENERIC, this); 56 | } 57 | 58 | public GrammarType getGrammarType() { 59 | return GrammarType.BUILT_IN_FRAGMENT_CONTENT; 60 | } 61 | 62 | @Override 63 | // public void learnStartElement(String uri, String localName) { 64 | public void learnStartElement(StartElement se) { 65 | // a learned rule is added to the front, technically 66 | // it is added to the tail 67 | // StartElement se = new StartElement(uri, localName); 68 | if (!this.contains(se)) { 69 | // eventRules.add ( new EventRule ( event, this ) ); 70 | this.addProduction(se, this); 71 | } 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/BuiltInGrammar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public interface BuiltInGrammar extends Grammar { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/DocEnd.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | /* 34 | * DocEnd : ED 0 CM DocEnd 1.0 PI DocEnd 1.1 35 | */ 36 | public class DocEnd extends AbstractSchemaInformedGrammar { 37 | 38 | public DocEnd() { 39 | super(); 40 | } 41 | 42 | public DocEnd(String label) { 43 | this(); 44 | setLabel(label); 45 | } 46 | 47 | public GrammarType getGrammarType() { 48 | return GrammarType.DOC_END; 49 | } 50 | 51 | public String toString() { 52 | return "DocEnd" + super.toString(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/Document.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | /* 33 | * Document : SD DocContent 0 34 | */ 35 | public class Document extends AbstractSchemaInformedGrammar { 36 | 37 | public Document() { 38 | super(); 39 | } 40 | 41 | public Document(String label) { 42 | this(); 43 | this.setLabel(label); 44 | } 45 | 46 | public GrammarType getGrammarType() { 47 | return GrammarType.DOCUMENT; 48 | } 49 | 50 | public String toString() { 51 | return "Document" + super.toString(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/Fragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | /* 34 | * Fragment : SD FragmentContent 0 35 | */ 36 | public class Fragment extends AbstractSchemaInformedGrammar { 37 | 38 | public Fragment() { 39 | super(); 40 | } 41 | 42 | public Fragment(String label) { 43 | this(); 44 | this.setLabel(label); 45 | } 46 | 47 | public GrammarType getGrammarType() { 48 | return GrammarType.FRAGMENT; 49 | } 50 | 51 | public String toString() { 52 | return "Fragment" + super.toString(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/GrammarType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public enum GrammarType { 34 | /* Root grammars */ 35 | DOCUMENT, FRAGMENT, DOC_END, 36 | /* Schema-informed Document and Fragment Grammars */ 37 | SCHEMA_INFORMED_DOC_CONTENT, SCHEMA_INFORMED_FRAGMENT_CONTENT, 38 | /* Schema-informed Element and Type Grammars */ 39 | SCHEMA_INFORMED_FIRST_START_TAG_CONTENT, SCHEMA_INFORMED_START_TAG_CONTENT, SCHEMA_INFORMED_ELEMENT_CONTENT, 40 | /* Built-in Document and Fragment Grammars */ 41 | BUILT_IN_DOC_CONTENT, BUILT_IN_FRAGMENT_CONTENT, 42 | /* Built-in Element Grammars */ 43 | BUILT_IN_START_TAG_CONTENT, BUILT_IN_ELEMENT_CONTENT, 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/SchemaInformedDocContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | /* 34 | * 35 | * 36 | * DocContent : SE (G 0) DocEnd 0 SE (G 1) DocEnd 1 ... SE (G n-1) DocEnd n-1 SE 37 | * () DocEnd n.0 DT DocContent n.1 CM DocContent n.2.0 PI DocContent n.2.1 38 | */ 39 | 40 | public class SchemaInformedDocContent extends AbstractSchemaInformedGrammar { 41 | 42 | public SchemaInformedDocContent() { 43 | super(); 44 | } 45 | 46 | public SchemaInformedDocContent(String label) { 47 | this(); // docEnd); 48 | this.setLabel(label); 49 | } 50 | 51 | public GrammarType getGrammarType() { 52 | return GrammarType.SCHEMA_INFORMED_DOC_CONTENT; 53 | } 54 | 55 | public String toString() { 56 | return "DocContent" + super.toString(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/SchemaInformedElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | /* 34 | * 35 | * 36 | * 37 | * EE n.m 38 | * 39 | * Element i, j : SE () Element i, j n.m CH [schema-invalid value ] Element i, j 40 | * n.(m+1) ER Element i, j n.(m+2) CM Element i, j n.(m+3).0 PI Element i, j 41 | * n.(m+3).1 42 | */ 43 | 44 | public class SchemaInformedElement extends AbstractSchemaInformedContent 45 | implements Cloneable { 46 | 47 | public GrammarType getGrammarType() { 48 | return GrammarType.SCHEMA_INFORMED_ELEMENT_CONTENT; 49 | } 50 | 51 | @Override 52 | public SchemaInformedElement clone() { 53 | SchemaInformedElement clone = (SchemaInformedElement) super.clone(); 54 | return clone; 55 | } 56 | 57 | public String toString() { 58 | return "Element" + super.toString(); 59 | } 60 | 61 | @Override 62 | public boolean equals(Object obj) { 63 | return (obj instanceof SchemaInformedElement && super.equals(obj)); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/SchemaInformedFirstStartTagGrammar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | /* 34 | * first rule is different (namespace declaration, xsi:type and xsi:nil) 35 | */ 36 | public interface SchemaInformedFirstStartTagGrammar extends 37 | SchemaInformedStartTagGrammar { 38 | 39 | // /* 40 | // * returns type-name or null if anonymous type 41 | // */ 42 | // public QName getTypeName(); 43 | // 44 | // public void setTypeName(QName typeName); 45 | 46 | /* 47 | * sets whether type is castable 48 | */ 49 | public void setTypeCastable(boolean hasNamedSubtypes); 50 | 51 | public boolean isTypeCastable(); 52 | 53 | /* 54 | * sets whether element is nillable 55 | */ 56 | public void setNillable(boolean nillable); 57 | 58 | public boolean isNillable(); 59 | 60 | public void setTypeEmpty(SchemaInformedFirstStartTagGrammar typeEmpty); 61 | 62 | public SchemaInformedFirstStartTagGrammar getTypeEmpty(); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/SchemaInformedFragmentContent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | /* 34 | * 35 | * 36 | * FragmentContent : SE (F 0) FragmentContent 0 SE (F 1) FragmentContent 1 ... 37 | * SE (F n-1) FragmentContent n-1 ED n SE () FragmentContent (n+1).0 CM 38 | * FragmentContent (n+1).1.0 PI FragmentContent (n+1).1.1 39 | */ 40 | 41 | public class SchemaInformedFragmentContent extends 42 | AbstractSchemaInformedGrammar { 43 | 44 | public SchemaInformedFragmentContent() { 45 | super(); 46 | } 47 | 48 | public SchemaInformedFragmentContent(String label) { 49 | this(); 50 | setLabel(label); 51 | } 52 | 53 | public GrammarType getGrammarType() { 54 | return GrammarType.SCHEMA_INFORMED_FRAGMENT_CONTENT; 55 | } 56 | 57 | public String toString() { 58 | return "FragmentContent" + super.toString(); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/SchemaInformedGrammar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | import com.siemens.ct.exi.core.grammars.event.Event; 27 | 28 | /** 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public interface SchemaInformedGrammar extends Grammar { 36 | 37 | public void addTerminalProduction(Event event); 38 | 39 | public int getNumberOfDeclaredAttributes(); 40 | 41 | public int getLeastAttributeEventCode(); 42 | 43 | /* 44 | * Label 45 | */ 46 | public void setLabel(String label); 47 | 48 | public String getLabel(); 49 | 50 | /* 51 | * clones schema-informed rule 52 | */ 53 | public SchemaInformedGrammar duplicate(); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/SchemaInformedStartTagGrammar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.grammar; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | /* 34 | * first rule is different (namespace declaration, xsi:type and xsi:nil) 35 | */ 36 | public interface SchemaInformedStartTagGrammar extends SchemaInformedGrammar { 37 | 38 | public void setElementContentGrammar(Grammar elementContent2); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/grammar/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI Grammar grammars. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI Grammars. 13 | 14 |

EXI is a knowledge based encoding that uses a set of grammars to 15 | determine which events are most likely to occur at any given point in an 16 | EXI stream and encodes the most likely alternatives in fewer bits. It 17 | does this by mapping the stream of events to a lower entropy set of 18 | representative values and encoding those values using a set of simple 19 | variable length codes or an EXI compression algorithm.

20 | 21 |

Package Specification

22 | 23 | // none // 24 | 25 |

Related Documentation

26 | 27 | // none // 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/production/AbstractProduction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.production; 25 | 26 | import com.siemens.ct.exi.core.grammars.event.Event; 27 | import com.siemens.ct.exi.core.grammars.grammar.Grammar; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public abstract class AbstractProduction implements Production { 37 | 38 | protected final Grammar next; 39 | protected final int eventCode; 40 | protected final Event event; 41 | 42 | public AbstractProduction(Grammar next, Event event, int eventCode) { 43 | this.next = next; 44 | this.event = event; 45 | this.eventCode = eventCode; 46 | } 47 | 48 | abstract public int getEventCode(); 49 | 50 | public Event getEvent() { 51 | return event; 52 | } 53 | 54 | public Grammar getNextGrammar() { 55 | return next; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return "[" + eventCode + "] " + event + " -> " + next; 61 | } 62 | 63 | @Override 64 | public boolean equals(Object o) { 65 | if (this == o) 66 | return true; 67 | if (!(o instanceof AbstractProduction)) 68 | return false; 69 | 70 | AbstractProduction that = (AbstractProduction) o; 71 | 72 | if (eventCode != that.eventCode) 73 | return false; 74 | // we do not test the equality of the next Grammar here has it would 75 | // make recursive calls 76 | return event != null ? event.equals(that.event) : that.event == null; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/production/Production.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.production; 25 | 26 | import com.siemens.ct.exi.core.grammars.event.Event; 27 | import com.siemens.ct.exi.core.grammars.grammar.Grammar; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public interface Production { 37 | 38 | public Event getEvent(); 39 | 40 | public Grammar getNextGrammar(); 41 | 42 | public int getEventCode(); 43 | 44 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/production/SchemaInformedProduction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.production; 25 | 26 | import com.siemens.ct.exi.core.grammars.event.Event; 27 | import com.siemens.ct.exi.core.grammars.grammar.Grammar; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class SchemaInformedProduction extends AbstractProduction { 37 | 38 | public SchemaInformedProduction(Grammar next, Event event, int eventCode) { 39 | super(next, event, eventCode); 40 | } 41 | 42 | @Override 43 | public int getEventCode() { 44 | return eventCode; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/production/SchemaLessProduction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.grammars.production; 25 | 26 | import com.siemens.ct.exi.core.grammars.event.Event; 27 | import com.siemens.ct.exi.core.grammars.grammar.Grammar; 28 | 29 | /** 30 | * 31 | * @author Daniel.Peintner.EXT@siemens.com 32 | * @author Richard.Kuntschke@siemens.com 33 | * 34 | */ 35 | 36 | public class SchemaLessProduction extends AbstractProduction { 37 | 38 | protected final Grammar father; 39 | 40 | public SchemaLessProduction(Grammar father, Grammar next, Event event, 41 | int eventCode) { 42 | super(next, event, eventCode); 43 | this.father = father; 44 | } 45 | 46 | @Override 47 | public int getEventCode() { 48 | // internal eventCodes in schema-less do have the reverse order 49 | return father.getNumberOfEvents() - 1 - this.eventCode; 50 | 51 | } 52 | 53 | @Override 54 | public boolean equals(Object o) { 55 | if (this == o) 56 | return true; 57 | if (!(o instanceof SchemaLessProduction)) 58 | return false; 59 | if (!super.equals(o)) 60 | return false; 61 | 62 | SchemaLessProduction that = (SchemaLessProduction) o; 63 | 64 | return father != null ? father.equals(that.father) 65 | : that.father == null; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/grammars/production/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI Grammar productions. 13 | 14 |

An EXI Grammar Production consists of an EXI event and the next grammar following this event.

15 | 16 |

Package Specification

17 | 18 | // none // 19 | 20 |

Related Documentation

21 | 22 | // none // 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/helpers/DefaultErrorHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.helpers; 25 | 26 | import com.siemens.ct.exi.core.exceptions.EXIException; 27 | import com.siemens.ct.exi.core.exceptions.ErrorHandler; 28 | 29 | /** 30 | * Default Error Handler for EXI exceptions. 31 | * 32 | *

33 | * Warnings and errors are simply ignored 34 | *

35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | public class DefaultErrorHandler implements ErrorHandler { 41 | 42 | public void error(EXIException exception) { 43 | } 44 | 45 | public void warning(EXIException exception) { 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/helpers/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI helper classes such as default interface implementations. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/io/channel/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI channels. 13 | 14 |

Events inside each block are multiplexed into channels.

15 | 16 |

Package Specification

17 | 18 | // none // 19 | 20 |

Related Documentation

21 | 22 | // none // 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/io/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | IO streams operating at the level of bits. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 14 | 15 | 16 | 17 | Entry point for using EXI implementation. 18 | 19 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/BuiltInType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | /** 27 | * EXI has a list built-in EXI datatype representations used for representing 28 | * content items in EXI stream (see 29 | * http://www.w3.org/TR/exi/#encodingDatatypes). 30 | * 31 | *

32 | * Additionally some built-in types are augmented with information necessary for 33 | * machine processing (e.g., number of bits). 34 | *

35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | 41 | public enum BuiltInType { 42 | /** Binary Base64 */ 43 | BINARY_BASE64, 44 | 45 | /** Binary Hex */ 46 | BINARY_HEX, 47 | 48 | /** Boolean */ 49 | BOOLEAN, 50 | 51 | /** Boolean Facet */ 52 | BOOLEAN_FACET, 53 | 54 | /** Decimal */ 55 | DECIMAL, 56 | 57 | /** Float & Double */ 58 | FLOAT, 59 | 60 | /** N-Bit UnsignedInteger */ 61 | NBIT_UNSIGNED_INTEGER, 62 | 63 | /** Unsigned Integer */ 64 | UNSIGNED_INTEGER, 65 | 66 | /** (Signed) Integer */ 67 | INTEGER, 68 | 69 | /** Datetime */ 70 | DATETIME, 71 | 72 | /** String & RestrictedCharSet */ 73 | STRING, 74 | 75 | /** Restricted character set string */ 76 | RCS_STRING, 77 | 78 | /** 79 | * Experimental 80 | * (https://www.w3.org/XML/EXI/docs/extendedString/exi-extString.html) 81 | */ 82 | EXTENDED_STRING, 83 | 84 | /** Enumeration */ 85 | ENUMERATION, 86 | 87 | /** List */ 88 | LIST, 89 | 90 | /** QName */ 91 | QNAME; 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/DateTimeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | /** 27 | * The Date-Time datatype representation is a sequence of values representing 28 | * the individual components of the Date-Time 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public enum DateTimeType { 36 | /** gYear represents a gregorian calendar year */ 37 | gYear, 38 | 39 | /** 40 | * gYearMonth represents a specific gregorian month in a specific gregorian 41 | * year 42 | */ 43 | gYearMonth, 44 | 45 | /** 46 | * A date is an object with year, month, and day properties just like those 47 | * of dateTime objects, plus an optional timezone-valued timezone property 48 | */ 49 | date, 50 | /** 51 | * dateTime values may be viewed as objects with integer-valued year, month, 52 | * day, hour and minute properties, a decimal-valued second property, and a 53 | * boolean timezoned property. 54 | */ 55 | dateTime, 56 | 57 | /** gMonth is a gregorian month that recurs every year */ 58 | gMonth, 59 | 60 | /** 61 | * gMonthDay is a gregorian date that recurs, specifically a day of the year 62 | * such as the third of May 63 | */ 64 | gMonthDay, 65 | 66 | /** 67 | * gDay is a gregorian day that recurs, specifically a day of the month such 68 | * as the 5th of the month 69 | */ 70 | gDay, 71 | 72 | /** time represents an instant of time that recurs every day */ 73 | time; 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/IntegerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | /** 27 | * EXI can deal with arbitrary large integers have values. This integer-type 28 | * informs about the type declared in the schema. 29 | * 30 | * @author Daniel.Peintner.EXT@siemens.com 31 | * @author Richard.Kuntschke@siemens.com 32 | * 33 | */ 34 | 35 | public enum IntegerType { 36 | /** Unsigned Integer with at most 8 bits */ 37 | UNSIGNED_INTEGER_8(true), 38 | 39 | /** Unsigned Integer with at most 16 bits */ 40 | UNSIGNED_INTEGER_16(true), 41 | 42 | /** Unsigned Integer with at most 32 bits */ 43 | UNSIGNED_INTEGER_32(true), 44 | 45 | /** Unsigned Integer with at most 64 bits */ 46 | UNSIGNED_INTEGER_64(true), 47 | 48 | /** Unsigned Integer with arbitrary number of bits */ 49 | UNSIGNED_INTEGER_BIG(true), 50 | 51 | /** Integer with at most 8 bits */ 52 | INTEGER_8(false), 53 | 54 | /** Integer with at most 16 bits */ 55 | INTEGER_16(false), 56 | 57 | /** Integer with at most 32 bits */ 58 | INTEGER_32(false), 59 | 60 | /** Integer with at most 64 bits */ 61 | INTEGER_64(false), 62 | 63 | /** Integer with arbitrary number of bits */ 64 | INTEGER_BIG(false); 65 | 66 | private final boolean isUnsigned; 67 | 68 | private IntegerType(boolean isUnsigned) { 69 | this.isUnsigned = isUnsigned; 70 | } 71 | 72 | public boolean isUnsigned() { 73 | return isUnsigned; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/StringTypeDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.datatype.strings.StringDecoder; 31 | import com.siemens.ct.exi.core.exceptions.EXIException; 32 | import com.siemens.ct.exi.core.io.channel.DecoderChannel; 33 | import com.siemens.ct.exi.core.values.Value; 34 | 35 | /** 36 | * 37 | * @author Daniel.Peintner.EXT@siemens.com 38 | * @author Richard.Kuntschke@siemens.com 39 | * 40 | */ 41 | 42 | public class StringTypeDecoder extends AbstractTypeDecoder { 43 | 44 | public StringTypeDecoder() throws EXIException { 45 | super(); 46 | } 47 | 48 | public Value readValue(Datatype datatype, QNameContext qnContext, 49 | DecoderChannel valueChannel, StringDecoder stringDecoder) 50 | throws IOException { 51 | return stringDecoder.readValue(qnContext, valueChannel); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/StringTypeEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.datatype.strings.StringEncoder; 31 | import com.siemens.ct.exi.core.exceptions.EXIException; 32 | import com.siemens.ct.exi.core.io.channel.EncoderChannel; 33 | import com.siemens.ct.exi.core.values.Value; 34 | 35 | /** 36 | * 37 | * @author Daniel.Peintner.EXT@siemens.com 38 | * @author Richard.Kuntschke@siemens.com 39 | * 40 | */ 41 | 42 | public class StringTypeEncoder extends AbstractTypeEncoder { 43 | 44 | String lastValidValue; 45 | 46 | public StringTypeEncoder() throws EXIException { 47 | super(); 48 | } 49 | 50 | public boolean isValid(Datatype datatype, Value value) { 51 | lastValidValue = value.toString(); 52 | return true; 53 | } 54 | 55 | public void writeValue(QNameContext qnContext, EncoderChannel valueChannel, 56 | StringEncoder stringEncoder) throws IOException { 57 | stringEncoder.writeValue(qnContext, valueChannel, lastValidValue); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/TypeCoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public interface TypeCoder { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/TypeDecoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.datatype.strings.StringDecoder; 31 | import com.siemens.ct.exi.core.io.channel.DecoderChannel; 32 | import com.siemens.ct.exi.core.values.Value; 33 | 34 | /** 35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | 41 | public interface TypeDecoder extends TypeCoder { 42 | 43 | public Value readValue(Datatype datatype, QNameContext qnContext, 44 | DecoderChannel valueChannel, StringDecoder stringDecoder) 45 | throws IOException; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/TypeEncoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.types; 25 | 26 | import java.io.IOException; 27 | 28 | import com.siemens.ct.exi.core.context.QNameContext; 29 | import com.siemens.ct.exi.core.datatype.Datatype; 30 | import com.siemens.ct.exi.core.datatype.strings.StringEncoder; 31 | import com.siemens.ct.exi.core.io.channel.EncoderChannel; 32 | import com.siemens.ct.exi.core.values.Value; 33 | 34 | /** 35 | * 36 | * @author Daniel.Peintner.EXT@siemens.com 37 | * @author Richard.Kuntschke@siemens.com 38 | * 39 | */ 40 | 41 | public interface TypeEncoder extends TypeCoder { 42 | 43 | /** 44 | * Checks whether given value is valid according to the datatype. 45 | * 46 | * @param datatype 47 | * datatype 48 | * @param value 49 | * value 50 | * @return boolean value indicating whether passed value is valid 51 | */ 52 | public boolean isValid(Datatype datatype, Value value); 53 | 54 | /** 55 | * Writes previously checked valid value to channel. 56 | * 57 | * @param qnContext 58 | * context 59 | * @param valueChannel 60 | * encoder value channel 61 | * @param stringEncoder 62 | * string encoder 63 | * @throws IOException 64 | * IO exception 65 | */ 66 | public void writeValue(QNameContext qnContext, EncoderChannel valueChannel, 67 | StringEncoder stringEncoder) throws IOException; 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/types/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | EXI Types and Type coding modes such as Typed, String, Lexical and RepresentationMap. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/util/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | Utility classes for EXI project. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/util/sort/AttributeSort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.util.sort; 25 | 26 | import java.util.Comparator; 27 | 28 | import javax.xml.namespace.QName; 29 | 30 | import com.siemens.ct.exi.core.grammars.event.Attribute; 31 | 32 | /** 33 | * Helper Class for sorting attributes. 34 | * 35 | * EXI's lexical order: sorted first by qname's local-name then by qname's URI. 36 | * 37 | * @author Daniel.Peintner.EXT@siemens.com 38 | * @author Richard.Kuntschke@siemens.com 39 | * 40 | */ 41 | public class AttributeSort implements Comparator { 42 | public int compare(Attribute a1, Attribute a2) { 43 | final QName q1 = a1.getQName(); 44 | final QName q2 = a2.getQName(); 45 | return QNameSort.compare(q1.getNamespaceURI(), q1.getLocalPart(), 46 | q2.getNamespaceURI(), q2.getLocalPart()); 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/util/sort/StartElementSort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.util.sort; 25 | 26 | import java.util.Comparator; 27 | 28 | import javax.xml.namespace.QName; 29 | 30 | import com.siemens.ct.exi.core.grammars.event.StartElement; 31 | 32 | /** 33 | * Helper Class for sorting start elements. 34 | * 35 | * EXI's lexical order: sorted first by qname's local-name then by qname's URI. 36 | * 37 | * @author Daniel.Peintner.EXT@siemens.com 38 | * @author Richard.Kuntschke@siemens.com 39 | * 40 | */ 41 | public class StartElementSort implements Comparator { 42 | public int compare(StartElement se1, StartElement se2) { 43 | final QName q1 = se1.getQName(); 44 | final QName q2 = se2.getQName(); 45 | return QNameSort.compare(q1.getNamespaceURI(), q1.getLocalPart(), 46 | q2.getNamespaceURI(), q2.getLocalPart()); 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/util/sort/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | Utility pack for sorting items (e.g., events). 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/util/xml/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | General XML utility classes. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/values/AbstractBinaryValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.values; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | abstract public class AbstractBinaryValue extends AbstractValue { 34 | 35 | protected final byte[] bytes; 36 | 37 | public AbstractBinaryValue(ValueType valueType, byte[] bytes) { 38 | super(valueType); 39 | this.bytes = bytes; 40 | } 41 | 42 | public byte[] toBytes() { 43 | return bytes; 44 | } 45 | 46 | protected final boolean _equals(byte[] oBytes) { 47 | if (bytes.length == oBytes.length) { 48 | for (int i = 0; i < bytes.length; i++) { 49 | if (bytes[i] != oBytes[i]) { 50 | return false; 51 | } 52 | } 53 | return true; 54 | } 55 | return false; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/values/AbstractValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.values; 25 | 26 | /** 27 | * 28 | * @author Daniel.Peintner.EXT@siemens.com 29 | * @author Richard.Kuntschke@siemens.com 30 | * 31 | */ 32 | 33 | public abstract class AbstractValue implements Value { 34 | 35 | protected int slen = -1; 36 | 37 | protected final ValueType valueType; 38 | 39 | public AbstractValue(ValueType valueType) { 40 | this.valueType = valueType; 41 | } 42 | 43 | public final ValueType getValueType() { 44 | return valueType; 45 | } 46 | 47 | public char[] getCharacters() { 48 | char[] dst = new char[getCharactersLength()]; 49 | getCharacters(dst, 0); 50 | return dst; 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return new String(getCharacters()); 56 | } 57 | 58 | public String toString(char[] cbuffer, int offset) { 59 | getCharacters(cbuffer, offset); 60 | return new String(cbuffer, offset, getCharactersLength()); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/values/IntegerValueType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.values; 25 | 26 | /** 27 | * Integer value types: e.g., int, long, BigInteger. 28 | * 29 | * @author Daniel.Peintner.EXT@siemens.com 30 | * @author Richard.Kuntschke@siemens.com 31 | * 32 | */ 33 | 34 | public enum IntegerValueType { 35 | /** int */ 36 | INT, 37 | /** long */ 38 | LONG, 39 | /** BigInteger **/ 40 | BIG; 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/values/ValueType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007-2018 Siemens AG 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * 22 | */ 23 | 24 | package com.siemens.ct.exi.core.values; 25 | 26 | /** 27 | * Value types: e.g., String Values, Integers, Floats etc. 28 | * 29 | * @author Daniel.Peintner.EXT@siemens.com 30 | * @author Richard.Kuntschke@siemens.com 31 | * 32 | */ 33 | 34 | public enum ValueType { 35 | /** Binary */ 36 | BINARY_BASE64, BINARY_HEX, 37 | /** Boolean */ 38 | BOOLEAN, 39 | /** Decimal */ 40 | DECIMAL, 41 | /** Float */ 42 | FLOAT, 43 | /** Integer (int, long, BigInteger) */ 44 | INTEGER, 45 | /** Datetime */ 46 | DATETIME, 47 | /** String */ 48 | STRING, 49 | /** List */ 50 | LIST, 51 | /** QName */ 52 | QNAME; 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/siemens/ct/exi/core/values/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | Typed value support such as float values, list values et cetera. 13 | 14 |

Package Specification

15 | 16 | // none // 17 | 18 |

Related Documentation

19 | 20 | // none // 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 13 | EXIficient 14 | 19 | 20 | 21 | 22 |

EXIficient

23 | 24 |

is an open source implementation of the W3C Efficient XML Interchange (EXI) format specification written in the Java programming language 25 | (http://exificient.github.io). 26 |

27 | 28 |

The EXI format is a very compact representation for the Extensible Markup Language (XML) Information Set that is intended to simultaneously optimize performance and the utilization of computational resources. 29 |

30 | 31 | 32 | 33 | --------------------------------------------------------------------------------