com.metsci.glimpse.dspl.util
Class DsplHelper

java.lang.Object
  extended by com.metsci.glimpse.dspl.util.DsplHelper

public class DsplHelper
extends java.lang.Object


Field Summary
static java.lang.String canonicalGoogleLocalBase
           
static java.lang.String canonicalGoogleNamespace
           
static java.lang.String canonicalGoogleUrlBase
           
static java.lang.String canonicalMetronLocalBase
           
static java.lang.String canonicalMetronNamespace
           
static java.lang.String defaultDsplNamespace
           
static java.lang.String dsplSchema
           
static java.lang.String LANGUAGE_ENGLISH
           
static java.util.logging.Logger logger
           
static java.lang.String objectFactoryProp
           
 
Constructor Summary
DsplHelper()
           
 
Method Summary
static void checkConceptReferences(DataSet dataset)
           
static boolean checkLegalOverride(DataSet dataset, Attribute child, Attribute parent)
           
static boolean checkLegalOverride(DataSet dataset, ConceptProperty child, ConceptProperty parent)
           
static boolean equals(Concept ref1, Concept ref2)
           
static boolean equals(javax.xml.namespace.QName ref1, javax.xml.namespace.QName ref2)
           
static boolean equals(java.lang.String namespace1, java.lang.String local1, java.lang.String namespace2, java.lang.String local2)
           
static java.io.InputStream getCanonicalLocalTableInputStream(java.lang.String file, java.lang.String localBase)
           
static java.io.InputStream getCanonicalNetworkTableInputStream(java.lang.String file, java.lang.String urlBase)
           
static java.io.InputStream getCanonicalTableInputStream(DsplParser parser, java.lang.String file, java.lang.String localBase, java.lang.String urlBase)
           
static Concept getCompatibleConceptRef(Slice slice, Concept superConcept, java.util.List<SliceConceptRef> refs)
           
static Concept getConcept(DataSet dataset, java.lang.String namespace, java.lang.String local)
          Searches the provided dataset (and recursively searches that dataset's imported datasets) for the Concept with id matching the provided id.
static java.io.InputStream getLocalTableInputStream(DataSet dataSet, java.lang.String name)
           
static java.lang.String getName(java.lang.String namespace)
           
static Concept getParentConcept(DataSet dataset, Concept concept)
           
static Table getTable(Concept concept)
           
static Table getTable(DataSet dataset, javax.xml.namespace.QName ref)
           
static Table getTable(DataSet dataset, java.lang.String namespace, java.lang.String local)
           
static Table getTable(Slice slice)
           
static PropertyTableData getTableData(Concept concept)
           
static SliceTableData getTableData(Slice slice)
           
static java.io.InputStream getTableInputStream(Concept concept)
           
static java.io.InputStream getTableInputStream(Slice slice)
           
static java.io.InputStream getTableInputStream(Table table)
           
static java.lang.String getValueEnglish(java.util.List<Value> valueList)
           
static boolean isInstanceOf(Concept subConcept, Concept superConcept)
          Tests whether subConcept either is the same concept as superConcept, or has superConcept somewhere in its parent Concept hierarchy.
static boolean isLessRestrictiveThan(DataType childType, DataType parentType)
           
static DataSet linkDataset(DsplParser parser, DataSet dataset)
           
static DataSet linkDataset(DsplParser parser, DataSet dataset, java.io.File base)
           
static DataSet loadCanonicalDataset(DsplParser parser, java.lang.String namespace, java.lang.String localBase, java.lang.String urlBase)
           
static DataSet loadDataset(DsplParser parser, DataSet parent, java.lang.String namespace, java.lang.String location)
           
static DataSet loadDataset(DsplParser parser, java.io.InputStream stream, java.io.File base)
           
static void loadImportedDataSets(DsplParser parser, DataSet dataset)
           
static DataSet loadLocalCanonicalDataset(DsplParser parser, java.lang.String namespace, java.lang.String localBase)
           
static DataSet loadNetworkCanonicalDataset(DsplParser parser, java.lang.String namespace, java.lang.String urlBase)
           
static DataSet loadNonCanonicalDataSet(DsplParser parser, DataSet parent, java.lang.String namespace, java.lang.String location)
           
static void resolveConceptExtension(DataSet dataset)
           
static Concept resolveConceptExtension(DataSet dataset, Concept concept)
           
static void resolveConceptIds(DataSet dataset)
           
static void resolveConceptRefs(DataSet dataset)
           
static void resolveConceptTypes(DataSet dataset)
           
static void resolveDataSetLinks(DataSet dataset)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final java.util.logging.Logger logger

defaultDsplNamespace

public static final java.lang.String defaultDsplNamespace
See Also:
Constant Field Values

canonicalGoogleNamespace

public static final java.lang.String canonicalGoogleNamespace
See Also:
Constant Field Values

canonicalGoogleUrlBase

public static final java.lang.String canonicalGoogleUrlBase
See Also:
Constant Field Values

canonicalGoogleLocalBase

public static final java.lang.String canonicalGoogleLocalBase
See Also:
Constant Field Values

canonicalMetronNamespace

public static final java.lang.String canonicalMetronNamespace
See Also:
Constant Field Values

canonicalMetronLocalBase

public static final java.lang.String canonicalMetronLocalBase
See Also:
Constant Field Values

dsplSchema

public static final java.lang.String dsplSchema
See Also:
Constant Field Values

objectFactoryProp

public static final java.lang.String objectFactoryProp
See Also:
Constant Field Values

LANGUAGE_ENGLISH

public static final java.lang.String LANGUAGE_ENGLISH
See Also:
Constant Field Values
Constructor Detail

DsplHelper

public DsplHelper()
Method Detail

loadDataset

public static DataSet loadDataset(DsplParser parser,
                                  DataSet parent,
                                  java.lang.String namespace,
                                  java.lang.String location)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException,
                                  DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

loadNonCanonicalDataSet

public static DataSet loadNonCanonicalDataSet(DsplParser parser,
                                              DataSet parent,
                                              java.lang.String namespace,
                                              java.lang.String location)
                                       throws javax.xml.bind.JAXBException,
                                              java.io.IOException,
                                              DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

loadLocalCanonicalDataset

public static DataSet loadLocalCanonicalDataset(DsplParser parser,
                                                java.lang.String namespace,
                                                java.lang.String localBase)
                                         throws javax.xml.bind.JAXBException,
                                                java.io.IOException,
                                                DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

loadNetworkCanonicalDataset

public static DataSet loadNetworkCanonicalDataset(DsplParser parser,
                                                  java.lang.String namespace,
                                                  java.lang.String urlBase)
                                           throws javax.xml.bind.JAXBException,
                                                  java.io.IOException,
                                                  DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

loadCanonicalDataset

public static DataSet loadCanonicalDataset(DsplParser parser,
                                           java.lang.String namespace,
                                           java.lang.String localBase,
                                           java.lang.String urlBase)
                                    throws javax.xml.bind.JAXBException,
                                           java.io.IOException,
                                           DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

loadDataset

public static DataSet loadDataset(DsplParser parser,
                                  java.io.InputStream stream,
                                  java.io.File base)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException,
                                  DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

linkDataset

public static DataSet linkDataset(DsplParser parser,
                                  DataSet dataset)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException,
                                  DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

linkDataset

public static DataSet linkDataset(DsplParser parser,
                                  DataSet dataset,
                                  java.io.File base)
                           throws javax.xml.bind.JAXBException,
                                  java.io.IOException,
                                  DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

loadImportedDataSets

public static void loadImportedDataSets(DsplParser parser,
                                        DataSet dataset)
                                 throws javax.xml.bind.JAXBException,
                                        java.io.IOException,
                                        DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

getTableData

public static SliceTableData getTableData(Slice slice)
                                   throws java.io.IOException,
                                          javax.xml.bind.JAXBException,
                                          DsplException
Throws:
java.io.IOException
javax.xml.bind.JAXBException
DsplException

getTableData

public static PropertyTableData getTableData(Concept concept)
                                      throws java.io.IOException,
                                             javax.xml.bind.JAXBException,
                                             DsplException
Throws:
java.io.IOException
javax.xml.bind.JAXBException
DsplException

getTableInputStream

public static java.io.InputStream getTableInputStream(Concept concept)
                                               throws java.io.IOException,
                                                      javax.xml.bind.JAXBException,
                                                      DsplException
Throws:
java.io.IOException
javax.xml.bind.JAXBException
DsplException

getTableInputStream

public static java.io.InputStream getTableInputStream(Slice slice)
                                               throws java.io.IOException,
                                                      javax.xml.bind.JAXBException,
                                                      DsplException
Throws:
java.io.IOException
javax.xml.bind.JAXBException
DsplException

getTable

public static Table getTable(Slice slice)
                      throws javax.xml.bind.JAXBException,
                             java.io.IOException,
                             DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

getTable

public static Table getTable(Concept concept)
                      throws javax.xml.bind.JAXBException,
                             java.io.IOException,
                             DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

getTable

public static Table getTable(DataSet dataset,
                             javax.xml.namespace.QName ref)
                      throws javax.xml.bind.JAXBException,
                             java.io.IOException,
                             DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

getTable

public static Table getTable(DataSet dataset,
                             java.lang.String namespace,
                             java.lang.String local)
                      throws javax.xml.bind.JAXBException,
                             java.io.IOException,
                             DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

getTableInputStream

public static java.io.InputStream getTableInputStream(Table table)
                                               throws java.io.IOException
Throws:
java.io.IOException

getCanonicalTableInputStream

public static java.io.InputStream getCanonicalTableInputStream(DsplParser parser,
                                                               java.lang.String file,
                                                               java.lang.String localBase,
                                                               java.lang.String urlBase)
                                                        throws java.io.IOException
Throws:
java.io.IOException

getCanonicalLocalTableInputStream

public static java.io.InputStream getCanonicalLocalTableInputStream(java.lang.String file,
                                                                    java.lang.String localBase)
                                                             throws java.io.IOException
Throws:
java.io.IOException

getCanonicalNetworkTableInputStream

public static java.io.InputStream getCanonicalNetworkTableInputStream(java.lang.String file,
                                                                      java.lang.String urlBase)
                                                               throws java.io.IOException
Throws:
java.io.IOException

getLocalTableInputStream

public static java.io.InputStream getLocalTableInputStream(DataSet dataSet,
                                                           java.lang.String name)

getConcept

public static Concept getConcept(DataSet dataset,
                                 java.lang.String namespace,
                                 java.lang.String local)
                          throws javax.xml.bind.JAXBException,
                                 java.io.IOException,
                                 DsplException
Searches the provided dataset (and recursively searches that dataset's imported datasets) for the Concept with id matching the provided id.

Parameters:
dataset - the dataset to search for the concept in
id - the concept to search for
Returns:
the concept referenced by id
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

checkConceptReferences

public static void checkConceptReferences(DataSet dataset)
                                   throws javax.xml.bind.JAXBException,
                                          java.io.IOException,
                                          DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

resolveConceptIds

public static void resolveConceptIds(DataSet dataset)
                              throws DsplException
Throws:
DsplException

resolveConceptRefs

public static void resolveConceptRefs(DataSet dataset)

resolveDataSetLinks

public static void resolveDataSetLinks(DataSet dataset)
                                throws javax.xml.bind.JAXBException,
                                       java.io.IOException
Throws:
javax.xml.bind.JAXBException
java.io.IOException

resolveConceptExtension

public static void resolveConceptExtension(DataSet dataset)
                                    throws javax.xml.bind.JAXBException,
                                           java.io.IOException,
                                           DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

resolveConceptTypes

public static void resolveConceptTypes(DataSet dataset)
                                throws javax.xml.bind.JAXBException,
                                       java.io.IOException,
                                       DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

resolveConceptExtension

public static Concept resolveConceptExtension(DataSet dataset,
                                              Concept concept)
                                       throws javax.xml.bind.JAXBException,
                                              java.io.IOException,
                                              DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

checkLegalOverride

public static boolean checkLegalOverride(DataSet dataset,
                                         Attribute child,
                                         Attribute parent)
                                  throws javax.xml.bind.JAXBException,
                                         java.io.IOException,
                                         DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

checkLegalOverride

public static boolean checkLegalOverride(DataSet dataset,
                                         ConceptProperty child,
                                         ConceptProperty parent)
                                  throws javax.xml.bind.JAXBException,
                                         java.io.IOException,
                                         DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

isLessRestrictiveThan

public static boolean isLessRestrictiveThan(DataType childType,
                                            DataType parentType)

isInstanceOf

public static boolean isInstanceOf(Concept subConcept,
                                   Concept superConcept)
Tests whether subConcept either is the same concept as superConcept, or has superConcept somewhere in its parent Concept hierarchy.

Parameters:
subConcept -
superConcept -
Returns:
true if subConcept is an instance of superConcept

equals

public static boolean equals(Concept ref1,
                             Concept ref2)

equals

public static boolean equals(javax.xml.namespace.QName ref1,
                             javax.xml.namespace.QName ref2)

equals

public static boolean equals(java.lang.String namespace1,
                             java.lang.String local1,
                             java.lang.String namespace2,
                             java.lang.String local2)

getParentConcept

public static Concept getParentConcept(DataSet dataset,
                                       Concept concept)
                                throws javax.xml.bind.JAXBException,
                                       java.io.IOException,
                                       DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

getCompatibleConceptRef

public static Concept getCompatibleConceptRef(Slice slice,
                                              Concept superConcept,
                                              java.util.List<SliceConceptRef> refs)
                                       throws javax.xml.bind.JAXBException,
                                              java.io.IOException,
                                              DsplException
Throws:
javax.xml.bind.JAXBException
java.io.IOException
DsplException

getName

public static java.lang.String getName(java.lang.String namespace)
                                throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getValueEnglish

public static java.lang.String getValueEnglish(java.util.List<Value> valueList)


Copyright © 2012 Metron, Inc.. All Rights Reserved.