
org.verapdf.gf.model.impl.arlington.GFAMediaClipSection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of validation-model-arlington Show documentation
Show all versions of validation-model-arlington Show documentation
veraPDF PDF/A validation model implementation based on PDF parser.
The newest version!
/**
* This file is part of veraPDF Validation, a module of the veraPDF project.
* Copyright (c) 2015, veraPDF Consortium
* All rights reserved.
*
* veraPDF Validation is free software: you can redistribute it and/or modify
* it under the terms of either:
*
* The GNU General public license GPLv3+.
* You should have received a copy of the GNU General Public License
* along with veraPDF Validation as the LICENSE.GPL file in the root of the source
* tree. If not, see http://www.gnu.org/licenses/ or
* https://www.gnu.org/licenses/gpl-3.0.en.html.
*
* The Mozilla Public License MPLv2+.
* You should have received a copy of the Mozilla Public License along with
* veraPDF Validation as the LICENSE.MPL file in the root of the source tree.
* If a copy of the MPL was not distributed with this file, you can obtain one at
* http://mozilla.org/MPL/2.0/.
*/
package org.verapdf.gf.model.impl.arlington;
import org.verapdf.cos.*;
import org.verapdf.model.alayer.*;
import org.verapdf.gf.model.impl.containers.StaticContainers;
import org.verapdf.tools.StaticResources;
import java.util.*;
import org.verapdf.pd.PDNameTreeNode;
import org.verapdf.as.ASAtom;
import java.util.stream.Collectors;
import org.verapdf.pd.structure.PDNumberTreeNode;
public class GFAMediaClipSection extends GFAObject implements AMediaClipSection {
public GFAMediaClipSection(COSBase baseObject, COSBase parentObject, String keyName) {
super(baseObject, parentObject, keyName, "AMediaClipSection");
}
@Override
public List extends org.verapdf.model.baselayer.Object> getLinkedObjects(String link) {
switch (link) {
case "Alt":
return getAlt();
case "BE":
return getBE();
case "D":
return getD();
case "MH":
return getMH();
default:
return super.getLinkedObjects(link);
}
}
private List getAlt() {
switch (StaticContainers.getFlavour()) {
case ARLINGTON1_5:
case ARLINGTON1_6:
case ARLINGTON1_7:
case ARLINGTON2_0:
return getAlt1_5();
default:
return Collections.emptyList();
}
}
private List getAlt1_5() {
COSObject object = getAltValue();
if (object == null) {
return Collections.emptyList();
}
if (object.getType() == COSObjType.COS_ARRAY) {
List list = new ArrayList<>(1);
list.add(new GFAArrayOfStringsText((COSArray)object.getDirectBase(), this.baseObject, "Alt"));
return Collections.unmodifiableList(list);
}
return Collections.emptyList();
}
private List getBE() {
switch (StaticContainers.getFlavour()) {
case ARLINGTON1_5:
case ARLINGTON1_6:
case ARLINGTON1_7:
case ARLINGTON2_0:
return getBE1_5();
default:
return Collections.emptyList();
}
}
private List getBE1_5() {
COSObject object = getBEValue();
if (object == null) {
return Collections.emptyList();
}
if (object.getType() == COSObjType.COS_DICT) {
List list = new ArrayList<>(1);
list.add(new GFAMediaClipSectionMHBE((COSDictionary)object.getDirectBase(), this.baseObject, "BE"));
return Collections.unmodifiableList(list);
}
return Collections.emptyList();
}
private List getD() {
switch (StaticContainers.getFlavour()) {
case ARLINGTON1_5:
case ARLINGTON1_6:
case ARLINGTON1_7:
case ARLINGTON2_0:
return getD1_5();
default:
return Collections.emptyList();
}
}
private List getD1_5() {
COSObject object = getDValue();
if (object == null) {
return Collections.emptyList();
}
if (object.getType() == COSObjType.COS_DICT) {
org.verapdf.model.baselayer.Object result = getDDictionary1_5(object.getDirectBase(), "D");
List list = new ArrayList<>(1);
if (result != null) {
list.add(result);
}
return Collections.unmodifiableList(list);
}
return Collections.emptyList();
}
private org.verapdf.model.baselayer.Object getDDictionary1_5(COSBase base, String keyName) {
COSObject subtype = base.getKey(ASAtom.getASAtom("S"));
if (subtype == null) {
return null;
}
String subtypeValue = subtype.getString();
if (subtypeValue == null) {
return null;
}
switch (subtypeValue) {
case "MCD":
return new GFAMediaClipData(base, this.baseObject, keyName);
case "MCS":
return new GFAMediaClipSection(base, this.baseObject, keyName);
default:
return null;
}
}
private List getMH() {
switch (StaticContainers.getFlavour()) {
case ARLINGTON1_5:
case ARLINGTON1_6:
case ARLINGTON1_7:
case ARLINGTON2_0:
return getMH1_5();
default:
return Collections.emptyList();
}
}
private List getMH1_5() {
COSObject object = getMHValue();
if (object == null) {
return Collections.emptyList();
}
if (object.getType() == COSObjType.COS_DICT) {
List list = new ArrayList<>(1);
list.add(new GFAMediaClipSectionMHBE((COSDictionary)object.getDirectBase(), this.baseObject, "MH"));
return Collections.unmodifiableList(list);
}
return Collections.emptyList();
}
@Override
public Boolean getcontainsAlt() {
return this.baseObject.knownKey(ASAtom.getASAtom("Alt"));
}
public COSObject getAltValue() {
COSObject object = this.baseObject.getKey(ASAtom.getASAtom("Alt"));
return object;
}
@Override
public String getAltType() {
COSObject Alt = getAltValue();
return getObjectType(Alt);
}
@Override
public Boolean getAltHasTypeArray() {
COSObject Alt = getAltValue();
return getHasTypeArray(Alt);
}
@Override
public Boolean getcontainsBE() {
return this.baseObject.knownKey(ASAtom.getASAtom("BE"));
}
public COSObject getBEValue() {
COSObject object = this.baseObject.getKey(ASAtom.getASAtom("BE"));
return object;
}
@Override
public String getBEType() {
COSObject BE = getBEValue();
return getObjectType(BE);
}
@Override
public Boolean getBEHasTypeDictionary() {
COSObject BE = getBEValue();
return getHasTypeDictionary(BE);
}
@Override
public Boolean getcontainsD() {
return this.baseObject.knownKey(ASAtom.getASAtom("D"));
}
public COSObject getDValue() {
COSObject object = this.baseObject.getKey(ASAtom.getASAtom("D"));
return object;
}
@Override
public String getDType() {
COSObject D = getDValue();
return getObjectType(D);
}
@Override
public Boolean getDHasTypeDictionary() {
COSObject D = getDValue();
return getHasTypeDictionary(D);
}
@Override
public Boolean getcontainsMH() {
return this.baseObject.knownKey(ASAtom.getASAtom("MH"));
}
public COSObject getMHValue() {
COSObject object = this.baseObject.getKey(ASAtom.getASAtom("MH"));
return object;
}
@Override
public String getMHType() {
COSObject MH = getMHValue();
return getObjectType(MH);
}
@Override
public Boolean getMHHasTypeDictionary() {
COSObject MH = getMHValue();
return getHasTypeDictionary(MH);
}
@Override
public Boolean getcontainsN() {
return this.baseObject.knownKey(ASAtom.getASAtom("N"));
}
public COSObject getNValue() {
COSObject object = this.baseObject.getKey(ASAtom.getASAtom("N"));
return object;
}
@Override
public String getNType() {
COSObject N = getNValue();
return getObjectType(N);
}
@Override
public Boolean getNHasTypeStringText() {
COSObject N = getNValue();
return getHasTypeStringText(N);
}
@Override
public Boolean getcontainsS() {
return this.baseObject.knownKey(ASAtom.getASAtom("S"));
}
public COSObject getSValue() {
COSObject object = this.baseObject.getKey(ASAtom.getASAtom("S"));
return object;
}
@Override
public String getSType() {
COSObject S = getSValue();
return getObjectType(S);
}
@Override
public Boolean getSHasTypeName() {
COSObject S = getSValue();
return getHasTypeName(S);
}
@Override
public String getSNameValue() {
COSObject S = getSValue();
return getNameValue(S);
}
@Override
public Boolean getcontainsType() {
return this.baseObject.knownKey(ASAtom.getASAtom("Type"));
}
public COSObject getTypeValue() {
COSObject object = this.baseObject.getKey(ASAtom.getASAtom("Type"));
return object;
}
@Override
public String getTypeType() {
COSObject Type = getTypeValue();
return getObjectType(Type);
}
@Override
public Boolean getTypeHasTypeName() {
COSObject Type = getTypeValue();
return getHasTypeName(Type);
}
@Override
public String getTypeNameValue() {
COSObject Type = getTypeValue();
return getNameValue(Type);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy