Tabnine Logo
TemplateHandler
Code IndexAdd Tabnine to your IDE (free)

How to use
TemplateHandler
in
com.ociweb.pronghorn.pipe.schema.loader

Best Java code snippets using com.ociweb.pronghorn.pipe.schema.loader.TemplateHandler (Showing top 20 results out of 315)

origin: oci-pronghorn/Pronghorn

public static FieldReferenceOffsetManager loadFrom(String source) throws ParserConfigurationException, SAXException, IOException {
  return loadFrom(source,(short)0);
}
origin: com.ociweb/PronghornPipes

public static FieldReferenceOffsetManager loadFrom(InputStream sourceInputStream) throws ParserConfigurationException, SAXException, IOException {
  TemplateHandler handler = new TemplateHandler();
  SAXParserFactory spfac = SAXParserFactory.newInstance();
  SAXParser sp = spfac.newSAXParser();
  sp.parse(sourceInputStream, handler);
  return TemplateHandler.from(handler,(short)0);
}
origin: com.ociweb/pronghorn-pipes

public static void postProcessDictionary(TemplateHandler handler, int byteGap, int maxByteLength) {
  handler.buildDictionaryMemberLists();
  // the catalog file need not be "Small" but it probably will be.
  // the catalog file must be "Fast" to load without any "Processing"
  // needed by the consumer.
  // this enables fast startup/recovery times that do not produce garbage.
  handler.defaultConstValues.setTypeCounts(   handler.tokenBuilderIntCount.intValue(),
                        handler.tokenBuilderLongCount.intValue(),
                        handler.tokenBuilderByteCount.intValue(),
                    byteGap,
                    maxByteLength);
}
origin: com.ociweb/PronghornPipes

public static FieldReferenceOffsetManager loadFrom(String source, short preamble) throws ParserConfigurationException, SAXException, IOException {
  InputStream sourceInputStream = TemplateHandler.class.getResourceAsStream(source);
  File folder = null;
  if (null == sourceInputStream) {
    folder = new File(source);
    if (folder.exists() && !folder.isDirectory()) {
      sourceInputStream = new FileInputStream(source);
    }
  }
  TemplateHandler handler = new TemplateHandler();
  SAXParserFactory spfac = SAXParserFactory.newInstance();
  SAXParser sp = spfac.newSAXParser();
  if (null != sourceInputStream) {
    sp.parse(sourceInputStream, handler);
  } else {
    if (null == folder || null == folder.listFiles()) {
      throw new FileNotFoundException(source);
    }
    for (File f : folder.listFiles()) {
      if (f.isFile()) {
        sp.parse(f, handler);
      }
    }
  }
  return TemplateHandler.from(handler, preamble, simpleName(source));
}
origin: com.ociweb/PronghornPipes

  String dictionaryName = setActiveDictionary(attributes);
  catalogScriptDictionaryNames[catalogTemplateScriptIdx] = dictionaryName;
setActiveDictionary(attributes);
templatesXMLns = attributes.getValue("xmlns");
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("int32")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.IntegerSignedOptional : TypeMask.IntegerSigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("uint64")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.LongUnsignedOptional : TypeMask.LongUnsigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("int64")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.LongSignedOptional : TypeMask.LongSigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("length")) {
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("string")) {
  if ("unicode".equals(attributes.getValue("charset"))) {
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("decimal")) {
  fieldPMapInc = 2; // any operators must count as two PMap fields.
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.DecimalOptional  : TypeMask.Decimal;
  commonIdAttributes(attributes);
  fieldOperator = OperatorMask.Field_None;
origin: oci-pronghorn/Pronghorn

  int token = buildToken(tokenBuilderIntCount);
  int token = buildToken(tokenBuilderLongCount);
  int token = buildToken(tokenBuilderByteCount);
  int idx = token & TokenBuilder.MAX_INSTANCE;
  int tokenExponent = buildToken(tokenBuilderIntCount);
  int tokenMantisssa = buildToken(tokenBuilderLongCount);
} else if (qName.equalsIgnoreCase("bytevector")) {
  int token = buildToken(tokenBuilderByteCount);
  int token = buildToken(tokenBuilderIntCount);
  basicGroupClose(opMask);
  basicGroupClose(opMask);
origin: oci-pronghorn/Pronghorn

  public void play(TemplateHandler handler) throws SAXException
  {
    handler.endElement(uri,localName, qName);
  }
}
origin: com.ociweb/PronghornPipes

public static FieldReferenceOffsetManager from(TemplateHandler handler, short preambleBytes) {
  return from(handler, preambleBytes,"Catalog");
}
origin: com.ociweb/pronghorn-pipes

private void buildDictionaryMemberLists() {
  // walk the lists of dictionary members and join them into a master list
  // for each dictionary.
  // each section must start with stop bit and type for the following
  // identifiers. All cache friendly forward motion.
  int dictionaryCount = dictionaryNames.size();
  tokenIdxMembers = new int[dictionaryCount][];
  tokenIdxMemberHeads = new int[dictionaryCount];
  int j = resetList.size();
  while (--j >= 0) {
    if (!resetList.get(j).isEmpty()) {
      final int d = j >>> TokenBuilder.BITS_TYPE;
      //only allocate exactly what is needed, when it is needed for the type needed
      if (null == tokenIdxMembers[d]) {
        tokenIdxMembers[d] = new int[lengthOfArrayForThisType(d)];
      }
      int t = j & TokenBuilder.MASK_TYPE;
      int stopInt = 0xFFFF0000 | t;
      tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = stopInt;
      // System.err.println("stopInt:"+stopInt+" "+Integer.toBinaryString(stopInt)+" "+TypeMask.toString(t));
      for (Integer i : resetList.get(j)) {
        tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = i.intValue();
      }
    }
  }
  // tokenIdxMembers are ready to be saved but must be trimmed by heads
}
origin: com.ociweb/pronghorn-pipes

public static FieldReferenceOffsetManager loadFrom(String source, short preamble) throws ParserConfigurationException, SAXException, IOException {
  InputStream sourceInputStream = TemplateHandler.class.getResourceAsStream(source);
  File folder = null;
  if (null == sourceInputStream) {
    folder = new File(source);
    if (folder.exists() && !folder.isDirectory()) {
      sourceInputStream = new FileInputStream(source);
    }
  }
  TemplateHandler handler = new TemplateHandler();
  SAXParserFactory spfac = SAXParserFactory.newInstance();
  SAXParser sp = spfac.newSAXParser();
  if (null != sourceInputStream) {
    sp.parse(sourceInputStream, handler);
  } else {
    if (null == folder || null == folder.listFiles()) {
      throw new FileNotFoundException(source);
    }
    for (File f : folder.listFiles()) {
      if (f.isFile()) {
        sp.parse(f, handler);
      }
    }
  }
  return TemplateHandler.from(handler, preamble, simpleName(source));
}
origin: com.ociweb/pronghorn-pipes

  String dictionaryName = setActiveDictionary(attributes);
  catalogScriptDictionaryNames[catalogTemplateScriptIdx] = dictionaryName;
setActiveDictionary(attributes);
templatesXMLns = attributes.getValue("xmlns");
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("int32")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.IntegerSignedOptional : TypeMask.IntegerSigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("uint64")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.LongUnsignedOptional : TypeMask.LongUnsigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("int64")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.LongSignedOptional : TypeMask.LongSigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("length")) {
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("string")) {
  if ("unicode".equals(attributes.getValue("charset"))) {
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("decimal")) {
  fieldPMapInc = 2; // any operators must count as two PMap fields.
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.DecimalOptional  : TypeMask.Decimal;
  commonIdAttributes(attributes);
  fieldOperator = OperatorMask.Field_None;
origin: com.ociweb/PronghornPipes

  int token = buildToken(tokenBuilderIntCount);
  int token = buildToken(tokenBuilderLongCount);
  int token = buildToken(tokenBuilderByteCount);
  int idx = token & TokenBuilder.MAX_INSTANCE;
  int tokenExponent = buildToken(tokenBuilderIntCount);
  int tokenMantisssa = buildToken(tokenBuilderLongCount);
} else if (qName.equalsIgnoreCase("bytevector")) {
  int token = buildToken(tokenBuilderByteCount);
  int token = buildToken(tokenBuilderIntCount);
  basicGroupClose(opMask);
  basicGroupClose(opMask);
origin: com.ociweb/PronghornPipes

  public void play(TemplateHandler handler) throws SAXException
  {
    handler.endElement(uri,localName, qName);
  }
}
origin: oci-pronghorn/Pronghorn

public static FieldReferenceOffsetManager from(TemplateHandler handler, short preambleBytes) {
  return from(handler, preambleBytes,"Catalog");
}
origin: com.ociweb/PronghornPipes

private void buildDictionaryMemberLists() {
  // walk the lists of dictionary members and join them into a master list
  // for each dictionary.
  // each section must start with stop bit and type for the following
  // identifiers. All cache friendly forward motion.
  int dictionaryCount = dictionaryNames.size();
  tokenIdxMembers = new int[dictionaryCount][];
  tokenIdxMemberHeads = new int[dictionaryCount];
  int j = resetList.size();
  while (--j >= 0) {
    if (!resetList.get(j).isEmpty()) {
      final int d = j >>> TokenBuilder.BITS_TYPE;
      //only allocate exactly what is needed, when it is needed for the type needed
      if (null == tokenIdxMembers[d]) {
        tokenIdxMembers[d] = new int[lengthOfArrayForThisType(d)];
      }
      int t = j & TokenBuilder.MASK_TYPE;
      int stopInt = 0xFFFF0000 | t;
      tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = stopInt;
      // System.err.println("stopInt:"+stopInt+" "+Integer.toBinaryString(stopInt)+" "+TypeMask.toString(t));
      for (Integer i : resetList.get(j)) {
        tokenIdxMembers[d][tokenIdxMemberHeads[d]++] = i.intValue();
      }
    }
  }
  // tokenIdxMembers are ready to be saved but must be trimmed by heads
}
origin: com.ociweb/PronghornPipes

public static FieldReferenceOffsetManager loadFrom(String source) throws ParserConfigurationException, SAXException, IOException {
  return loadFrom(source,(short)0);
}
origin: oci-pronghorn/Pronghorn

public static FieldReferenceOffsetManager loadFrom(String source, short preamble) throws ParserConfigurationException, SAXException, IOException {
  InputStream sourceInputStream = TemplateHandler.class.getResourceAsStream(source);
  File folder = null;
  if (null == sourceInputStream) {
    folder = new File(source);
    if (folder.exists() && !folder.isDirectory()) {
      sourceInputStream = new FileInputStream(source);
    }
  }
  TemplateHandler handler = new TemplateHandler();
  SAXParserFactory spfac = SAXParserFactory.newInstance();
  SAXParser sp = spfac.newSAXParser();
  if (null != sourceInputStream) {
    sp.parse(sourceInputStream, handler);
  } else {
    if (null == folder || null == folder.listFiles()) {
      throw new FileNotFoundException(source);
    }
    for (File f : folder.listFiles()) {
      if (f.isFile()) {
        sp.parse(f, handler);
      }
    }
  }
  return TemplateHandler.from(handler, preamble, simpleName(source));
}
origin: oci-pronghorn/Pronghorn

  String dictionaryName = setActiveDictionary(attributes);
  catalogScriptDictionaryNames[catalogTemplateScriptIdx] = dictionaryName;
setActiveDictionary(attributes);
templatesXMLns = attributes.getValue("xmlns");
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("int32")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.IntegerSignedOptional : TypeMask.IntegerSigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("uint64")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.LongUnsignedOptional : TypeMask.LongUnsigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("int64")) {
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.LongSignedOptional : TypeMask.LongSigned;
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("length")) {
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("string")) {
  if ("unicode".equals(attributes.getValue("charset"))) {
  commonIdAttributes(attributes);
} else if (qName.equalsIgnoreCase("decimal")) {
  fieldPMapInc = 2; // any operators must count as two PMap fields.
  fieldType = "optional".equals(attributes.getValue("presence")) ? TypeMask.DecimalOptional  : TypeMask.Decimal;
  commonIdAttributes(attributes);
  fieldOperator = OperatorMask.Field_None;
origin: com.ociweb/pronghorn-pipes

public static FieldReferenceOffsetManager loadFrom(InputStream sourceInputStream) throws ParserConfigurationException, SAXException, IOException {
  TemplateHandler handler = new TemplateHandler();
  SAXParserFactory spfac = SAXParserFactory.newInstance();
  SAXParser sp = spfac.newSAXParser();
  sp.parse(sourceInputStream, handler);
  return TemplateHandler.from(handler,(short)0);
}
origin: com.ociweb/pronghorn-pipes

  int token = buildToken(tokenBuilderIntCount);
  int token = buildToken(tokenBuilderLongCount);
  int token = buildToken(tokenBuilderByteCount);
  int idx = token & TokenBuilder.MAX_INSTANCE;
  int tokenExponent = buildToken(tokenBuilderIntCount);
  int tokenMantisssa = buildToken(tokenBuilderLongCount);
} else if (qName.equalsIgnoreCase("bytevector")) {
  int token = buildToken(tokenBuilderByteCount);
  int token = buildToken(tokenBuilderIntCount);
  basicGroupClose(opMask);
  basicGroupClose(opMask);
com.ociweb.pronghorn.pipe.schema.loaderTemplateHandler

Most used methods

  • loadFrom
  • <init>
  • basicGroupClose
  • basicGroupStart
  • buildDictionaryMemberLists
  • buildToken
  • commonIdAttributes
  • endElement
  • from
  • lengthOfArrayForThisType
  • saveResetListMembers
  • setActiveDictionary
  • saveResetListMembers,
  • setActiveDictionary,
  • simpleName,
  • startElement

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JLabel (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now